← Back to Writeups
TryHackMe · Volatility · Memory Forensics

WannaCry in RAM —
Dissecting a Ransomware
Memory Dump

THM Volatility Case 002 · Full Walkthrough
Windows x86 · XP SP3 Volatility 2/3 DFIR · Malware Analysis WannaCry Ransomware
00 — Background

The Case: Chain Ransomware Attack

A chain ransomware attack is hitting multiple companies internationally. The decryption key has already been retrieved — but the job isn't done. A thorough post-incident analysis is required to understand the full scope of the compromise, attacker TTPs, and persistence mechanisms.

We've been handed a raw memory dump from an infected Windows machine. Our mission: reconstruct exactly what happened inside this machine's RAM, identify the malicious process, trace its lineage, and surface all indicators of compromise.

🔬 What We're Working With
Memory forensics lets us see what was running at the moment of capture — including processes that may have already cleaned themselves off disk. RAM doesn't lie.

System Information

OS
Windows x86
Build Number
2600.xpsp_sp3-260.130704-0421
Memory Dump Taken At
2017-05-12 · 21:26:32

The date is significant — May 12, 2017 is the exact date the WannaCry global outbreak began. This isn't coincidence. This is ground zero.

01 — Process Discovery

Running pslist & psscan

We start with the two foundational process listing plugins. pslist walks the active process linked list — which can be manipulated by malware. psscan scans raw memory for EPROCESS structures, surfacing processes that may be hiding from the standard list.

volatility — process enumeration
$ volatility -f memory.dmp --profile=WinXPSP3x86 pslist

# Cross-verify with pool-tag scanner (catches hidden/unlinked processes)
$ volatility -f memory.dmp --profile=WinXPSP3x86 psscan

# Both revealed suspicious activities centered around:
Process: @WanaDecryptor@ PID: 740 PPID: 1940
Create Time: 2017-05-12 21:22:22
⚠️ Suspicious Process Found
@WanaDecryptor@ — the name alone is a dead giveaway. This is the WannaCry ransomware payload masquerading under its own decryptor UI. PID 740, parent PID 1940.

The Critical Note — Evasion Attempt

Here's where it gets interesting. psscan revealed that the same process @WanaDecryptor@ was also running under PID 424 and PID 576 — but these were hidden from pslist. This is a classic DKOM (Direct Kernel Object Manipulation) evasion technique.

🚨 DKOM Evasion Detected
PIDs 424 & 576 showed up in psscan but NOT in pslist. The process had unlinked itself from the active process list — a known anti-forensics technique. This is a possible evasion attempt to hide persistence from live analysis tools.
02 — DLL Analysis

Using dlllist to Map the Binary

With PID 740 confirmed as our target, we use the dlllist plugin filtered on that PID to enumerate every loaded DLL and locate the main binary on disk.

volatility — dll enumeration for PID 740
$ volatility -f memory.dmp --profile=WinXPSP3x86 dlllist -p 740

# Key finding — main binary location:
C:\Intel\ivecuqmanpnirkt615\@WanaDecryptor@.exe

# Non-standard path. Not in System32 or Program Files.
# Dropped under C:\Intel\ — a common staging directory for WannaCry.

# Also found during further DLL analysis (Step 4):
ws2_32.dll — loaded for socket communication (C2 / propagation)
Key Artifact: The binary was dropped at
C:\Intel\ivecuqmanpnirkt615\@WanaDecryptor@.exe

This non-standard path under C:\Intel\ is a well-known WannaCry staging location. The randomized subdirectory name (ivecuqmanpnirkt615) is generated per-infection to evade static detection.
03 — Process Lineage

Tracing the Parent with pstree

Knowing the parent PID is 1940, we use pstree to visualize the full process hierarchy and identify who spawned the ransomware.

volatility — process tree
$ volatility -f memory.dmp --profile=WinXPSP3x86 pstree

# Referencing PPID 1940 revealed the parent process:
Parent Process: tasksche.exe (PID: 1940)

Process Hierarchy

explorer.exe
├─ mctlmom.exe
└─ tasksche.exe (PID 1940) ← PPID of malware
└─ @WanaDecryptor@ (PID 740) ← RANSOMWARE

tasksche.exe is WannaCry's task scheduler component — it's the orchestrator that manages file encryption tasks and spawns the decryptor UI. Its presence as the parent process confirms the infection chain is fully established.

Notably, tasksche.exe itself spawned from explorer.exe, which suggests the initial infection vector likely involved user interaction — possibly executing a malicious file dropped via the EternalBlue exploit, which then injected into or launched from the Explorer context.

04 — Hash & Threat Intelligence

Memory Dump → SHA256 → VirusTotal

We dump the process memory for PID 740, generate a SHA256 hash, and look it up on VirusTotal. Matching our previous indicators (DLL load pattern, binary path, process name) confirms our identification.

volatility — memory dump + hash
$ volatility -f memory.dmp --profile=WinXPSP3x86 memdump -p 740 --dump-dir ./dump/

$ sha256sum dump/740.dmp

# Upload hash to VirusTotal → confirmed WannaCry indicators match
# Previous analysis artifacts correlate → high-confidence attribution

DLL Deep Dive — ws2_32.dll

Going back to the DLL list for PID 740 and cross-referencing each library reveals something key: ws2_32.dll (the Windows Socket API) was loaded by the decryptor process.

🔌 Network Activity Indicator
ws2_32.dll handles socket operations — raw TCP/UDP. A ransomware "decryptor UI" has no legitimate reason to need socket access. This indicates the process was performing network communication, consistent with WannaCry's known C2 check-in and lateral movement via SMB/EternalBlue propagation.
05 — Mutex Identification

windows.handles on tasksche.exe

The final step: running the windows.handles plugin against the parent process tasksche.exe to enumerate all kernel objects it holds — files, registry keys, events, and critically, mutexes.

volatility — handle enumeration on tasksche.exe
$ volatility -f memory.dmp --profile=WinXPSP3x86 handles -p 1940 -t Mutant

# Output revealed a known WannaCry mutex:
MsWinZonesCacheCounterMutexA

# This is a documented IOC for WannaCry / WanaCrypt0r 2.0
🔑 Known Malware Mutex — Confirmed IOC
MsWinZonesCacheCounterMutexA is a documented indicator of compromise for WannaCry. Malware uses mutexes as a "marker" — to check if the system is already infected and avoid double-encryption. Finding this mutex in memory is definitive confirmation of WannaCry ransomware presence.
06 — Reconstruction

Attack Timeline

2017-05-12 · Unknown
Initial Compromise via EternalBlue
SMB exploit delivers WannaCry payload. tasksche.exe drops into C:\Intel\ directory and begins orchestrating the attack.
2017-05-12 · 21:22:22
@WanaDecryptor@ Spawned
tasksche.exe (PID 1940) launches the ransomware UI/payload at PID 740. Encryption begins. ws2_32.dll loaded for C2 and propagation.
2017-05-12 · Active
DKOM Evasion — Ghost PIDs
Additional instances of the ransomware run under PIDs 424 & 576 — unlinked from the active process list to evade live forensics tools.
2017-05-12 · 21:26:32
Memory Dump Captured
Raw memory acquisition performed. All process artifacts, DLL maps, handles, and mutexes preserved for forensic analysis.
07 — IOC Summary

Indicators of Compromise

IndicatorValueTypeConfidence
Malicious Process@WanaDecryptorProcessHIGH
Process IDs740, 424, 576PIDHIGH
Binary PathC:\Intel\ivecuqmanpnirkt615\@WanaDecryptor@.exeFile PathHIGH
Parent Processtasksche.exe (PID 1940)ProcessHIGH
MutexMsWinZonesCacheCounterMutexAMutexHIGH
Network DLLws2_32.dll loaded by decryptorDLLMEDIUM
Evasion TechniqueDKOM — process hidden from pslistTTPHIGH
Infection Date2017-05-12 (Day 0 of global outbreak)TimestampHIGH
08 — Takeaways

What This Case Teaches Us

Always Cross-Validate pslist with psscan

pslist alone would have missed PIDs 424 and 576. Always run both, diff the output. Any process visible in psscan but not pslist is a major red flag for rootkit-level evasion.

Mutexes Are Definitive Fingerprints

Malware families reuse mutexes across campaigns. MsWinZonesCacheCounterMutexA is documented in threat intel for WannaCry — finding it in handles output closes the case conclusively. Always check mutants/mutexes via handles -t Mutant.

DLL Loads Tell a Story

A "decryptor UI" loading ws2_32.dll is behaviorally anomalous. DLL analysis isn't just about finding the binary — it's about understanding what capabilities the process had at runtime.

Context Is Everything

The process name, the path, the parent, the DLLs, the mutex — no single artifact is conclusive. Memory forensics is about layering evidence until the picture is undeniable. Each plugin is a lens; use all of them.

Volatility Plugin Cheatsheet — This Case
imageinfo / windows.info — Profile detection & system metadata
pslist — Active process list (can be evaded)
psscan — Pool-tag scan; catches unlinked/hidden processes
pstree — Visualize parent-child relationships
dlllist -p [PID] — Enumerate loaded DLLs + binary path
memdump -p [PID] — Dump process memory for hashing/AV scan
handles -p [PID] -t Mutant — Extract mutexes from process handles