easyctf-2017/simple-rop/simple-rop.c
John 7c970f316f Added a simple rop problem
Needs to be built on a linux machine and the binary put in the
files/description so that its easier to solve. Also needs to be put on
the shell.
2017-03-09 02:56:41 -06:00

25 lines
368 B
C

#include <stdio.h>
#include <stdlib.h>
void print_flag();
void what_did_you_say();
int main(int argc, char* argv[])
{
gid_t gid = getegid();
setresgid(gid, gid, gid);
what_did_you_say();
return 0;
}
void print_flag()
{
system("cat flag.txt");
}
void what_did_you_say()
{
char buff[64];
gets(buff);
printf("You said: %s\n", buff);
}