I want to create RE CTF, that the user needs to discover which string he need to write in order to execute a function that will print the flag, but, with a simple strings
command in shell, we can discover the flag in the printf
function. So, how can we make this not to happen?
#include <stdio.h>
void print_flag() {
printf("secret_string discovered. flag: {eAsy_p3asy}");
}
int main()
{
int c;
c = getchar();
while (c != 'secret_string') {
putchar(c);
c = getchar();
}
print_flag();
return 0;
}
Go to Source
Author: ArlichBachman