/*
 * Sample code for Local Exploitation
 *
 * Test setup: (as root)
 *    * gcc -o vuln1 vuln1.c
 *    * chmod 4755 vuln1
 *
 * Change to normal user and try to exploit the binary to gain root
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void do_comp(int argc, char **argv)
{
   char buf[512];

   argc--;
   strcpy(buf, argv[1]);
}

int main(int argc, char **argv)
{
   if(argc != 2)
      return 1;

   do_comp(argc, argv);

   return 0;
}
