Evidence of Execution Forensics β SOCb Analyst Cheatsheet
Comprehensive Guide for Execution Analysis & Malware Detection
Quick Reference: Execution Artifacts Matrix
Prefetch
β YES
Last 8 runs
β YES
β
β
~30 days
Amcache
β Presence only
Install time
β
β
β YES
Persistent
ShimCache
β Presence only
Last modified
β
β
β
Until reboot
BAM/DAM
β YES
Last run
β
β
β
~7 days
UserAssist
β YES
Last run
β YES
β
β
Persistent
Jump Lists
β YES (indirect)
Multiple
β
β
β
Persistent
Investigation Priority Matrix
CRITICAL
Prefetch
Recent execution (30 days), frequency
Last 8 runs, run count, DLLs
~1024 file limit
CRITICAL
Amcache
SHA1 hashes, malware ID
Definitive file identification
Doesn't prove execution
HIGH
ShimCache
Historical presence
Files that existed (even deleted)
No execution proof (Win10+)
HIGH
BAM/DAM
Very recent (7 days)
Last execution per user
Single timestamp only
MEDIUM
UserAssist
GUI execution
Run count, focus time
GUI apps only
MEDIUM
Jump Lists
File associations
App-specific file access
Application-dependent
Critical Understanding: Execution vs. Presence
Proves Execution:
β Prefetch - Application ran
β BAM/DAM - Application ran (last time)
β UserAssist - GUI application ran
β Event 4688 - Process creation logged
Indicates Presence (NOT execution):
β Amcache - File existed on system
β ShimCache (Win10+) - File was checked for compatibility
β MFT - File existed on disk
This distinction is CRITICAL for court testimony and investigation accuracy!
SOC Investigation Workflows
Workflow 1: Malware Execution Detection (CRITICAL)
Scenario: Suspected malware on endpoint
Investigation Steps (Priority Order):
Step 1: Check Prefetch for Recent Execution
Location: C:\Windows\Prefetch\
Why First:
Proves execution
Shows frequency (run count)
Last 8 execution times
Shows loaded DLLs
Reveals file paths
Prefetch File Naming: EXECUTABLE-HASH.pf
Example:
MIMIKATZ.EXE-A3F8B2C9.pfHash based on executable path
Multiple prefetch = same name, different locations
PowerShell - Quick Prefetch Check:
Using PECmd (Zimmerman Tool) - REQUIRED for Full Analysis:
Critical Prefetch Metadata:
Executable- Program that ranRunCount- Times executedLastRun- Most recent executionPreviousRun0-7- Last 8 executions (Win10/11)FilesLoaded- DLLs and dependenciesDirectoriesLoaded- Directories accessedVolume Info- Drive serial numbers
Red Flags in Prefetch:
β Multiple prefetch files for same executable (different locations)
CMD.EXE-8E75B5BB.pf(normal: C:\Windows\System32)CMD.EXE-A3F8B2C9.pf(suspicious: C:\Users\Public)
β Known attack tools (mimikatz, procdump, psexec)
β Recently created during incident window
β High run count on suspicious files
β Unusual paths in FilesLoaded/DirectoriesLoaded
IMPORTANT EXCEPTIONS:
Step 2: Extract SHA1 Hashes from Amcache
Location: C:\Windows\AppCompat\Programs\Amcache.hve
Why Second:
SHA1 hash = definitive file identification
Survives file rename/deletion
Can match against VirusTotal/threat intel
Full path and metadata
CRITICAL UNDERSTANDING:
Using AmcacheParser (Zimmerman Tool):
PowerShell - Check if Amcache Exists:
Amcache Key Metadata:
SHA1- File hash (CRITICAL for identification)FullPath- Complete file pathFileSize- File size in bytesFileExtension- File typeLinkDate- Compilation timestampPublisher- Digital signature publisherBinaryType- 32-bit vs 64-bit
Investigation Workflow with SHA1:
Example Analysis:
Step 3: Check ShimCache for Historical Presence
Location: C:\Windows\System32\config\SYSTEM Registry Key: SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache
Why Third:
Shows files that existed on system
Survives file deletion
Contains files that may have been present but removed
CRITICAL UNDERSTANDING:
Using AppCompatCacheParser (Zimmerman Tool):
ShimCache Metadata:
Path- Full executable pathLastModified- File modification timeFileSize- File sizeExecuted- Execution flag (pre-Win10 only)
Red Flags in ShimCache:
β Executables that no longer exist on disk
β Modified system tools (unusual modification dates)
β Paths from temp/external media
β Known malware filenames
β Recent entries during incident window
Investigation Pattern:
Step 4: Check BAM/DAM for Very Recent Activity
Location: SYSTEM\CurrentControlSet\Services\bam\State\UserSettings\{SID}
Why Fourth:
Very recent activity (last 7 days)
Last execution timestamp
Per-user attribution
PowerShell - Parse BAM:
Step 5: Check UserAssist for GUI Application Execution
Location: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist
Why Fifth:
Proves GUI application execution
Run count available
Focus time (time in foreground)
IMPORTANT: Values are ROT-13 encoded
PowerShell - Decode ROT-13:
UserAssist GUIDs:
CEBFF5CD- Executable file executionF4E57C4B- Shortcut file execution
UserAssist Metadata:
Complete Execution Analysis Script
Workflow 2: Persistence Mechanism Detection
Scenario: Detect malware persistence mechanisms
AutoStart Extension Points (ASEP)
Critical Locations:
Registry Run Keys:
Winlogon:
Startup Folder:
PowerShell - Check All ASEP Locations:
Using Autoruns (Sysinternals):
Workflow 3: File System Artifacts
Master File Table ($MFT)
Location: Root of NTFS volume (hidden system file)
Forensic Value:
Every file/folder on NTFS volume
Timestamps (MACB - Modified, Accessed, Changed, Born)
File size, attributes
Deleted file records (may persist)
Using MFTECmd (Zimmerman Tool):
USN Journal ($J)
Location: $Extend\$UsnJrnl:$J
Forensic Value:
File system change journal
Records create, delete, rename operations
Timestamps for file activity
Shows files that were deleted
Using MFTECmd:
$LogFile
Location: Root of NTFS volume
Forensic Value:
NTFS transaction log
File operations (create, delete, modify, rename)
Even more detailed than USN Journal
Using LogFileParser:
Workflow 4: Alternate Data Streams (ADS)
Description: Hidden data streams attached to files (NTFS only)
Malware Use Cases:
Hide malicious code in legitimate files
Store hacking tools invisibly
Evade antivirus detection
PowerShell - Find ADS:
Manual ADS Commands:
Zone.Identifier ADS:
Investigation Checklists
Malware Execution Investigation
[ ] Check Prefetch for known malware tools
[ ] Look for multiple prefetch files for standard tools (cmd.exe, etc.)
[ ] Extract SHA1 hashes from Amcache
[ ] Search SHA1 on VirusTotal
[ ] Check ShimCache for deleted executables
[ ] Review BAM/DAM for recent execution
[ ] Parse UserAssist for GUI application usage
[ ] Check for executables in suspicious paths
[ ] Build execution timeline with all artifacts
[ ] Cross-reference with network/file access artifacts
Persistence Investigation
[ ] Check all Run/RunOnce keys (HKLM and HKCU)
[ ] Verify Winlogon Shell and Userinit values
[ ] Check Startup folder for suspicious items
[ ] Review Services for malicious entries
[ ] Check Scheduled Tasks
[ ] Look for DLL hijacking indicators
[ ] Scan for ADS on system files
[ ] Use Autoruns for comprehensive ASEP check
[ ] Document all persistence mechanisms found
Timeline Construction
[ ] Parse Prefetch to CSV
[ ] Parse Amcache to CSV
[ ] Parse ShimCache to CSV
[ ] Parse BAM/DAM to CSV
[ ] Parse Jump Lists to CSV
[ ] Merge all CSVs in TimelineExplorer
[ ] Sort by timestamp
[ ] Filter by incident window
[ ] Correlate execution with file/network activity
[ ] Document complete attack timeline
Critical Detection Patterns
Suspicious Prefetch Patterns
Suspicious Amcache Indicators
Suspicious ShimCache Indicators
Real Investigation Scenario
Case Study: Mimikatz Execution Detection
Evidence Chain:
1. Prefetch Analysis:
2. Amcache Analysis:
3. VirusTotal Check:
4. ShimCache Analysis:
5. BAM Analysis:
6. Timeline:
Conclusion:
Mimikatz definitively executed 3 times
Used by Bob's account
Credential dumping activity
Attacker attempted cleanup (file deleted)
Evidence survived via Prefetch, Amcache, ShimCache
Summary: Key Takeaways
Most Critical Artifacts (Top 3)
Prefetch - Proves execution, run count, timeline
Amcache - SHA1 hashes for definitive identification
ShimCache - Historical presence even if deleted
Execution Proof Hierarchy
Definitive Proof:
β Prefetch file exists
β Event 4688 logged
β UserAssist entry (GUI apps)
Strong Indicator:
β BAM/DAM entry (very recent)
β Jump List entry (application used file)
Presence Only (NOT execution):
β Amcache entry (Win7+)
β ShimCache entry (Win10+)
β MFT record
Critical Commands
Key Principle
Execution artifact analysis requires correlation of multiple sources. Prefetch proves execution, Amcache provides SHA1 for identification, ShimCache shows historical presence. Always validate findings across artifacts - a single artifact is never sufficient for conclusive determination.
Target Audience: SOC analysts, incident responders, malware analysts Tools Required: Zimmerman Tools (PECmd, AmcacheParser, AppCompatCacheParser, JLECmd), Autoruns Usage: Malware detection, execution timeline, persistence hunting
Remember: Prefetch = execution proof. Amcache = SHA1 identification. ShimCache = historical presence. Multiple prefetch files for standard tools (cmd.exe, powershell.exe) = potential attacker activity. Always correlate artifacts!
Last updated