Evidence of Execution Forensics – SOCb Analyst Cheatsheet

Comprehensive Guide for Execution Analysis & Malware Detection


Quick Reference: Execution Artifacts Matrix

Artifact
Proves Execution
Timeline
Run Count
File Path
SHA1 Hash
Retention

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

Priority
Artifact
Best For
Key Value
Limitation

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.pf

  • Hash 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 ran

  • RunCount - Times executed

  • LastRun - Most recent execution

  • PreviousRun0-7 - Last 8 executions (Win10/11)

  • FilesLoaded - DLLs and dependencies

  • DirectoriesLoaded - Directories accessed

  • Volume 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 path

  • FileSize - File size in bytes

  • FileExtension - File type

  • LinkDate - Compilation timestamp

  • Publisher - Digital signature publisher

  • BinaryType - 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 path

  • LastModified - File modification time

  • FileSize - File size

  • Executed - 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 execution

  • F4E57C4B - 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)

  1. Prefetch - Proves execution, run count, timeline

  2. Amcache - SHA1 hashes for definitive identification

  3. 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