Created
November 15, 2015 03:21
-
-
Save 1lastBr3ath/cf975f6acd32f662b52a to your computer and use it in GitHub Desktop.
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
int main() { | |
char buf[20]; | |
int x = 0; | |
gets(buf); | |
if (x == 1337) { | |
gid_t gid = getegid(); | |
setresgid(gid, gid, gid); | |
FILE *fp; | |
fp = fopen("flag.txt", "r"); | |
char flag[64]; | |
fgets(flag, 64, (FILE*) fp); | |
printf("Here's a flag: %s\n", flag); | |
} | |
printf("%d\n", x); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment