Created
March 10, 2013 05:37
-
-
Save flaneur2020/5127269 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| level2@io:/levels$ cat level02.c | |
| //a little fun brought to you by bla | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <signal.h> | |
| #include <setjmp.h> | |
| void catcher(int a) | |
| { | |
| setresuid(geteuid(),geteuid(),geteuid()); | |
| printf("WIN!\n"); | |
| system("/bin/sh"); | |
| exit(0); | |
| } | |
| int main(int argc, char **argv) | |
| { | |
| puts("source code is available in level02.c\n"); | |
| if (argc != 3 || !atoi(argv[2])) | |
| return 1; | |
| signal(SIGFPE, catcher); | |
| return abs(atoi(argv[1])) / atoi(argv[2]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment