Reverse Engineering
Reverse Engineering Resources
Reverse Engineering: Introduction
Reverse Engineering: Functions and Frames
Reverse Engineering: Data Access
Reverse Engineering: Static Tools
Reverse Engineering: Dynamic Tools
Reverse Engineering: Real-world Applications
Other Resources
There are many resources related to reverse engineering around the internet.
- A good place to start is a series of walkthroughs of several hacking challenges by ASU's own Adam Doupe on his YouTube channel.
- A comprehensive reverse engineering tutorial series.
Useful Tools
As mentioned in the slides, there are a number of useful tools for this assignment! Here is a (non-exhaustive) list:
gdbwill let you run and inspect the state of these programs. Please check out the Debugging Refresher module. We have also provided a quick briefer here. Some useful gdb concepts:- Know the difference between
step instruction(si) andnext instruction(ni). It boils down to the fact thatsiwill follow jumps, andniwill step over jumps. This means that if you usesi, you will quickly find yourself crawling through libc code, which is insane and unnecessary. - You can use
x/i $ripto disassemble the next instruction that will be executed. You can calldisplay/i $ripto make the next instruction display every time gdb prompts you for input. You can also dox/2ianddisplay/2ito print two (or other quantities of) instructions. - The
disascommand will disassemble the current function that you are looking at. - gdb can be scripted! Look up conditional breakpoints and scriptable breakpoints in the gdb manual.
- Modern binaries are position independent, meaning that they can be loaded anywhere in memory when they run.
GDB will load them at the offset
0x555555554000. This means that if objdump is telling you that main starts at some address like,0x100, the address when debugging with GDB will be0x555555554100
- Know the difference between
stringswill list printable strings in the file. This is useful for looking for constant strings that the program checks for (such as file names and so on) in the course of getting input. Keep in mind that the options for string include a minimum size that it will print.- Don't forget about pwntools! You will need to interact heavily with these programs. Do it right (with pwntools).
rappelis a nice tool to help you figure out what certain instructions do.- Tools for reverse engineering actual binaries:
- IDA, accessible via the Desktop in the dojo, is the industry standard of reverse-engineering tools.
- Ghidra, also accessible via the Desktop in the dojo, is an open source direct competitor to IDA that is used and loved by many.
- angr-management, also accessible via the Desktop in the dojo, is an open source up-and-coming reversing tool with some advanced functionality.
- Binary Ninja Cloud, accessible separately through your web browser, is a free binary reverse engineering tool.
- In a pinch,
objdump -d -M intel the_binarywill disassemble the binary you want to look at.-M intel, in that command, makes objdump give you nice and readable Intel assembly syntax.
Reverse Engineering Class Streams
Reverse Engineering Class Streams
Follow along with a live class with the same demo as the instructor!
Reversing with Rob Class Stream
Patriot CTF 2022 - String Cheese
Crackmes
Crackmes
The classic reverse engineering challenge is a "crackme", where you are given a binary that will check whether or not you have provided the correct license key.
Terrible Token (Easy)
Terrible Token (Hard)
Tangled Ticket (Easy)
Tangled Ticket (Hard)
Bit Bender
Substitution Sorcery
Meager Mangler (Easy)
Meager Mangler (Hard)
Monstrous Mangler (Easy)
Monstrous Mangler (Hard)
Patching
Patching
When working with a binaries, sometimes you may want to change the behavior of the binary itself. This can be accomplished by patching the binary. Patching is the process of changing the assembly instructions in the binary to change its behavior. The following set of challenges will allow you to patch a limited number of bytes in the binary at runtime to change its behavior.
Patched Up (Easy)
Patched Up (Hard)
Puzzle Patch (Easy)
Puzzle Patch (Hard)
Patch Perfect (Easy)
Patch Perfect (Hard)
Yan85
Yan85
Yan85 is a virtual machine and obfuscation engine. It is designed to be a simple, yet powerful, virtual machine that can be used to obfuscate code. The following set of challenges leverage the Yan85 virtual machine. Early time spent understanding how this virtual machine works will pay off in future challenges that use Yan85.
Trust the Yancode (Easy)
Trust the Yancode (Hard)
Know the Yancode (Easy)
Know the Yancode (Hard)
Master the Yancode (Easy)
Master the Yancode (Hard)
Transcend the Yancode (Easy)
Transcend the Yancode (Hard)
The Yanalyzer (Easy)
The Yanalyzer (Hard)
The Yangler (Easy)
The Yangler (Hard)
Yancraft (Easy)
Yancraft (Hard)
Yansanity (Easy)
Yansanity (Hard)
Cows and Bulls
Cows and Bulls
Cows and Bulls is a classic code-breaking game where the objective is to correctly guess a random number. This set of challenges will require you to reverse engineer a binary that plays this guessing game with you. Be warned, winning the game (and in turn, getting the flag) may not be as easy as it seems!