We are given a Linux binary and need to find the correct password. Opening it in a decompiler gives a very readable
int main(int argc, const char **argv, const char **envp)
{
char buf[44];
int v5;
initialize_flag(argc, argv, envp);
puts("Give me your password: ");
v5 = read(0, buf, 0x1Fu);
buf[v5 - 1] = 0;
if (!strcmp(buf, "m4gic_passw0rd"))
{
puts("Thats the right password!");
printf("Flag: %s", flagBuffer);
}
else
{
puts("Thats not the password!");
}
return 0;
}
The binary reads our input, removes the newline, and compares it with the hardcoded string
ncat --ssl-verify c6a5xcqpslgjvckddg3q7accym-1024-intro-rev-1.challenge.cscg.live 443
Give me your password:
m4gic_passw0rd
Thats the right password!
Flag: CSCG{congrats_t0_y0ur_(maybe?)_f1rst_r3versing_t4sk}