[Writeup][Break In CTF 2017][Reverse] Simple Secret - Part 1
Hint:
“Mandy and Aalekh are good friends. Once Mandy thought of giving Aalekh a challenge where Aalekh has to extract the secret key used by Mandy in his C program. The executable generated by Mandy is given below. Can you help Aalekh in finding the secret key hidden by Mandy?”
Tag: #ReverseEngineering
After download we have a file a.out
You can check file type and open it using ida64
That result:
a.out; ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
And C code in ida64
int __cdecl main(int argc, const char **argv, const char **envp)
{
int result; // eax@4
__int64 v4; // rdx@4
char v5; // [sp+10h] [bp-2720h]@1
__int64 v6; // [sp+2728h] [bp-8h]@1
v6 = *MK_FP(__FS__, 40LL);
scanf("%s", &v5, envp, argv);
if ( &v5 == "the_flag_is_bond_007" )
puts("Gotcha");
else
puts("Better luck next time");
result = 0;
v4 = *MK_FP(__FS__, 40LL) ^ v6;
return result;
}
But easy way is open it using notepad
and search flag
Flag:
bond_007
^ ^ That all!!