Le Divin Crackme
In this challenge, we are given this executable.
We can guess the password L4_pH1l0soPh13_d4N5_l3_Cr4cKm3
. This is because the password is stored in the memory and the use of strncmp
will allow the program to get the password split in 3 blocks of 10 characters. The variables are initialized in the following order local_48
, acStack_3e
, acStack_34
. So they will follow each other in the memory. So when we do our first strncmp
, we get the 10 characters in the position of acStack_3e
. acStack_3e
is in the second position, so we get from the 11th character to the 21st. Same for local_48
and the first 10 characters and acStack_34
and the last 10 characters..
The flag needs also to contain the compiler used to get this executable. It was gcc
, this could be found in the .comment
section of the executable:
The final flag is then 404CTF{gcc:strncmp:L4_pH1l0soPh13_d4N5_l3_Cr4cKm3}