Skip to content

Instantly share code, notes, and snippets.

@1lastBr3ath
Created November 15, 2015 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1lastBr3ath/cf975f6acd32f662b52a to your computer and use it in GitHub Desktop.
Save 1lastBr3ath/cf975f6acd32f662b52a to your computer and use it in GitHub Desktop.
#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