xalgorix/xalgorix/analyzing-prefetch-files-for-execution-history
Claude Code and agent skill by xalgorix/xalgorix
- community
Checking that the SKILL.md file is still in the repository.
Parse Windows Prefetch files to determine program execution history including run counts, timestamps, and referenced
Install
npx vskill@latest install xalgorix/xalgorix/analyzing-prefetch-files-for-execution-historySKILL.md
The same SKILL.md was published earlier as xalgorix/xalgorix/analyzing-prefetch-files-for-execution-history.
Analyzing Prefetch Files for Execution History
When to Use
- When determining which programs were executed on a Windows system and when
- During malware investigations to confirm execution of suspicious binaries
- For establishing a timeline of application usage during an incident
- When correlating program execution with other forensic artifacts
- To identify anti-forensic tools or unauthorized software that was run
Detection Gaps & Validation
- Prefetch disabled or absent != no execution: Prefetch is off by default on Windows Server, and on SSD systems
EnablePrefetcheris often set to 0. An empty or sparseC:\Windows\Prefetch\does not mean nothing ran - confirm the policy atHKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParametersbefore concluding "no execution," then pivot to Amcache/ShimCache/SRUM/Event Logs. - Most-missed details inside the .pf: parse the up-to-8 last-run timestamps (not just the most recent), the run count, and the referenced-file list (loaded DLLs, opened data files). The embedded path hash matters: a hash that doesn't match the on-disk path means the binary ran from a different location (USB, deleted folder) than where it now sits.
- Anti-forensics that defeats this analysis: attackers delete individual
.pffiles or clear the folder - a present executable with no Prefetch, or a folder with fewer files than an active system accumulates, is itself suspicious. Recover deleted.pffrom$MFT/unallocated and Volume Shadow Copies, and corroborate the gap with USN delete events. - Validate with a second source: Prefetch proves a binary executed at least once - confirm the what/when against Amcache (
Amcache.hve), ShimCache (AppCompatCache), SRUM, Security 4688 / Sysmon 1 process-creation events, and the on-disk file's$MFTtimes before attributing a run to a user or time. - Interpretation pitfalls (false positives): the last-run time is when the prefetch was written (~10s after launch start, with historical caveats), run count can reset, and renamed malware (e.g.
svchost.exefrom%TEMP%) hides behind a trusted name - check the path hash and referenced files, not the filename. Confirm system timezone and clock skew.
Prerequisites
- Access to Windows Prefetch directory (C:\Windows\Prefetch\) from forensic image
- PECmd (Eric Zimmerman), WinPrefetchView, or python-prefetch parser
- Understanding of Prefetch file format (versions 17, 23, 26, 30)
- Windows system with Prefetch enabled (default on client OS, disabled on servers)
- Knowledge of Prefetch naming conventions (APPNAME-HASH.pf)
Workflow
Step 1: Extract Prefetch Files from Forensic Image
Step 2: Parse Prefetch Files with PECmd
Step 3: Parse with Python for Linux-Based Analysis
Step 4: Identify Suspicious Execution Evidence
Step 5: Build Execution Timeline
Key Concepts
| Concept | Description | |
|---|---|---|
| Prefetch | Windows performance optimization that pre-loads application data and tracks execution | |
| SCCA signature | Magic bytes identifying a valid Prefetch file | |
| Path hash | CRC-based hash of the executable path forming part of the .pf filename | |
| Run count | Number of times the executable has been launched (may wrap around) | |
| Last run timestamps | Windows 8+ stores up to 8 most recent execution timestamps | |
| Referenced files | List of files and directories accessed during the first 10 seconds of execution | |
| Volume information | Drive serial number and creation date identifying the source volume | |
| MAM compression | Windows 10 Prefetch files use MAM4 compression requiring decompression before parsing |
Tools & Systems
| Tool | Purpose | |
|---|---|---|
| PECmd | Eric Zimmerman's Prefetch parser with CSV/JSON output | |
| WinPrefetchView | NirSoft GUI tool for viewing Prefetch files | |
| python-prefetch | Python library for parsing Prefetch files | |
| Prefetch Hash Calculator | Tool to calculate expected hash from executable paths | |
| KAPE | Automated artifact collection including Prefetch | |
| Autopsy | Forensic platform with Prefetch analysis module | |
| Plaso/log2timeline | Super-timeline tool that includes Prefetch parser | |
| Velociraptor | Endpoint agent with Prefetch collection and analysis artifacts |
Common Scenarios
Scenario 1: Confirming Malware Execution Search Prefetch directory for the malware executable name, confirm execution via Prefetch existence, extract run count and last run time, identify referenced DLLs to understand malware behavior, correlate with registry autorun entries.
Scenario 2: Attacker Tool Usage Timeline Identify Prefetch files for PsExec, Mimikatz, BloodHound, and other attacker tools, build chronological timeline of tool execution, determine the sequence of the attack (reconnaissance, credential theft, lateral movement), match timestamps with network connection logs.
Scenario 3: Data Staging and Exfiltration Look for Prefetch entries of compression tools (7z, WinRAR, zip), identify execution of file transfer utilities (rclone, FTP clients), check for cloud storage client execution, timeline when data staging and transfer occurred.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinginternal/tools/skills/data/digital-forensics/analyzing-prefetch-files-for-execution-history/SKILL.md
Popularity
- Repository stars
- 1,153
- Repository forks
- 212
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/xalgorix/xalgorix/analyzing-prefetch-files-for-execution-history)