Security builder & leader

Cheat Sheet for Analyzing Malicious Software

Malware analysis combines behavioral examination with static and dynamic code analysis to understand malicious software. Key steps include using automated sandboxes for triage, monitoring system and network interactions, examining code with Ghidra and x64dbg, and unpacking protected specimens.

Cheat Sheet for Analyzing Malicious Software - illustration

This cheat sheet presents tips for analyzing and reverse-engineering malware. It outlines the steps for performing behavioral and code-level analysis of malicious software. To print it, use the one-page PDF version; you can also edit the Word version to customize it for you own needs.

Overview of the Malware Analysis Process

  1. Use automated analysis sandbox tools for an initial assessment of the suspicious file.
  2. Set up a controlled, isolated laboratory in which to examine the malware specimen.
  3. Examine static properties and meta-data of the specimen for triage and early theories.
  4. Emulate code execution to identify malicious capabilities and contemplate next steps.
  5. Perform behavioral analysis to examine the specimen’s interactions with its environment.
  6. Analyze relevant aspects of the code statically with a disassembler and decompiler.
  7. Perform dynamic code analysis to understand the more difficult aspects of the code.
  8. If necessary, unpack the specimen.
  9. Repeat steps 4-8 above as necessary (the order may vary) until analysis objectives are met.
  10. Augment your analysis using other methods, such as memory forensics and threat intel.
  11. Document findings, save analysis artifacts and clean-up the laboratory for future analysis.

Behavioral Analysis

Ghidra for Static Code Analysis

ActionShortcut
Go to specific destinationg
Show references to selected instructionCtrl+Shift+f
Insert a comment;
Follow jump or callEnter
Return to previous locationAlt+Left
Go to next viewAlt+Right
UndoCtrl+z
Define data typet
Add a bookmarkCtrl+d
Text searchCtrl+Shift+e
Add or edit a labell
Disassemble selected valuesd

x64dbg/x32dbg for Dynamic Code Analysis

ActionShortcut
Run the codeF9
Step into/over instructionF7 / F8
Execute until selected instructionF4
Execute untill next returnCtrl+F9
Show previous/next executed instruction- / +
Return to previous view*
Go to specific expressionCtrl+g
Insert comment/label; / :
Show current function as a graphg
Set software breakpoint on specific instructionSelect instruction » F2
Set software breakpoint on APIGo to Command prompt » SetBPX API Name
Highlight all occurrences of the keyword in disassemblerh » Click on keyword
Assemble instruction in place of selected oneSelect instruction » Spacebar
Edit data in memory or instruction opcodeSelect data or instruction » Ctrl+e
Extract API call referencesRight-click in disassembler » Search for » Current module » Intermodular calls

Unpacking Malicious Code

Bypassing Other Analysis Defenses

Post-Scriptum

Creative Commons v3 “Attribution” License for this cheat sheet version 2.2.

About the Author

Lenny Zeltser is a cybersecurity executive with deep technical roots, product management experience, and a business mindset. As CISO at Axonius, he leads the security and IT program, focusing on trust and growth. He is also a Faculty Fellow at SANS Institute and the creator of REMnux, a popular Linux toolkit for malware analysis. Lenny shares his perspectives on security leadership and technology at zeltser.com.

Learn more →