Volatility Essentials Walkthrough: Memory Forensics with Volatility 3, Explained Step by Step
Malware can delete its files, wipe the logs and rename its own process. While it runs, it still has to sit in RAM. That makes a copy of RAM one of the most honest pieces of evidence an investigator can collect.
This post walks through the Volatility Essentials room on TryHackMe. The room is rated medium and takes about 60 minutes. It teaches Volatility 3 through two cases: a banking trojan on a Windows XP machine, and a WannaCry infection.
I explain every command as we go. You will see what it does, why we run it, and how to read the result. If you have never opened a memory image before, you can follow this post from the top.
Advertisement
Quick glossary
A few terms come up again and again. Skim these first and come back whenever one confuses you.
| Term | Plain meaning |
|---|---|
| RAM / memory | The computer's short-term workspace. Every running program and its data lives here. It clears when the machine powers off. |
| Memory dump (image) | A file that holds a copy of RAM at one moment. In this room the files end in .vmem or .raw. |
| Process | A running program. Each one gets a number called a PID. |
| PPID | The PID of the process that started it, also called the parent. |
| DLL | A shared code library that a process loads. Malware often hides inside one. |
| Plugin | One Volatility command that answers one question, such as "list the processes". |
| Rootkit | Malware that hides itself from the operating system's own tools. |
| Kernel | The core of Windows. It controls processes, drivers and hardware. |
Task 2: What is Volatility?
Volatility 3 is a free, open-source framework that reads a memory dump and pulls forensic evidence out of it. You point it at a file, choose a plugin, and it prints what it finds.
Three things make it useful:
Advertisement
- It runs analysis on Windows, Linux and macOS images.
- Every capability is a plugin, so you pick the exact question you want answered.
- It works out the right symbols for the image automatically. Volatility 2 made you pick a "profile" by hand for each image, and a wrong choice produced garbage output.
The room already has Volatility installed in Desktop/volatility3. To set it up on your own machine:
# Download the project
git clone https://github.com/volatilityfoundation/volatility3.git
# Move into the folder
cd volatility3
# Print the help text to confirm it runs
python3 vol.py -h
Every command in this post has the same shape:
python3 vol.py -f <memory-file> <plugin>
-f tells Volatility which file to read. The last part is the plugin name. Keep this pattern in mind and the rest becomes easy.
Advertisement
Task 3: Getting the memory, then identifying it
Acquisition
Before any analysis, someone has to capture the RAM. These are the usual tools:
- Windows: DumpIt, WinPmem, Magnet RAM Capture
- Linux: AVML, LiME
- macOS: OSXPmem
The order matters in a real incident. Capture memory first, because pulling the plug destroys it. Then hash the file and work from a copy so the original stays untouched.
Case 001
The first case gives you a memory image from a host infected with a banking trojan. Your job is to find out what happened. Before hunting for anything, confirm what kind of system you are looking at.
Advertisement
python3 vol.py -f Investigation-1.vmem windows.info
windows.info reads the basic facts about the image: the Windows version, the architecture and when the capture was taken.
| Field | Value |
|---|---|
| Build version | 2600.xpsp.080413-2111 |
| Acquisition time | 2012-07-22 02:45:08 |
The build string says this is Windows XP with a service pack. That tells you which plugins will work well, and it explains why the machine looks old.
The acquisition time is your clock. Every process start time you see later should be read against it. A process that started minutes before the capture is far more interesting than one that has run for days.
Advertisement
Task 4: Processes, connections and DLLs
The first question in almost every memory investigation is simple: what was running?
Step 1: Active processes with pslist
python3 vol.py -f Investigation-1.vmem windows.pslist
Windows keeps an internal list of every running process. pslist reads that list. The output has one row per process, with columns such as PID, PPID, process name, thread count and create time.
Look for odd names, odd start times and processes you cannot explain.
Advertisement
Step 2: Hidden processes with psscan
python3 vol.py -f Investigation-1.vmem windows.psscan
pslist trusts the list Windows keeps. A rootkit can quietly remove its process from that list, and then pslist never shows it.
psscan takes a different route. It searches raw memory for process structures, whether or not they appear on the official list. Compare the two outputs. A process that shows up in psscan and is missing from pslist is either hidden or already finished, and both cases deserve a closer look.
Step 3: Who started whom with pstree
python3 vol.py -f Investigation-1.vmem windows.pstree
pstree draws the same processes as a tree, so you can see parent and child relationships.
Advertisement
Windows has predictable patterns. For example, a normal user program is usually started by explorer.exe. When a process has a parent that makes no sense, it stands out immediately. The room recommends finishing the Core Windows Processes room first for this reason, since it teaches those patterns.
Step 4: Handles, network and DLLs
Three more plugins add detail about a process you already suspect:
python3 vol.py -f Investigation-1.vmem windows.handles
python3 vol.py -f Investigation-1.vmem windows.netstat
python3 vol.py -f Investigation-1.vmem windows.dlllist
handleslists what a process has open: files, registry keys, events and more. It tells you what the program was touching.netstatlists network connections. It shows who the machine was talking to.dlllistlists the DLLs each process loaded. A DLL loaded from an unusual folder can mean someone planted it.
Case 001 answers
| Question | Answer |
|---|---|
| Adobe Reader process path | C:\Program Files\Adobe\Reader 9.0\Reader\Reader_sl.exe |
| Parent process | explorer.exe |
| Parent PID | 1484 |
DLLs loaded from outside system32 |
3 |
| KeyedEvent handle | CritSecOutOfMemoryEvent |
How to read this: Adobe Reader started from explorer.exe is what you would expect when a user double-clicks a PDF. So the start alone looks normal. Three DLLs loaded from outside the Windows system folder is the part to follow up, because legitimate programs usually load their libraries from known places.
Advertisement
Task 5: Hunting injected code
Here is the problem. A process can have a normal name, a normal parent and a normal path, and still be running malicious code. Attackers do this through code injection: they push their own code into the memory of a trusted process so it runs under that process's name.
Finding it with malfind
python3 vol.py -f Investigation-1.vmem windows.malfind
malfind scans each process's memory and flags regions that look wrong. It looks for areas that are:
- Executable and writable at the same time. Normal code is rarely both. The output shows this as
PAGE_EXECUTE_READWRITE. - Not backed by a file on disk. Real programs load from files. Injected code arrives from somewhere else.
- Starting with an
MZheader.MZis the signature at the start of a Windows executable. Finding it inside odd memory means a whole program was dropped there.
malfind also prints a hex dump and a disassembly of the start of each hit, so you can see the actual bytes.
Advertisement
Digging deeper with vadinfo
python3 vol.py -f Investigation-1.vmem windows.vadinfo
Each process has a map of its memory regions, called VADs. vadinfo prints that map with the permissions and backing file of each region. Use it to confirm what malfind suspected and to understand the layout around the hit.
Case 001 finding
Two processes contain regions with an MZ header:
explorer.exereader_sl.exe
The picture fits together. The PDF reader is the likely way in, since it opens untrusted documents. explorer.exe is a good place to hide because it is always running and nobody thinks twice about it.
Advertisement
Task 6: Kernel-level checks
Some malware lives deeper than any process. It modifies the kernel so that Windows itself lies to you. Everything you ran so far depends on the kernel being honest, so these checks matter.
SSDT hooks
python3 vol.py -f Investigation-1.vmem windows.ssdt
The System Service Descriptor Table (SSDT) is a lookup table. When a program asks Windows to do something, such as open a file, Windows uses this table to find the kernel function that handles the request.
A rootkit can change an entry so the request goes to the rootkit's code first. It can then hide files, processes or connections before returning an answer. This is called hooking.
Advertisement
Every entry should point inside the legitimate kernel modules. An entry pointing somewhere else is a hook. In this image, the answer to the room's SSDT question is 0x8056e27c.
Modules and drivers
python3 vol.py -f Investigation-1.vmem windows.modules
python3 vol.py -f Investigation-1.vmem windows.driverscan
moduleslists the kernel modules Windows says are loaded.driverscansearches raw memory for driver structures, the same waypsscansearches for processes.
The same trick applies. A driver that driverscan finds and modules does not list has been removed from the official list to hide. Attackers call this technique DKOM, short for direct kernel object manipulation.
Task 7: Case 002, a ransomware infection
The second case gives you a memory image from a machine hit by ransomware. The method is the same as before. List the processes, read the tree, check the DLLs of the suspicious one, then search for files.
Advertisement
python3 vol.py -f Investigation-2.raw windows.pstree
python3 vol.py -f Investigation-2.raw windows.dlllist --pid 740
python3 vol.py -f Investigation-2.raw windows.filescan
The --pid 740 option limits dlllist to one process. filescan searches memory for file objects, which is how you recover file names and paths that may no longer exist on disk.
| Finding | Value |
|---|---|
| Suspicious process (PID 740) | @WanaDecryptor@ |
| Binary path | C:\Intel\ivecuqmanpnirkt615\@[email protected] |
| Parent process | tasksche.exe |
| Malware identified | WannaCry |
| Plugin used to find files | windows.filescan |
Read the evidence in three parts. The process name is a decryptor, which is a ransomware component. The folder name is random characters under C:\Intel, a location that has no business holding a program. The parent is tasksche.exe, the process that launched it. Each of these is an indicator you can turn into a detection rule on other machines.
Automating the investigation
Running the same plugins by hand on every image is slow and easy to get wrong. A short script runs the full sweep and saves each result to its own file.
Advertisement
The script: investigate_case002.sh
#!/bin/bash
set -euo pipefail
MEM_FILE="$HOME/Desktop/Investigations/Investigation-2.raw"
OUT_DIR="$HOME/Desktop/Investigations/Case002_Results"
PID=740
echo "[*] Starting forensic sweep on $MEM_FILE"
mkdir -p "$OUT_DIR"
python3 vol.py -f "$MEM_FILE" windows.psscan > "$OUT_DIR/psscan.txt"
python3 vol.py -f "$MEM_FILE" windows.pstree > "$OUT_DIR/pstree.txt"
python3 vol.py -f "$MEM_FILE" windows.dlllist --pid "$PID" > "$OUT_DIR/dlllist.txt"
python3 vol.py -f "$MEM_FILE" windows.filescan > "$OUT_DIR/filescan.txt"
python3 vol.py -f "$MEM_FILE" windows.malfind > "$OUT_DIR/malfind.txt"
python3 vol.py -f "$MEM_FILE" windows.ssdt > "$OUT_DIR/ssdt.txt"
python3 vol.py -f "$MEM_FILE" windows.modules > "$OUT_DIR/modules.txt"
python3 vol.py -f "$MEM_FILE" windows.driverscan > "$OUT_DIR/driverscan.txt"
echo "[+] Done. Results in $OUT_DIR"
echo "[i] grep -r \"$PID\" \"$OUT_DIR\" lists every reference to the suspect PID."
What each part does
set -euo pipefailstops the script at the first error. Without it, one failed plugin leaves you with an empty file and no warning.MEM_FILEandOUT_DIRhold the input path and the output folder, so you change them in one place.$HOMEis used because bash does not expand~inside double quotes. A path written as"~/Desktop/..."points to a folder that does not exist.- Quotes around every variable keep the script working when a path contains spaces.
mkdir -pcreates the output folder and does nothing if it already exists.> file.txtsends each plugin's output into its own file.
How to run it
Place it in the volatility3 folder, make it executable and run it:
chmod +x investigate_case002.sh
./investigate_case002.sh
When it finishes, search every result at once. For example, to see everything that mentions the decryptor's PID:
grep -r "740" ~/Desktop/Investigations/Case002_Results
You now have the full sweep in a few minutes, and the saved files serve as evidence you can review or share.
Advertisement
Task 8: Where this leaves you
You can now follow a repeatable workflow on a Windows memory image:
- Identify the system with
windows.info. - List processes with
pslistand compare againstpsscan. - Read the relationships with
pstree. - Inspect DLLs, handles and network connections for the suspicious ones.
- Scan for injected code with
malfind. - Check the kernel with
ssdt,modulesanddriverscan. - Script the whole thing and save the output.
This room covers the basics. To go further, read The Art of Memory Forensics by Ligh, Case, Levy and Walters. These plugins are good next steps:
windows.callbackswindows.modscanwindows.driverirpwindows.moddumpwindows.memmapyarascan
Have you tried the room yet? Share which case gave you the most trouble in the comments.
Advertisement



