IRC Bot Takeover - 486 Points
WARNING! DON’T EXECUTE THIS SAMPLE IN YOUR OWN PERSONAL MACHINE!!!
Update: We had some problems with a specific step of the challenge (still possible to solve, but more hard) and we updated the binary. The new file has the old version, but you only need the new to solve.
This malware was about controlling a bot net via IRC, we were allowed to access it since the url and port were bot present in the binary, but we didn’t really needed to access it to solve this, unless you infected a machine of yours to debug it to understand better how the malware works(some people actually did this I saw some bots from other players in a channel in IRC we actually could control them lol).
This challenge as in Ransomware and w32.killah is once again to decrypt obfuscated strings, but this time they are encrypting the string two times:
There were two executables, one of them was useless the one that has the encrypted flag was bot.exe.
The code above is present at the sub-routine sub_4012E1 if you use IDA open the binary (bot.exe executable). Once again the xor_encryption2 is exactly like w32.killah, I had to brute force the key once again, but this time since they are encrypting twice I need to brute force two keys instead of one:
1 | import struct |
The first part of the flag:1
2
3
4
5
6
7
8$ python ircbot.py | grep '3DS{'
3DS{wpwgcw8lsgd 139 8
3DS{who_#o0ls_d 229 98
3DS{who_#o0ls_d 228 99
3DS{who_#o0ls_d 230 99
3DS{who_co0ls_d 133 130
3DS{who_co0ls_d 132 131
3DS{who_co0ls_d 134 131
The rest:
1 | $ python ircbot.py | grep '}\s' |
A simple script to join the parts of the flag since we now know the keys:
1 | import struct |
Running it
1 | $ python ircbot.py |
The flag was 3DS{who_co0ls_duck_4sS_is_lak3!}, note that the first line is other obfuscated strings you could decrypt to help you understand the control flow of the binary.