![]() |
EpiRootkit
By STDBOOL
|
#include "network.h"Go to the source code of this file.
Classes | |
| struct | dns_header_t |
| DNS protocol header (network byte order, it is important). More... | |
Functions | |
| static int | dns_send_query (const char *query_name, __be16 question_type, u8 *response_buffer, int *response_length) |
| Send a single DNS question and receive the raw response. | |
| int | dns_send_data (const char *data, size_t data_len) |
| Exfiltrate a data buffer over DNS by hex-chunked A-queries. | |
| int | dns_receive_command (char *out_buffer, size_t max_length) |
| Poll the attacker via DNS TXT-query for a pending command. | |
| int dns_receive_command | ( | char * | out_buffer, |
| size_t | max_length | ||
| ) |
Poll the attacker via DNS TXT-query for a pending command.
| out_buffer | Buffer to store received command string. |
| max_length | Maximum size of out_buffer. |
Definition at line 222 of file dns.c.
| int dns_send_data | ( | const char * | data, |
| size_t | data_len | ||
| ) |
Exfiltrate a data buffer over DNS by hex-chunked A-queries.
Splits data into chunks of DNS_MAX_CHUNK bytes, prefixes each chunk with a "seq/total-" header, hex-encodes, and sends as subdomains. Sleeps briefly between queries to avoid flooding.
| data | Pointer to data buffer to send. |
| data_len | Length of data in bytes. |
Definition at line 149 of file dns.c.
|
static |
Send a single DNS question and receive the raw response.
Constructs a DNS query for query_name with type question_type, adds an EDNS0 OPT record to request up to DNS_MAX_BUF bytes, sends over UDP to the configured DNS_SERVER_IP, and blocks for the reply.
| query_name | Full qname (labels + domain) to query. |
| question_type | QTYPE in network byte order (e.g. htons(1) for A, htons(16) for TXT). |
| response_buffer | Buffer to store the received packet data. |
| response_length | Size of response_buffer |
Definition at line 35 of file dns.c.