Memory Forensics for Malware
RAM holds what disk doesn’t tell: unpacked code, injections, hidden processes, encryption keys, network connections, and fileless artifacts. Memory forensics captures a RAM image and analyzes it with Volatility 3 to reconstruct what was happening on the system. For malware analysis it’s decisive: many modern techniques (injection, packing, fileless) are only visible in memory. This page is the “malware” angle on general memory forensics.
Threat model
Section titled “Threat model”The modern adversary avoids disk precisely because they know that’s where they get signed: they inject into legitimate processes, run in memory (reflective loading), and decrypt their code and config only in RAM. All of that has to exist in memory to run — and that’s where the defender catches it. The limit is volatility: RAM is lost on shutdown, so its acquisition ranks very high in the order of volatility (see DFIR — chain of custody).
Acquisition (integrity first)
Section titled “Acquisition (integrity first)”flowchart LR A[Live system] --> B[RAM dump<br/>WinPmem · AVML · LiME] B --> C[Hash + custody] C --> D[Offline analysis<br/>Volatility 3]
- Windows: WinPmem, Magnet RAM Capture, DumpIt.
- Linux: AVML, LiME.
- Virtual machines: the hypervisor’s state/snapshot file is already a memory image.
Dump first, hash, document the chain of custody, and always analyze on the copy. In a dynamic-analysis lab, the VM snapshot serves this purpose.
Volatility 3: key plugins
Section titled “Volatility 3: key plugins”Volatility detects the system profile automatically. The most useful plugins for malware:
vol -f mem.raw windows.pslist # processes (OS list)vol -f mem.raw windows.psscan # processes by scan (finds hidden/terminated)vol -f mem.raw windows.pstree # process tree (parent/child relationships)vol -f mem.raw windows.malfind # suspicious memory regions (injection, RWX)vol -f mem.raw windows.netscan # network connections (C2)vol -f mem.raw windows.dlllist # DLLs loaded per processvol -f mem.raw windows.cmdline # command line of each processvol -f mem.raw windows.handles # handles (mutexes, files, keys)linux.* equivalents for Linux images. MemProcFS is an alternative that mounts the image as a browsable filesystem.
What to look for and how to read it
Section titled “What to look for and how to read it”- Code injection —
malfindflags private, executable, non-file-backed regions (typical of hollowing/reflective loading). ATT&CK T1055. - Process discrepancies — a process
psscansees butpslistdoesn’t: hidden or unlinked (possible rootkit, see Rootkits and bootkits). - Anomalous tree —
winword.exespawningpowershell.exe, or ansvchostwithout itsservices.exeparent. - Connections —
netscanreveals C2 destinations even if the process hid them in user-land. - Unpacked code — dump the injected/unpacked region (
windows.vadinfo/dump) and analyze it statically (strings, CAPA) → config, second stage. - Handles and mutexes — high-fidelity IOCs for detection.
Red Team
Section titled “Red Team”In authorized exercises, memory forensics serves to verify stealth: after deploying an implant in the lab, the operator checks whether malfind/netscan would reveal it. If the implant shows up as a non-backed RWX region or with visible connections, the blue team will catch it too. The goal is to measure the memory footprint, not to perfect the hiding.
Blue Team
Section titled “Blue Team”Detection
Section titled “Detection”malfind+netscan+pstreeis the trio that catches most fileless intrusions in an image.- Integrate memory analysis into incident response: KAPE and Velociraptor collect and analyze memory at fleet scale.
Telemetry
Section titled “Telemetry”- It doesn’t replace EDR, it complements it: memory gives the truth of the dump moment; EDR gives the timeline.
Response
Section titled “Response”Memory artifacts (injected regions, connections, extracted config) feed IOCs and in-memory YARA rules to hunt the same footprint across other hosts (see Intelligence and classification).
CVEs and real-world cases
Section titled “CVEs and real-world cases”- Volatility was key to analyzing fileless intrusions and rootkits in many public DFIR investigations.
- Studying orphan processes and hollowing in memory is standard for detecting Cobalt Strike and families that inject into
rundll32/svchost. - ATT&CK: T1055 (Process Injection), T1620 (Reflective Code Loading), T1003 (OS Credential Dumping — LSASS in memory).
Testing checklist
Section titled “Testing checklist”- Memory image acquired with integrity (hash + custody)
-
pslistvspsscan→ hidden/terminated processes -
pstree→ anomalous parent/child relationships -
malfind→ injected regions (RWX, non-backed) -
netscan→ C2 connections - Dump and analyze the unpacked/injected region (strings, CAPA)
- Handles/mutexes as IOCs
- YARA over the memory image; feed fleet-wide hunting