Monday, 22 August 2016

BioTerra CTF - Wathzefugg

This RE challenge was pretty easy. It compares between each character  of two different strings and stores the character which has higher ascii value at another location. All the characters with the higher ascii value form the flag of the challenge.

I have used IDA pro and GDB to solve the challenge.

1. Go to the main function after loading the file in IDA. There we can see the two strings used for comparison and a function call before the puts statement, go to that function.

1

2. In that function we can see a comparison statement. It is used to compare between the ascii value of each character of string 1 with that of string 2.

21

3. After the comparison the value is stored at [rax], put a break point at the address of loc_400703 in GDB and then keep noting the [rax] value after each iteration.

22

After the final iteration you will get the flag as:

{Easy_P3aSyeLpk3NwraTJJmEcvKRUr}


Also for the better understanding of the you might want to look at the pseudocode produced by IDA :

23.jpg

Thanks for reading.