Most packed malware in the wild uses a handful of well-known packers, and most of those unpack with one command. This sub-skill is the quick reference for the common packers: what DIE reports, which tool unpacks it, and how to confirm the output is real. Scope: unpack only samples you are authorized to handle, in an isolated lab, during authorized DFIR or malware research.
Quick Workflow
- Run DIE and record the exact packer name and version string.
- Look up the matching unpacker below and run it on a copy.
- Validate the output: DIE should now report a compiler, strings and imports should explode in count.
- If validation fails, check for modified variants or nested layers.
- Hash and archive both the packed original and the unpacked payload.
- Route the unpacked payload through static triage (strings, imports, capa) and record the packer in the case notes for the YARA rule.
1. UPX and its variants
# Standard UPX
upx -d packed.exe -o unpacked.exe
# What success looks like
diec unpacked.exe
# -> PE32, compiler: Microsoft Visual C++ 19.x, linker 14.x
strings -n 8 unpacked.exe | wc -l # thousands, up from dozens
Modified UPX (attackers tweak the stub to break upx -d): symptoms are
"not packed by UPX" errors on a file DIE calls UPX. Fixes: try upx -d
with --force, use an older UPX version matching the stub, or fall back
to manual OEP dumping (parent skill section 4). The UPX0/UPX1/UPX2
section names usually survive modification and confirm the diagnosis.
2. ASPack, MPRESS, FSG, MEW, Petite
# ASPack (aspackdie / unASPack tools)
aspackdie packed.exe -o unpacked.exe
# MPRESS (the tool unpacks its own format)
mpress -d packed.exe -o unpacked.exe
# FSG, MEW, Petite: dedicated unpackers exist per family;
# when no unpacker is available, manual OEP dumping works well
# because these are simple single-layer packers
DIE version strings matter: ASPack 2.12 and 2.28 need different unpacker builds. When the dedicated tool fails, check the DIE version string first before assuming a custom packer.
3. Validation checklist
Every unpacked output must pass all of these before analysis:
diec unpacked.exe | head -5
# expect: compiler named, no packer named
# Import table sanity in PE-bear: dozens to hundreds of imports,
# entry point in .text, sections with normal names
# Behavior parity: detonate packed vs unpacked in the sandbox;
# the unpacked payload should show the same behavior profile
# (or a superset, since nothing is hidden anymore)
Validation output shape:
packed.exe: 14 imports, 62 strings, DIE: UPX 5.0.2
unpacked.exe: 212 imports, 4800 strings, DIE: MSVC 19.40
sandbox: both beacon to the same domain -> parity confirmed
If parity fails (unpacked behaves differently), the unpacker corrupted the image: try another tool or go manual.
4. Multi-layer packing
# Unpack outside-in, checking DIE after each layer
diec layer0.exe # -> custom packer
# ... manual unpack -> layer1.exe
diec layer1.exe # -> UPX
upx -d layer1.exe -o layer2.exe
diec layer2.exe # -> MSVC compiler: done
Keep every layer hashed and archived; incident responders encounter the outer layer and your notes must map each layer to its unpack method. Name files clearly: sample.l0.packed, sample.l1.upx, sample.l2.clean.
Edge cases
- Fake packer signatures: some stubs mimic UPX section names without being UPX; the unpacker failing is the signal to go manual.
- UPX --brute variants: stock
upx -dmay fail; UPX built from source with brute support sometimes succeeds. - Packers that strip the overlay: unpackers that do not preserve overlays lose appended data; check file size before/after.
- .NET "packers" (ConfuserEx): native unpackers do not apply; use .NET dumpers after the assembly loads.
- Unpackers that execute the stub: prefer static unpackers; if the unpacker runs code, run it in the lab VM, not on your workstation.
Escalation
If two different unpackers produce different outputs, escalate to manual dumping; one of them is corrupting the image.
If layers exceed three, treat as a custom packer case and escalate to the parent skill's manual workflow.
If the same modified UPX stub appears across many samples, invest in a scripted unpacker once; manual repetition does not scale.
If an unpacker executes the stub as part of unpacking, run it only in the lab VM and hash-verify the output before analysis.
Detection and defender view
Known-packer unpacking belongs in the automated pipeline: every incoming sample gets DIE-scanned, known packers get auto-unpacked, and the unpacked payload feeds YARA and capa automatically. Write a YARA rule for the stub only when the stub is family-specific; generic UPX stubs are too common to alert on alone. Track packer prevalence in your intake: a spike in one packer often precedes a campaign using a shared builder.
Key references
- UPX documentation: https://upx.github.io/
- Detect It Easy: https://github.com/horsicq/Detect-It-Easy
- PE-bear: https://github.com/hasherezade/pe-bear
- MITRE ATT&CK: T1027.002 (Software Packing)
- Unpacker collections (use vetted builds in the lab): https://github.com/topics/unpacker
