DEV Community

Rocky
Rocky

Posted on

Find an unlinked process in a memory image with Volatility 3

You have a memory image from a suspect Windows host, and the process list looks clean. That tells you what the operating system is willing to show you. It does not tell you what is in memory.

Two views of the same image

Volatility 3 ships two plugins that answer the question differently.

windows.pslist follows the linked list of active processes that Windows maintains. It is fast and it shows what the OS believes is running.

windows.psscan does not use that list. It scans the image for process structures and reports each one it finds, whether the process is live, finished or hiding.

Malware can unlink its own process from the active list. After that it disappears from pslist and stays in psscan. The gap between the two outputs is the evidence.

The diff

vol -f memory.raw windows.pslist > pslist.txt
vol -f memory.raw windows.psscan > psscan.txt
Enter fullscreen mode Exit fullscreen mode

Pull the PID column from each file and compare them with sort and comm -13, or paste both lists into a spreadsheet. Anything that appears only in psscan needs a second look.

Read the exit time

This is the step people skip. A process that has already ended leaves its structure in memory until the page is reused, so psscan lists plenty of dead processes. Each one has an exit time.

  • Exit time present: the process ended. Usually noise.
  • Exit time empty: the process is still running and the normal list cannot see it. Investigate this first.

For the empty ones, run windows.pstree to find the parent, then the command-line and network plugins to see what it was launched with and what it connected to.

A worked example

Suppose pslist shows 61 processes and psscan shows 66. Four of the five extras have exit times from earlier in the session: an installer, two cmd.exe windows, a conhost.exe. The fifth is a PID with a parent of explorer.exe, a random-looking name and an empty exit time. That one is running, it is absent from the normal list, and it is where you spend the next hour.

What this does not catch

A clean diff is one data point. This finds the simple unlinking technique. An attacker who also tampers with the structures psscan relies on needs other checks, such as cross-referencing handles, threads and network connections.

Try it

The free memory forensics lab on Codelivly gives you an image to run this comparison on. The digital forensics career path shows the order to learn the surrounding topics in.

For a longer reference, the Digital Forensics Playbook is 259 pages across 47 chapters, with 30+ labs and 8 challenge investigations on DFIR, memory forensics and reporting. It is listed at $19.99 on the product page.

Top comments (0)