Skip to content
Pwnversity
DFIR-MEMORIAadvanced · 10 min · upd. 2026-11

Memory forensics

Volatility 3T1055T1014

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.

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 dwarf2json from the kernel with debug information for that exact version. It is the most common practical obstacle in Linux memory forensics.
  • Linked lists (what pslist uses) can be tampered with; scanning memory for structures (what the *scan plugins do) also finds unlinked or terminated objects.
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
Ventana de terminal
# Linux with AVML: static binary, LiME-format output
sudo ./avml /mnt/usb/case-014/HOST01-mem.lime
sha256sum /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.sys and hiberfil.sys in the triage: they hold pages that were not in RAM.

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.

Ventana de terminal
vol -f mem.raw windows.info # Windows version and dump validation
vol -f mem.raw windows.pstree # process tree: odd parents
vol -f mem.raw windows.psscan # scan: terminated or hidden processes
vol -f mem.raw windows.malware.psxview # compares several process sources
vol -f mem.raw windows.cmdline # each process's command line
vol -f mem.raw windows.netscan # sockets and connections with their process
vol -f mem.raw windows.malware.malfind # executable regions with no backing file
vol -f mem.raw windows.malware.hollowprocesses # process hollowing
vol -f mem.raw windows.dlllist --pid 4312 # DLLs loaded by a process
vol -f mem.raw windows.svcscan # services, including unregistered ones
vol -f mem.raw windows.registry.hivelist # registry hives present in memory
vol -f mem.raw -o out/ windows.dumpfiles --pid 4312 # extract mapped files
vol -f mem.raw timeliner # timestamped events from every plugin

On Linux, with the right ISF in the symbols directory:

Ventana de terminal
vol -f mem.lime linux.pstree
vol -f mem.lime linux.psaux # processes with arguments
vol -f mem.lime linux.sockstat # sockets per process
vol -f mem.lime linux.bash # bash history recovered from memory
vol -f mem.lime linux.malware.check_modules # modules hidden from the list
vol -f mem.lime linux.malware.check_syscall # modified syscall table
vol -f mem.lime linux.malware.malfind

MemProcFS 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.

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).

  • 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.
  • 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.
  • 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.sys and hiberfil.sys included 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.psxview and malware.hollowprocesses reviewed and validated
  • Findings extracted and analyzed; IOCs hunted across the fleet