getting root acccess without sudo

Posted by root Sat, 29 Dec 2007 15:31:00 GMT

#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

Posted in  | Tags  | no comments

Comments

Comments are disabled