๐Ÿ‘ฟ Uncovering the Digital Shadows: A Deep Dive into Forensic Memory Analysis with Volatility

Mike Rebultan
5 min readNov 6, 2024

--

Scenario
Imagine a mid-sized financial company suddenly discovers its operations disrupted by ransomware. Systems are locked, files encrypted, and a chilling ransom demand appears on executivesโ€™ screens. The companyโ€™s revenue pipeline hangs in the balance, and internal data is at risk. With security protocols triggered, a DFIR (Digital Forensics and Incident Response) team is prepared to dissect and neutralize the threat.

As part of this response, forensic analysts acquire memory dumps of affected machines, hoping to unearth clues within the volatile data โ€” the โ€œdigital shadowsโ€ of processes, files, and potentially malicious code. This blog explores the steps and tools used, offering lessons for DFIR professionals at every level of expertise.

The Forensics Approach: Volatility Framework in Action
Volatility is a staple in memory forensics, transforming memory dumps into treasure troves of investigative data. We can piece together an intricate web of interactions through modules like ๐๐ž๐ญ๐’๐œ๐š๐ง, ๐Œ๐š๐ฅ๐…๐ข๐ง๐, ๐Œ๐ฎ๐ญ๐š๐ง๐ญ๐’๐œ๐š๐ง, ๐๐’๐‹๐ข๐ฌ๐ญ, and ๐๐’๐“๐ซ๐ž๐ž, uncovering how malicious processes operate and communicate.

Volatility Workbench by Passmark

Below, we walk through the forensic investigation of a compromised system using Volatility, from preparation to final reporting, offering takeaways for beginners, intermediates, and advanced DFIR practitioners.

Step-by-Step Analysis and Insights

  1. PID Tracking and Dump Analysis with PSList and PSTree
  • Beginner Lesson: Start with process listings. Modules like PSList help identify active processes, their IDs, and parent-child relationships, providing a clear map of system activity.
  • Intermediate Tip: Analyzing PSTree adds depth, revealing the process hierarchy. Look for suspicious patterns, like processes spawning from unexpected parents.
  • Advanced Insight: Cross-reference entries with known excellent or bad lists. Identifying processes linked to malware variants can rapidly narrow your scope.
vol.exe -f artifact.raw windows.pslist.PsList
vol.exe -f artifact.raw windows.pstree.PsTree

2. Unmasking Malicious Files with DumpFiles

  • Beginner Lesson: DumpFiles extracts files directly from memory, often leading to the discovery of encrypted files or cached malware.
  • Intermediate Tip: Hash extracted files using tools like HashCalc, then compare these with databases like VirusTotal for potential matches.
  • Advanced Insight: Investigate DataSectionObjects and SharedCacheMaps for evidence of code injections. Malicious DLLs often hide within these structures.

Several files were dumped from explorer.exe (PID 4320), although some files could not be dumped, possibly due to malware interference.

vol.exe artifact.raw windows.dumpfiles.DumpFiles โ€” pid 4320

Analysis
The successful extraction of certain files confirms that key system components were involved. However, failure to dump other files suggests they were locked by the malware.

3. Network Connections and Remote Threats with NetScan

  • Beginner Lesson: NetScan reveals network connections, IP addresses, ports, and protocols โ€” vital in understanding external communication.
  • Intermediate Tip: Focus on non-standard ports or unusual IPs. Connections to remote IPs during off-hours may indicate an active attacker presence.
  • Advanced Insight: Perform correlation analysis on network data with NetScan. Unexpected external IP addresses, especially if they link back to TOR nodes or data exfiltration sites, are clear indicators of compromise.

During the network scan, several suspicious connections were identified, particularly open SMB ports (445, 139), which are frequently targeted by ransomware for lateral movement.

vol.exe -f artifact.raw windows.netscan.NetScan

4. Rooting Out Code Injections with MalFind

  • Beginner Lesson: MalFind locates injected code within legitimate processes, often a hallmark of sophisticated malware.
  • Intermediate Tip: Look for VAD (Virtual Address Descriptor) entries โ€” unmapped sections may contain injected code.
  • Advanced Insight: Dump and analyze these sections. Some injections mimic legitimate functions, hiding in plain sight. Advanced triage and analysis may be needed to separate malicious code from legitimate payloads.

MalFind analysis identified injected code in critical processes such as explorer.exe, svchost.exe, and lsass.exe, often targeted by malware.

vol.exe -f artifact.raw windows.malfind.Malfind

5. Synchronization Signals with MutantScan

  • Beginner Lesson: MutantScan helps identify mutex objects used by malware to maintain synchronization and avoid redundant execution.
  • Intermediate Tip: Cross-check mutex names with known malware behaviour databases. Certain ransomware families reuse specific mutexes.
  • Advanced Insight: Analyzing mutexes in context with PSTree and NetScan results can reveal command-and-control interactions or secondary payloads awaiting triggers.

Mutex objects were identified, and some were found to be suspicious, often used by malware for persistence.

vol.exe -f artifact.raw windows.mutantscan.MutantScan

Practical Lessons for DFIR Professionals
Beginners

  • Focus on understanding each moduleโ€™s output. Knowing what each field represents is half the battle. Build a mental model of process interactions and network activities.
  • Use established analysis flows โ€” PSList, then PSTree, followed by MalFind, NetScan, and MutantScan. Familiarity with order and logic will be your foundation.

Intermediates

  • Dive into correlating process behaviours. Ask yourself: why is this process here? Is its network activity expected?
  • Hone your hash comparison skills. Hashing dumped files with tools like HashCalc and comparing them with malware databases can give quick insights into suspicious files.

Advanced Analysts
Develop a habit of cross-correlating data across modules. Suspicious processes identified in PSList can be re-evaluated in NetScan to trace network anomalies.

  • Explore each moduleโ€™s advanced flags and functions to extract deeper data. Volatilityโ€™s vast module options allow precise targeting and deep dives into specific areas, such as MalFind for hidden injections.

Key Takeaways for Your DFIR Toolkit
Stay Methodical
: Every analysis step builds on the last. This layered approach not only reveals hidden information but also helps prevent oversight.

  • Correlate, Correlate, and Correlate: Process listings, network scans, and mutex objects all interlink in the memory map. Cross-reference findings to get a full picture.
  • Refine Your Reporting Skills: A solid report should communicate findings effectively. Aim for clarity โ€” break down complex data into actionable insights for executives.
  • Adapt Your Toolkit: Volatility is powerful, but using complementary tools, like VirusTotal and HashCalc, can broaden your analysis. Autopsy and FTK are worth a try too, although some cases may yield little due to encryption or obfuscation.

Conclusion: Elevating Your Forensic Practice
Memory forensics is a constantly evolving field, where every byte holds potential evidence. The above methods are just a few ways to deepen your understanding, sharpen your analysis, and refine your reporting. Whether youโ€™re a beginner building your foundation, an intermediate analyst honing your technique, or an advanced professional, remember that a systematic approach and attention to detail are your most substantial assets.

The next time your organization faces a ransomware attack or a data breach (knock in the wood), let memory forensics be the light that reveals the unseen. By mastering Volatility and memory analysis, you transform into a digital detective capable of unravelling the most insidious cyber threats.

--

--

Mike Rebultan
Mike Rebultan

Written by Mike Rebultan

Cyber-security is not a Job, calling!

No responses yet