Masks

Memory Forensics & Phishing Incident Response

Challenge 1 Memory Forensics Malware Analysis Incident Response

Challenge Scenario

Description: In this challenge, we're provided with a memory dump (.mem) and an instance in order to solve 8 questions and retrieve the flag. We're tasked with investigating a phishing incident where a malicious email attachment compromised a system.

Artifacts Provided: A memory dump file (.mem) captured during/after the phishing attack. We need to answer 8 sequential questions to uncover the complete attack chain.

Initial Setup

Forensics Tool: Volatility 3

Since we have a memory dump, we'll use Volatility 3 for our analysis. Volatility is the industry-standard framework for memory forensics, allowing us to extract processes, files, registry keys, and other artifacts from memory dumps.

Primary Tool: Volatility 3 (vol3)
Analysis Type: Windows Memory Forensics
Goal: Trace the complete attack chain from email delivery to persistence

Question-by-Question Analysis

Question 1: Process Used to Deliver Malicious Attachment

Question: What process was used to deliver the malicious attachment?

We start by enumerating all running processes in the memory dump using Volatility's windows.pslist plugin:

python3 ~/volatility3/vol.py -f Masks/memdump.mem windows.pslist
Process list showing OUTLOOK.exe

From the process list, we identify OUTLOOK.exe, which is Microsoft Outlook - the email client responsible for handling emails. Given that the challenge description mentions a phishing incident, this is clearly the process that delivered the malicious attachment.

Answer: OUTLOOK.exe

Question 2: Phishing Email Reception Time

Question: At what time was the phishing email received?

To find when the phishing email was received, we need to extract and examine Outlook's data files (OST files - Offline Storage Table).

Step 1: Enumerate Files

we list all ost files present in the memory dump

python3 ~/volatility3/vol.py -f Masks/memdump.mem windows.filescan | grep -i "\.ost"
output of filescan command

Step 3: Dump the OST File

Using the offset obtained from filescan, we dump the OST file:

python3 ~/volatility3/vol.py -f Masks/memdump.mem windows.dumpfiles --virtaddr 0xe0002a1e9ec0
# Rename the dumped file appropriately

Step 4: Export OST Contents with pffexport

We use pffexport to extract the contents of the OST file:

pffexport dumped_file.ost -t output_folder
Email timestamp from exported OST

After exporting, we examine the exported files and locate the timestamp showing when the malicious email was received.

Answer: 2025-09-06 15:24:45

Question 3: CVE Identification

Question: What CVE was exploited by the malicious attachment?

From the exported OST contents, we found a suspicious .rar attachment. Let's analyze it.

Extract Strings from the RAR File

strings suspicious_attachment.rar > attachment_strings.txt

Examining the strings output revealed a path to a suspicious .exe file which appears to be the malicious loader.

Hash Analysis with VirusTotal

Calculate the hash and check it on VirusTotal:

sha256sum suspicious_attachment.rar
VirusTotal showing CVE information

VirusTotal confirms the file is malicious and provides information about the CVE being exploited. Cross-referencing with Google searches for the loader path also reveals the CVE.

Answer: CVE-2025-8088

Question 4: Malicious Loader Path

Question: What is the full path of the malicious loader executable?

From Question 3's strings analysis of the RAR attachment, we already discovered the full path to the malicious loader.

Answer: C:\Users\tyler\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\update.exe

Question 5: Malicious Loader Hash (The Tricky One!)

Question: What is the SHA256 hash of the malicious loader?

❌ First Attempt (Failed)

Search for the loader file in files.txt, dump it, and calculate SHA256:

vol3 -f memory.mem windows.dumpfiles --virtaddr 0xe0002ab8ff20
sha256sum dumped_loader.exe
Result: Wrong Answer!

✅ The Solution: AmCache Analysis

💡 Key Insight: Windows AmCache

The AmCache.hve is a Windows registry hive that stores detailed information about programs that have been executed or installed on a system. It's extremely valuable in digital forensics for tracking program execution and identifying malware.

Important: AmCache stores SHA1 hashes of executed programs, which can be cross-referenced with VirusTotal to get the SHA256 hash.

Volatility 3 has a plugin called windows.amcache that extracts this information:

python3 ~/volatility3/vol.py -f Masks/memdump.mem windows.amcache
amcache output

This outputs all executed programs with their SHA1 hashes. We locate our malicious loader and get its SHA1 hash.

Cross-Reference with VirusTotal

Search VirusTotal with the SHA1 hash to obtain the complete file information, including the SHA256 hash.

Answer: fdccd1cf5bc43b638e530cdccd0e284f018e3239f65a9896e2c02246b3e1a6af

Question 6: Shellcode URL

Question: What is the URL from which the shellcode was downloaded?

With the malicious loader's hash identified, we can use VirusTotal's Behavior tab to see the malware's dynamic analysis results.

VirusTotal Behavior Analysis

Navigate to the Behavior tab on VirusTotal for the loader's hash. This shows:

  • Network connections and DNS requests
  • File operations
  • Registry modifications
  • Downloaded or dropped files

In the network activity section, we find the URL from which the malware downloaded its shellcode payload.

Memory patern urls
Answer: http://121.109.119.121:8251/73317278.bin

Question 7: Command & Control Server

Question: What is the C2 (Command and Control) IP address and port?

The malicious loader spawned a process called update.exe (PID: 2484). To find the C2 server, we need to analyze this process's memory.

Step 1: Dump Process Memory

python3 ~/volatility3/vol.py -f Masks/memory.mem windows.memmap --pid 2484 --dump

Step 2: Extract Strings

strings pid.2484.dmp > dump.txt

Step 3: Search for Network Indicators

Searching through the strings file for IP addresses, we identify the C2 IP address

the C2 IP

For the port, we found a port scanning command that referenced three potential ports. Testing these ports revealed which one was the active C2 port.

the C2 PORT
Answer: 121.109.119.158:443
Note: This might be an unintended solution, but it worked! 😝

Question 8: Persistence Mechanism

Question: What command did the attacker use for persistence?

❌ Initial Attempts

1. Process Memory Search: Searched update.exe memory for PowerShell commands - no persistence found.

2. Traditional Registry Keys: Checked common persistence locations:

  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

Result: No malicious entries found!

✅ The Breakthrough: Scheduled Tasks

💡 Persistence via Scheduled Tasks

After hours of searching, we pivoted to examining Windows Scheduled Tasks - a common but often overlooked persistence technique. Scheduled tasks are stored as XML files in C:\Windows\System32\Tasks.

Step 1: Search for Task Files

Search files.txt for entries in the Tasks directory:

# Search pattern: Windows\System32\Tasks

Step 2: Identify Suspicious Task

We found a suspicious scheduled task named MicrosoftUpdate. This is suspicious because:

  • It mimics legitimate Windows Update naming (social engineering)
  • The context involves a loader named "update.exe"
  • Legitimate Microsoft tasks have different naming patterns

Step 3: Dump and Analyze

python3 ~/volatility3/vol.py -f Masks/memdump.mem windows.dumpfiles --virtaddr 0xe0002925cf20
Malicious scheduled task XML

Reading the XML contents, we find the <Command> element containing the persistence command.

Answer: C:\users\public\tmp.cmd

Challenge Complete! 🎉

Investigation Summary

8

Questions Solved

5+

Volatility Plugins

AmCache

Key Artifact

Scheduled Task

Persistence Method

Key Takeaways

Tools & Techniques

Memory Forensics

  • Volatility 3
  • windows.pslist
  • windows.filescan
  • windows.dumpfiles
  • windows.memmap
  • windows.amcache

Email Forensics

  • pffexport
  • OST/PST Analysis

Malware Analysis

  • VirusTotal
  • Hash Analysis
  • Behavior Analysis
  • strings utility

Persistence Analysis

  • Registry Analysis
  • Scheduled Tasks
  • Windows Artifacts

Explore More Challenges

Check out other forensics writeups from QnQSec CTF 2025.