Malware Analysis Bootcamp
From triage fundamentals to advanced reverse engineering — static analysis, dynamic sandboxing, x86/x64 assembly, Ghidra, unpacking, ransomware/RAT/rootkit analysis, and YARA rule writing. All tools free. All labs use safe samples.
Malware analysis requires an isolated environment — a dedicated virtual machine with no network access (or a completely isolated network), snapshotted to a clean state so you can restore after each analysis. The VM should have all necessary tools pre-installed and nothing of value (no real credentials, no real data, no production access).
The gold standard analysis VM is FlareVM — a Windows VM with every malware analysis tool pre-installed. REMnux is the Linux equivalent. Both are free. Between them they cover 90% of analysis tasks you will encounter.
REMnux (Linux analysis): Pre-built VM from remnux.org. Includes: Volatility 3, Cutter, radare2, YARA, oledump, pdfid, and all Linux analysis tools. Best for document malware, script analysis, and Linux samples.
Network isolation: Set VM network adapter to Host-Only or Isolated. Never NAT — never allow malware to reach the internet and phone home (or worse, receive commands and attack your network). For dynamic analysis requiring network: use INetSim (traffic simulation) or a dedicated VLAN with FakeNet-NG.
Snapshot discipline: Take a "clean" snapshot before any analysis. After each analysis session: revert to clean. Never accumulate samples on one VM state.
Most malware analysis in a SOC or IR context is triage — quickly answering "is this malicious, what family, what does it do, what IOCs does it produce?" in 15 minutes, not 15 hours. The triage workflow is a fixed sequence that gets progressively deeper until the question is answered. If step 1 answers it, stop. If not, proceed to step 2. Most samples are resolved by step 3.
Step 2 — File identification (2 min): Run Detect-It-Easy (DiE) — identifies file type and packer/protector. Run
file command on Linux. Magic bytes tell you the true file type regardless of extension. An .exe with PDF magic bytes is suspicious.Step 3 — Strings (3 min): Run FLOSS (FLARE Obfuscated String Solver) — extracts all printable strings AND decodes obfuscated/encoded strings that normal
strings would miss. Look for: URLs and domains, registry keys, Windows API names, file paths, mutex names, and configuration data.Step 4 — Imports (3 min): Open in PEStudio. The imports section shows which Windows API functions the binary uses. Network functions (WSAStartup, connect, send, recv) → C2 capability. Cryptographic functions (CryptEncrypt) → ransomware possibility. Process injection APIs (VirtualAllocEx, WriteProcessMemory, CreateRemoteThread) → injection capability.
Step 5 — Sandbox (5 min): Submit to any.run (free, interactive) or Hybrid-Analysis (free). While it runs, review sections, resources, and entropy in PEStudio. When sandbox completes: review process tree, network connections, file drops, and registry changes.
Step 6 — IOC extraction (1 min): From FLOSS output and sandbox report: extract C2 domains/IPs, mutex names, file drop paths, registry persistence keys, scheduled task names. These are your detection IOCs.
The Portable Executable (PE) format is the file format for Windows executables (.exe, .dll, .sys). Understanding its structure is essential for malware analysis — it tells you how the binary is organised, what code it contains, what data it uses, and crucially, when something is wrong (packed/obfuscated executables have very different PE structure from normal ones).
Every PE file starts with the DOS header (MZ signature), followed by the PE header (machine type, timestamp, number of sections), the optional header (entry point address, image base, subsystem), and then the section table. The sections contain the actual content: .text (code), .data (initialised data), .rdata (read-only data including strings and imports), .rsrc (resources — icons, manifests, embedded files), and sometimes custom sections added by packers.
Suspicious section names: Standard sections are .text, .data, .rdata, .rsrc, .reloc. Non-standard names (UPX0, .themida, .vmp, or random names like .XHGSQ) indicate packers or protectors.
Few imports, many in a suspicious DLL: Normal executables import dozens of functions from multiple DLLs. A packed binary may import only LoadLibrary and GetProcAddress — it resolves everything else at runtime, hiding its true capabilities.
Timestamp anomalies: PE headers contain a compile timestamp. A timestamp of 1970-01-01 or far in the future indicates it has been zeroed or faked. A timestamp from 2008 on a modern malware sample with current C2 infrastructure suggests timestamp tampering.
Resources with high entropy: Malware frequently embeds encrypted payloads, configuration data, or additional executables in the resources section. Resource entropy approaching 8.0 warrants extraction and further analysis.
Overlay data: Data appended after the last section (the overlay). Normal in some installers, but malware uses overlays to store encrypted payloads that are decrypted at runtime. PEStudio highlights this.
upx -d sample.exe. Compare PE structure before and after unpacking: section count, import count, entropy, and strings. Document what was hidden by the packer.