Tag: VAD tree

  • Analyzing Memory Dumps with Volatility 3

    Volatility 3 reconstructs kernel states and user-space artifacts from volatile memory dumps to detect fileless malware, rootkits, and advanced persistent threats (APTs) that evade traditional disk-based forensics. The framework translates linear physical memory bytes into logical virtual abstractions by traversing operating system data structures and dynamic symbol tables, exposing injected shellcode and hidden network connections.

    Memory Translation and Intermediate Symbol Format (ISF)

    To analyze a raw memory capture (.raw.mem, or .vmem), Volatility 3 must bridge the semantic gap between hardware-level physical addresses and OS-level virtual memory. The framework locates the Directory Table Base (DTB)—derived from the CPU’s CR3 register state at the time of acquisition—and walks the page directories and page tables to map virtual addresses to physical offsets.

    Unlike its predecessor, which relied on static OS profiles, Volatility 3 dynamically fingerprints the memory image and constructs an Intermediate Symbol Format (ISF) mapping based on JSON symbol tables. For Windows targets, it parses the PE header of the kernel image (ntoskrnl.exe), downloads the corresponding PDB (Program Database) signatures from the Microsoft Symbol Server, and maps kernel data structures like _EPROCESS (Executive Process Block) and _ETHREAD into readable objects. While hardware trust anchors secure the initial boot sequence—as detailed in Hardware Security: TPM vs. HSM & Secure Boot—memory forensics becomes critical the moment the OS loads and adversaries deploy volatile, runtime-only payloads.

    Threat Hunting via Process and Memory Analysis

    Security analysts utilize specific Volatility 3 plugins to interrogate kernel structures and detect malicious deviations.

    Adversaries frequently employ Direct Kernel Object Manipulation (DKOM) to unlink a malicious process from the active process linked list (ActiveProcessLinks), rendering it invisible to standard OS APIs like Task Manager. The windows.pslist plugin walks this linked list, whereas windows.psscan executes a signature-based pool tag scan across the entire memory space to carve out unlinked _EPROCESS blocks, exposing the hidden process.

    bash

    # Compare the output of pslist and psscan to identify DKOM (hidden processes)
    python3 vol.py -f memory.raw windows.pslist
    python3 vol.py -f memory.raw windows.psscan
    

    To identify process injection, such as Process Hollowing or Reflective DLL Injection, analysts deploy the windows.malfind plugin. malfind inspects the Virtual Address Descriptor (VAD) tree for every process. It targets memory pages allocated with PAGE_EXECUTE_READWRITE (RWX) permissions that lack a corresponding memory-mapped file on disk. These anomalous memory segments typically house injected shellcode or unpacked malware payloads.

    bash

    # Scan all processes for injected code and dump the anomalous memory regions
    python3 vol.py -f memory.raw windows.malfind --dump
    

    To correlate malicious processes with external Command and Control (C2) infrastructure, the windows.netscan plugin carves network artifacts from memory pool allocations. It reconstructs TCP endpoints, UDP listeners, and active connection states, mapping the foreign IP addresses and ports directly back to the owning Process ID (PID).

    bash

    # Extract active and terminated network connections from the memory dump
    python3 vol.py -f memory.raw windows.netscan
    

    Additional Reading

    https://github.com/volatilityfoundation/volatility3
    https://volatility3.readthedocs.io/en/latest/
    https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/evaluating-the-dtb