Reverse Engineering Cheat Sheet
Reverse Engineering Cheat Sheet
Reverse Engineering Cheat Sheet
By Lenny Zeltzer
This cheat sheet of shortcuts and tips for reverse-engineering malware. It covers the general malware analysis process, as well as useful tips for OllyDbg, IDA Pro, and other tools. Feel free to customize it to your own needs. My reverse-engineering malware course explores these, and other useful techniques. General Approach 1. Set up a controlled, isolated laboratory in which to examine the malware specimen. 2. Perform behavioral analysis to examine the specimens interactions with its environment. 3. Perform static code analysis to further understand the specimens inner-workings. 4. Perform dynamic code analysis to understand the more difficult aspects of the code. 5. If necessary, unpack the specimen. 6. Repeat steps 2, 3, and 4 (order may vary) until sufficient analysis objectives are met. 7. Document findings and clean-up the laboratory for future analysis. Behavioral Analysis Be ready to revert to good state via dd, VMware snapshots, CoreRestore, Ghost, SteadyState, etc. Monitor local (Process Monitor, Process Explorer) and network (Wireshark, tcpdump) interactions. Detect major local changes (RegShot, Autoruns). Redirect network traffic (hosts file, DNS, Honeyd). Activate services (IRC, HTTP, SMTP, etc.) as needed to evoke new behavior from the specimen. IDA Pro for Static Code Analysis Text search Show strings window Show operand as hex value Insert comment Follow jump or call in view Return to previous view Go to next view Show names window Display function's flow chart Display graph of function calls Go to program's entry point
Page 1 of 3
Show cross-references to selected function Select function name Ctrl+X Show stack of current function OllyDbg for Dynamic Code Analysis Step into instruction Step over instruction Execute till next breakpoint Execute till next return Show previous executed instruction Show next executed instruction Return to previous view Show memory map Follow expression in view Insert comment Follow jump or call in view Show listing of names New binary search Next binary search result Show listing of software breakpoints Assemble instruction in place of selected one Edit data in memory or instruction opcode Show SEH chain Show patches Bypassing Malware Defenses To try unpacking quickly, infect the system and dump from memory via LordPE or OllyDump. For more surgical unpacking, locate the Original Entry Point (OEP) after the unpacker executes. If cannot unpack cleanly, examine the packed specimen via dynamic code analysis while it runs. When unpacking in OllyDbg, try SFX (bytewise) and OllyDump's "Find OEP by Section Hop".
Page 2 of 3 Revised August 26, 2008
Ctrl+K
F7 F8 F9 Ctrl+F9 + * Alt+M Ctrl+G ; Enter Ctrl+N Ctrl+G Ctrl+L Alt+B Select instruction Spacebar Select data or instruction Ctrl+E View SEH chain Ctrl+P
Page 3 of 3