nikolatesla20
February 26th, 2003, 12:38
Debugger attack is functional!
Yep, it works now hehehe
AUTO-DEBUGGER BRUTE FORCER
Here's what I had to do.
Each time we "crash" we need to restore everything we can back to what it was when functional. Hence, we throw an INT3 on the beginning of the decryption loop, and when this fires one time, we pick it up. While we are there, we grab the thread's context so we have ALL the registers, the EFlags, even the DS segment. Also, I grab 200 bytes of the stack.
One other thing we want to do is grab the code of the decryptor routine itself, as well as the IAT table code. Why? Because if we've come up with junk instructions, they could have hosed ANYTHING in the program up, and usually they will. So EACH TIME we have an exception, we need to restore the following:
1. The original encrypted data.
2. The decryptor code loop.
3. the IAT table, since we need this to call messageboxa.
4. 200 bytes of the stack (I just picked the number 200) - just in case
5. All of the registers, and the DS segment.
If we do this, we should be successful at forcing the loop to do our work for us.
Now, what about decrypted code that locks up ? like an infinite loop or a huge string intsruction? How do we fix that?
Easy. We create a seperate watcher thread from our debugger. Each time we encounter an exception and fix the code for the next number test, we set a flag telling the watcher to start watching. I set a sleep time of 1 second on the watcher thread. If the thread gets past this 1 second and sees that it needs to still check status, it forcibly suspends the debuggee, patches an INT3 in the current instruction, and resumes it. This forces the bruteme2 program to generate an exception, which lets the debugger take over again and go to the next number.
It works quite nicely, easily going thru all the number combinations (so far as I've tested).
If you compile this and run it you will definitely find the code you need.
Some people might think that I am giving the debugger too much information - but think, no I am not. I simply tell the debugger to restore the complete state of the program each time an exception occurs. Then I also restore the IAT - since I know that the bruteme2 uses MessageBoxA to show us the message, I can hook into that with an INT3 and watch for that address in my debugger. If that address comes thru, I can assume the decrypted code came out to something valid enought to at least call MessageBoxA, so it is very likely to be the right serial number.
To use:
1. Get the list of Serial numbers
hxxp://webpages.charter.net/nikolatesla20/matches.txt
2. change the path of bruteme2 and matches.txt in the program to fit your system and compile it.
3. run the debugger
4. open "register" in bruteme2 and enter the first serial number, 131071.
5. Press OK and the debugger takes over.
6. Wait for the message to come up that it may have found the serial.
7. Enjoy
BY THE WAY: This works on Win2K and XP. I tested it in 9X and it crashes big time.
-nt20