Technotron
Elite member
Elite member
Leave a rep and a like
Hidden Content
Disk forensics gets all the attention, but the real fight is in RAM. Anything an attacker does eventually lives in memory, and unlike files, memory can't be wiped after the fact without destroying the machine's own running state. This is why memory acquisition is the first move in any serious incident response, before anyone touches the disk.
The acquisition itself is a niche skill. You can't just run a tool on the compromised machine, because any tool you run is executing in the same memory you're trying to capture and can be seen and manipulated by the malware. The proper way is out of band. A kernel driver that carves physical memory to a file is the standard approach, tools like WinPmem or Magnet RAM Capture do this. On locked down systems, the honest answer is pulling the power or doing a warm reboot into a small forensic OS, because that preserves RAM in ways a clean shutdown doesn't. There's also the cold boot attack angle, where RAM retains data for seconds to minutes after power off if you cool it, which was a real research result years ago and is still technically true.
Once you have the memory dump, the analysis is where it gets good. Volatility 3 is the tool, full stop. It reconstructs the operating system state from raw memory, process lists, network connections, loaded modules, registry contents, even files that were open.
The basic workflow on a Windows dump looks like this. windows.pslist for the process list, and here's the first trick, run pslist AND psscan. pslist walks the linked list of processes, which is what task manager sees. psscan carves raw memory for process structures, and finds processes that were unlinked from the list, which is exactly what DKOM rootkits do to hide. Any process in psscan that isn't in pslist was hidden on purpose.
windows.malfind is the famous plugin. It scans every process's memory for regions marked executable that don't map to a file on disk, and dumps them out. This catches injected code, reflective DLL loads, shellcode, most in memory implants. The false positive rate is low enough that any malfind hit deserves a look.
windows.callbacks and windows.modules show kernel callback registrations and loaded drivers. Rootkits that unregister security product callbacks get caught here by comparing against a known good baseline. windows.ssdt checks the system call table for patches, less relevant post PatchGuard but still worth a look on older systems.
Network artifacts survive in memory too. windows.netscan reconstructs network connections that existed at capture time, including ones that already closed. An attacker's C2 connection that was live when you captured is right there with the remote IP and port.
For the increasingly common Linux cases, Volatility 3 handles Linux profiles too, and there's a whole scene around LiME format memory captures. On Linux, hidden kernel modules, hooked syscalls, and modified process structures all show up in a memory dump in ways they don't on disk.
The attacker's counter plays are worth knowing too. Some implants try to prevent memory acquisition by detecting the acquisition driver and crashing the machine, which is the destroy the evidence move. Some use hypervisor level hiding, which memory forensics inside the guest can't see. And some just wait, doing nothing for long stretches so a random capture finds nothing interesting.
The takeaway for defenders, and the reason this matters even if you never do forensics professionally. If your EDR can trigger a memory capture on alert, enable that. The difference between catching an intrusion and missing it is often whether someone grabbed RAM before the attacker finished cleaning up. Disk can be wiped, logs can be cleared, but a running machine's memory is a snapshot of everything it was doing at that exact second, and there's no undo for it.


@Techn0tron
Hidden Content
Disk forensics gets all the attention, but the real fight is in RAM. Anything an attacker does eventually lives in memory, and unlike files, memory can't be wiped after the fact without destroying the machine's own running state. This is why memory acquisition is the first move in any serious incident response, before anyone touches the disk.
The acquisition itself is a niche skill. You can't just run a tool on the compromised machine, because any tool you run is executing in the same memory you're trying to capture and can be seen and manipulated by the malware. The proper way is out of band. A kernel driver that carves physical memory to a file is the standard approach, tools like WinPmem or Magnet RAM Capture do this. On locked down systems, the honest answer is pulling the power or doing a warm reboot into a small forensic OS, because that preserves RAM in ways a clean shutdown doesn't. There's also the cold boot attack angle, where RAM retains data for seconds to minutes after power off if you cool it, which was a real research result years ago and is still technically true.
Once you have the memory dump, the analysis is where it gets good. Volatility 3 is the tool, full stop. It reconstructs the operating system state from raw memory, process lists, network connections, loaded modules, registry contents, even files that were open.
The basic workflow on a Windows dump looks like this. windows.pslist for the process list, and here's the first trick, run pslist AND psscan. pslist walks the linked list of processes, which is what task manager sees. psscan carves raw memory for process structures, and finds processes that were unlinked from the list, which is exactly what DKOM rootkits do to hide. Any process in psscan that isn't in pslist was hidden on purpose.
windows.malfind is the famous plugin. It scans every process's memory for regions marked executable that don't map to a file on disk, and dumps them out. This catches injected code, reflective DLL loads, shellcode, most in memory implants. The false positive rate is low enough that any malfind hit deserves a look.
windows.callbacks and windows.modules show kernel callback registrations and loaded drivers. Rootkits that unregister security product callbacks get caught here by comparing against a known good baseline. windows.ssdt checks the system call table for patches, less relevant post PatchGuard but still worth a look on older systems.
Network artifacts survive in memory too. windows.netscan reconstructs network connections that existed at capture time, including ones that already closed. An attacker's C2 connection that was live when you captured is right there with the remote IP and port.
For the increasingly common Linux cases, Volatility 3 handles Linux profiles too, and there's a whole scene around LiME format memory captures. On Linux, hidden kernel modules, hooked syscalls, and modified process structures all show up in a memory dump in ways they don't on disk.
The attacker's counter plays are worth knowing too. Some implants try to prevent memory acquisition by detecting the acquisition driver and crashing the machine, which is the destroy the evidence move. Some use hypervisor level hiding, which memory forensics inside the guest can't see. And some just wait, doing nothing for long stretches so a random capture finds nothing interesting.
The takeaway for defenders, and the reason this matters even if you never do forensics professionally. If your EDR can trigger a memory capture on alert, enable that. The difference between catching an intrusion and missing it is often whether someone grabbed RAM before the attacker finished cleaning up. Disk can be wiped, logs can be cleared, but a running machine's memory is a snapshot of everything it was doing at that exact second, and there's no undo for it.


@Techn0tron
Attachments
Technotron's signature