getting root acccess without sudo
Dec 29
2007
2007
Comments Off
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include "sys/types.h" #include "unistd.h" #include "stdlib.h" #include "stdio.h" int main(int argc, char** argv) { int root_id = 0; char *command = argv[1]; if(!command) command = "/bin/bash"; setuid(root_id); system(command); exit(0); } |
root# gcc -o temproot temproot.c
root# chmod +s temproot
nobody$ alias root=’temproot “su – root”’
nobody$ root