2017-03-13 05:26:28 +00:00
|
|
|
#define _GNU_SOURCE
|
2017-03-09 08:56:41 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2017-03-13 05:26:28 +00:00
|
|
|
#include <sys/types.h>
|
2017-03-09 08:56:41 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|