Practical Digital Forensics Scenario
Scenario Setup
Target System Access: Use RDP to connect to the Target IP with provided credentials.
Evidence Locations:
Memory Dump:
C:\Users\johndoe\Desktop\memdump\PhysicalMemory.rawRapid Triage Artifacts:
C:\Users\johndoe\Desktop\kapefilesC:\Users\johndoe\Desktop\files
Full Disk Image:
C:\Users\johndoe\Desktop\fulldisk.raw.001Parsed Disk Data:
C:\Users\johndoe\Desktop\MalwareAttack
Notes
Autopsy analysis should be done from
C:\Users\johndoe\Desktop\MalwareAttack.Ideal forensics environment is separate from the impacted system; analysis is done directly on the affected system here for expediency.
Memory Analysis with Volatility v3
Identifying Memory Profile
To get OS and kernel details of the memory dump:
python vol.py -q -f ..\memdump\PhysicalMemory.raw windows.infoSample Output
Kernel Base
0xf80150019000
DTB
0x1ad000
Symbols
file:///C:/Users/johndoe/Desktop/...
Is64Bit
True
SystemTime
2023-08-10 09:35:40
NtSystemRoot
C:\Windows
NtMajorVersion
10
NtMinorVersion
0
Detecting Injected Code
To find process memory regions potentially containing injected code:
Sample Output
Processes with PAGE_EXECUTE_READWRITE memory:
PID 3648(rundll32.exe),PID 6744(powershell.exe),PID 5468(rundll32.exe)
Explanation of PAGE_EXECUTE_READWRITE
This permission allows both execution and modification of code in memory, typically avoided in legitimate applications.
Common with malware, which injects code into memory and executes it, warranting further investigation.
Identifying Running Processes
Listing Processes
Using windows.pslist to list processes:
Sample Output (Excerpt)
4
0
System
2023-08-10 00:22:53.000000
N/A
3648
7148
rundll32.exe
2023-08-10 09:15:14.000000
1
6744
908
powershell.exe
2023-08-10 09:21:16.000000
1
5468
7512
rundll32.exe
2023-08-10 09:23:15.000000
0
Viewing Process Tree
Using windows.pstree to view parent-child process relationships:
Shows parent-child relationships, helping identify suspicious child processes spawned by common processes (e.g., rundll32.exe under explorer.exe).
Identifying Process Command Lines
Using windows.cmdline to retrieve command-line arguments:
Sample Output
416
csrss.exe
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows ...
3648
rundll32.exe
C:\Windows\System32\rundll32.exe payload.dll,StartW
6744
powershell.exe
PowerShell.exe -nop -w hidden -encodedcommand JABzAD0ATgBlAHcAL...
Dumping Process Memory & Leveraging YARA
To analyze process 3648, use Volatility's windows.memmap plugin to extract all memory-resident pages of this process:
Sample output:
The memory dump pid.3648.dmp is stored at c:\Users\johndoe\Desktop.
Scanning with YARA
Scan the memory dump with YARA rules using a PowerShell loop to apply all available rules from https://github.com/Neo23x0/signature-base.
PowerShell script:
Sample output indicates hits for:
HKTL_CobaltStrike_Beacon_StringsCobaltStrike_Sleep_Decoder_IndicatorWiltedTulip_ReflectiveLoader
Identifying Loaded DLLs
Examine loaded DLLs using the windows.dlllist plugin:
Output includes:
payload.dllatE:\payload.dll, suggesting possible external or ISO origin.
Identifying Handles
Use windows.handles to reveal accessed files and registry entries:
Sample output:
Access to
\Device\HarddiskVolume3\Users\johndoe\Desktop
Identifying Network Artifacts
Analyze network connections with windows.netstat:
Sample output reveals connections for:
chrome.exe,WWAHost.exe, andrundll32.exe
For comprehensive network analysis, use:
Sample output reveals:
The suspicious process (PID
3648) has been communicating with44.214.212.249over port80.
Disk Image/Rapid Triage Data Examination & Analysis
Searching for Keywords with Autopsy
Open Autopsy and access the case at:
C:\Users\johndoe\Desktop\MalwareAttackSearch for
payload.dll, prioritize by creation time.Significant finding:
Finance08062023.isoin Downloads, related toEdrive DLL.Extraction: Right-click on
Finance08062023.isoand select Extract File(s).
Identifying Web Download Information & Extracting Files
.Zone.Identifiervia Alternate Data Stream (ADS) confirms internet origin.Source URL identified in Web Downloads artifacts as:
letsgohunt[.]site.
Analyzing Cobalt Strike Beacon Configuration
Use
CobaltStrikeParserat:C:\Users\johndoe\Desktop\CobaltStrikeParser-master\CobaltStrikeParser-masterCommand:
python parse_beacon_config.py E:\payload.dllKey Configurations Extracted:
BeaconType: HTTP, Port: 80, C2Server: letsgohunt.site,/load
Other notable fields:
HttpGet_Metadata,bUsesCookies,Spawnto_x64.
Persistence Mechanisms with Autoruns
Autoruns analysis: Check
C:\Users\johndoe\Desktop\files\johndoe_autoruns.arnFound entry:
Path:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunImage:
C:\ProgramData\svchost.exe
File Hash Identification & VirusTotal
To identify hash of
photo433.exe:
Scheduled Tasks & Timestomping Analysis
Inconsistency between
$FILE_NAME MFT Modifiedand$STANDARD_INFORMATION File Modifiedtimestamps indicates timestomping.
SRUM Data Analysis
Observed potential exfiltration of
430526981bytes fromSRUDB.dat.
Windows Event Logs Analysis with Chainsaw
Command:
Alerts observed in
sigma.csv:Cobalt Strike Load by rundll32
UAC Bypass/Privilege Escalation by fodhelper.exe
Prefetch Files Analysis
Command to analyze prefetch files:
USN Journal Analysis
Command:
Suspicious activities took place approximately between 2023-08-10 09:00:00 and 2023-08-10 10:00:00.
To view the CSV using PowerShell in alignment with our timeline, we can execute:
Here's the full markdown for the content provided, formatted for clarity and utility in digital forensic analysis:
Disk Image/Rapid Triage Data Examination & Analysis
Analyzing Rapid Triage Data - MFT/pagefile.sys (MFTECmd/Autopsy)
Recovering Deleted Files Using MFT Analysis
Objective: Attempt to recover
flag.txtvia MFT analysis.Challenge: The affected machine's MFT table is unavailable.
Alternative: Use another system’s MFT table (
C:\Users\johndoe\Desktop\files\mft_data), whereflag.txtwas similarly deleted.
Run MFTECmd to parse the $MFT file:
Output:
Processed MFT file with 113,899 records (4,009 marked as free).
CSV output saved at
C:\Users\johndoe\Desktop\mft_csv.csv.
Search for flag.txt:
Result:
Provides
flag.txt's location:\Users\johndoe\Desktop\reports.
Verify with MFT Explorer:
Tool: Open
C:\Users\johndoe\Desktop\files\mft_datain MFT Explorer (available atC:\Users\johndoe\Desktop\Get-ZimmermanTools\net6\MFTExplorer).Finding: Within the
reportsfolder,flag.txtis marked with the Is deleted attribute.
Understanding NTFS File Deletion
Insight:
Deleted files on NTFS volumes have MFT entries marked as free, making recovery possible until the data is overwritten.
Case-Specific: The compromised system’s file was overwritten, necessitating MFT analysis on another system.
Extracting Data from pagefile.sys
Scenario: Portions of
flag.txtremain inpagefile.sys, which Windows uses to manage RAM overflow.Approach:
Use Autopsy to scan
pagefile.sysfor partial content recovery.
Constructing an Execution Timeline with Autopsy
Timeline Parameters:
Incident Window: 09:13 to 09:30 (GMT / UTC).
Tool: Autopsy, leveraging Plaso for timeline generation.
Configuration:
Event Types: Select
Web Activity: AllandOther: All.Time Settings:
Start:
Aug 10, 2023, 9:13:00 AMEnd:
Aug 10, 2023, 9:30:00 AM
Purpose:
To map the chronological actions of the malicious actor by filtering files accessed or created during this interval.
The Actual Attack Timeline
Objective: Examine identified and undetected actions taken by the attacker.
Next Step: Based on forensic findings, try to match documented activity with any undetected actions outlined in the actual attack sequence.
Last updated