7c970f316f
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.
25 lines
368 B
C
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);
|
|
}
|