Reverse challenge, using IDA to convert the binary into c pseudo code:
We can see that the flag must be in the arguments of the flag, each byte of the flag will be an argv, the flag has 31 bytes as we can see in if
check. Looking at the generated code we can see that each byte of the flag is being saved from the variable v6 to v35. After this we can see a bunch of if
verifications:
We can see it checks 3 bytes at time, with 3 different operation checks:
1 | (v7+v6-v8 == key[0] && v6-v7+v8 == key[1] && v7-v6+v8 == key[2]) == true |
And this repeats for all 3 bytes along the flag… it’s simple to write a python script to brute force the flag:
1 | import string |
Running it:
1 | $ python nocalm.py |