Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <signal.h>
  4. #include <setjmp.h>
  5.  
  6. void catcher(int a)
  7. {
  8.         setresuid(geteuid(),geteuid(),geteuid());
  9.     printf("WIN!\n");
  10.         system("/bin/sh");
  11.         exit(0);
  12. }
  13.  
  14. int main(int argc, char **argv)
  15. {
  16.     puts("source code is available in level02.c\n");
  17.  
  18.         if (argc != 3 || !atoi(argv[2]))
  19.                 return 1;
  20.         signal(SIGFPE, catcher);
  21.         return atoi(argv[1]) / atoi(argv[2]);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement