Published by: Nabukadnezar, on 2008-01-15 16:54:31
Step 1 - What do you need a. A Linux Distribution (For example I used Ubuntu 7.10 under VMware Workstation) b. Boomerang Decompiler
Official Description: A general, open source, retargetable decompiler of machine code programs
Download from: http://boomerang.sourceforge.net/ c. Evan's Debugger
Official Description: A debugger which is as functional and usable as OllyDbg but for Linux
Download from: http://www.codef00.com/
Step 2 - Understanding the program
Download it in Boomerang's directory:
CODE :
It says "Can't open.". Strange.
Let's decompile and try to understand it better.
CODE :
# ./boomerang app20
Now analyze the output files. Try to understand the basics of the code. There's a main function and a strange complex mathematical one.
Each starts with an address which you'll copy in some other file temp.txt for easier later use. So now you got two addresses of two functions and a basic understanding of the program. Go to the next step.
Step 3 - Prepare
If you skipped the last step you won't be able to do this one.
Step 4 - The Fun Part
Open Evan's Debugger, configure the symbols/plugins directories if needed and set the initial breakpoint to the application entry point. Open app20 with the debugger and press F9 to start the application. It automatically breaks after initialization. Right click, select Goto Address, paste the address of the main function and put a break on it. Then do the same for the mathematical function. Continue the run of the program with F9 until it ends. You will notice that it didn't even call the mathematical function. Reload it, start it, put the same two breakpoints but this time look in the main function until you find the location where the mathematical function is called. Don't forget to also note the address of this call in temp.txt
You might need it if you fail from the first try.
What you found looks like this:
CODE :
test ...
jnz ...
[...] call ADDRESS
You need to force the program to make that call.
[faith]
What I did was simply right clicking on CODE :
test ...
, selected Edit Bytes, copied the Hex stuff, then right clicked on CODE :
jnz ...
, again selected Edit Bytes and pasted the Hex stuff from the previous command. It now looked like this:
CODE :
test ...
test ...
[...] call ADDRESS
[/faith]
Now just keep clicking F9 until the program is finished and check its output. You got a password! Modify it a bit and finish the level.
Cast your vote on this article 10 - Highest, 1 - Lowest
Comments: Published: 16 comments.
This site is the collective work of the
HackThisSite staff. Please don't reproduce in part or whole without permission.
Page Generated: Sat, 21 Nov 2009 14:55:19 +0000 Exec:
9 Page loaded in 0.20663 seconds! Current Code Revision: 79-Stable