Memory forensics
RAM holds what the disk does not: running processes, live network connections, injected code, encryption keys, recent commands and fileless malware that never gets written out. It is the most volatile evidence, so it is captured first, following the order of volatility in the chain of custody and before the triage collection.
What it solves
Section titled “What it solves”Much modern malware lives in memory to avoid leaving traces on disk: injection into legitimate processes, reflective loaders, C2 beacons. Memory forensics is often the only way to see that code, to recover in cleartext what is encrypted on disk and to capture the exact state of the system at the moment of compromise. It answers three questions: what was running, who it was talking to and what it had injected.
It is also the defense against a system that lies: a rootkit can hide a process from tasklist or ps, but it cannot erase the kernel structures that describe it in RAM without breaking the system itself.
How memory is organized (just enough to analyze it)
Section titled “How memory is organized (just enough to analyze it)”flowchart LR
V["RAM dump<br/>(physical layer)"] --> K["Kernel: process,<br/>module and socket structures"]
K --> P["Processes: EPROCESS (Windows)<br/>task_struct (Linux)"]
P --> VAD["User space:<br/>VAD / VMA (memory regions)"]
VAD --> I["Code regions with<br/>no backing file = possible injection"]
K --> S["Kernel symbols<br/>(PDB on Windows, ISF on Linux)"]
- Volatility interprets a flat dump by rebuilding the kernel structures. To do that it needs symbols for that exact kernel version.
- On Windows, Volatility 3 downloads the symbols (PDB) from Microsoft automatically if it has internet access; without a network, you have to prepare the symbol pack beforehand.
- On Linux there is no symbol server: you must generate an ISF file with
dwarf2jsonfrom the kernel with debug information for that exact version. It is the most common practical obstacle in Linux memory forensics. - Linked lists (what
pslistuses) can be tampered with; scanning memory for structures (what the*scanplugins do) also finds unlinked or terminated objects.
Acquisition
Section titled “Acquisition”| System | Tool | Notes |
|---|---|---|
| Windows | WinPmem, Magnet RAM Capture, DumpIt, FTK Imager | Need administrator rights and load a driver; some EDRs block them, so test them before the incident |
| Linux | AVML (Microsoft), LiME | AVML is a static binary with nothing to compile on the host; LiME is a kernel module that must be built for that exact version |
| Virtual | Hypervisor snapshot | On VMware, the .vmem file from a snapshot or suspend; it does not touch the guest |
| Cloud | Disk snapshot + acquisition from inside | Providers generally do not expose guest RAM; use AVML or similar inside the instance |
# Linux with AVML: static binary, LiME-format outputsudo ./avml /mnt/usb/case-014/HOST01-mem.limesha256sum /mnt/usb/case-014/HOST01-mem.lime
# Windows with WinPmem (administrator console, from USB)winpmem_mini_x64_rc2.exe E:\case-014\HOST01-mem.raw- Output goes off the investigated host’s disk.
- Record the tool, version, UTC start and end time and the dump’s hash.
- A 32 GB dump takes minutes; meanwhile memory keeps changing (“smear”). It does not invalidate the analysis, but it explains minor inconsistencies between structures.
- Besides RAM, on Windows collect
pagefile.sysandhiberfil.sysin the triage: they hold pages that were not in RAM.
Analysis with Volatility 3
Section titled “Analysis with Volatility 3”The commands follow Volatility 3 2.28 syntax. Since the 2.26 series, malware detection plugins are grouped under windows.malware.* and linux.malware.*: windows.malfind and windows.psxview still work, but the built-in help flags them as deprecated.
vol -f mem.raw windows.info # Windows version and dump validationvol -f mem.raw windows.pstree # process tree: odd parentsvol -f mem.raw windows.psscan # scan: terminated or hidden processesvol -f mem.raw windows.malware.psxview # compares several process sourcesvol -f mem.raw windows.cmdline # each process's command linevol -f mem.raw windows.netscan # sockets and connections with their processvol -f mem.raw windows.malware.malfind # executable regions with no backing filevol -f mem.raw windows.malware.hollowprocesses # process hollowingvol -f mem.raw windows.dlllist --pid 4312 # DLLs loaded by a processvol -f mem.raw windows.svcscan # services, including unregistered onesvol -f mem.raw windows.registry.hivelist # registry hives present in memoryvol -f mem.raw -o out/ windows.dumpfiles --pid 4312 # extract mapped filesvol -f mem.raw timeliner # timestamped events from every pluginOn Linux, with the right ISF in the symbols directory:
vol -f mem.lime linux.pstreevol -f mem.lime linux.psaux # processes with argumentsvol -f mem.lime linux.sockstat # sockets per processvol -f mem.lime linux.bash # bash history recovered from memoryvol -f mem.lime linux.malware.check_modules # modules hidden from the listvol -f mem.lime linux.malware.check_syscall # modified syscall tablevol -f mem.lime linux.malware.malfindMemProcFS is an alternative that mounts the dump as a browsable file system (processes as folders, modules as files) and builds its own timeline; it is very handy for a fast first pass.
What to look for
Section titled “What to look for”flowchart TD
A["RAM dump"] --> B["pstree / psaux"]
B --> C{"Odd parent?"}
C -->|"powershell child of winword"| X["Suspicious:<br/>extract and analyze"]
A --> E["malware.malfind"]
E --> F{"Executable region<br/>with no file?"}
F -->|"MZ header or shellcode"| X
A --> G["netscan / sockstat"]
G --> H{"Strange connection?"}
H -->|"process that should not<br/>reach the internet"| X
A --> I["psscan vs pslist"]
I --> J{"Differences?"}
J -->|"unlinked process"| X
| Indicator | Example | Plugin |
|---|---|---|
| Impossible hierarchy | cmd.exe child of w3wp.exe (webshell); powershell.exe child of winword.exe |
pstree |
| Fake system process | svchost.exe whose parent is not services.exe, or outside System32; two lsass.exe |
pstree, dlllist |
| Injection | Private region with PAGE_EXECUTE_READWRITE protection and an MZ header or code |
malware.malfind |
| Hollowing | In-memory image differs from the executable on disk | malware.hollowprocesses |
| Hidden process | Shows up in psscan but not in pslist |
malware.psxview |
| C2 | rundll32.exe or notepad.exe with established connections to the internet |
netscan |
| Command line | Encoded PowerShell (-enc), downloads with certutil or bitsadmin |
cmdline |
| Linux rootkit | Module present in memory but missing from lsmod; hooked syscalls |
malware.check_modules, malware.check_syscall |
malfind produces false positives: JIT engines (browsers, .NET, Java) legitimately create executable, writable memory. Validate each hit by dumping the region and analyzing it (sample triage, YARA).
Integration with the rest of DFIR
Section titled “Integration with the rest of DFIR”- Suspicious processes, DLLs and regions are extracted and passed to sample triage.
- Connections are cross-checked with network forensics and proxy logs.
timelinerand process creation times are merged into the timeline.- IOCs (hashes, IPs, domains, mutexes) feed threat hunting and IOC management.
Anti-forensics
Section titled “Anti-forensics”- DKOM (direct kernel object manipulation): unlinking the process from the active list; detected by comparing sources with
psxview. - Injection and hollowing to run inside trusted processes (evasion).
- Encryption at rest, decryption only at runtime: the payload is only in cleartext in memory, which is exactly where you capture it.
- Detecting acquisition tools: malware that exits or deletes itself when it sees a known dump driver.
- Forced shutdown or reboot to destroy RAM: hence the urgency and the need for delegated authority to isolate without powering off (incident response).
- Rootkits (rootkits): they fool tools that ask the live system, not the analysis of a dump done elsewhere.
Real-world cases
Section titled “Real-world cases”- Snake, from the FSB (joint advisory AA23-129A, May 2023): the advisory rated memory analysis as the method giving the most visibility into Snake’s behavior and artifacts, and it included a Volatility plugin that scans process memory for known strings and extensions of its components. Later industry analyses noted that this method scales worse and takes more time than network or host-based detection. Lesson: the dump is not for every host, but it is for critical and suspicious ones.
Checklist
Section titled “Checklist”- Acquisition tool tested before the incident (EDR, permissions, architecture)
- RAM captured before powering off, rebooting or running triage
- Output off the host’s disk, with hash, UTC time and tool version
-
pagefile.sysandhiberfil.sysincluded in the triage (Windows) - Symbols available: internet access or an offline pack (Windows), ISF for the exact kernel (Linux)
- Process tree, command lines and connections reviewed
-
malware.malfind,malware.psxviewandmalware.hollowprocessesreviewed and validated - Findings extracted and analyzed; IOCs hunted across the fleet
References
Section titled “References”- Volatility 3: https://github.com/volatilityfoundation/volatility3 and https://volatility3.readthedocs.io/
- dwarf2json (ISF for Linux): https://github.com/volatilityfoundation/dwarf2json
- AVML (Microsoft): https://github.com/microsoft/avml
- LiME: https://github.com/504ensicsLabs/LiME
- WinPmem: https://github.com/Velocidex/WinPmem
- MemProcFS: https://github.com/ufrisk/MemProcFS
- CISA and partners, AA23-129A Hunting Russian Intelligence “Snake” Malware: https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-129a
- NIST SP 800-86, Guide to Integrating Forensic Techniques into Incident Response: https://csrc.nist.gov/pubs/sp/800/86/final