| name | analyzing-windows-prefetch-with-python |
| description | Parse Windows Prefetch files using the windowsprefetch Python library to reconstruct application execution history, detect renamed or masquerading binaries, and identify suspicious program execution patterns. |
| domain | cybersecurity |
| subdomain | digital-forensics |
| tags | ["digital-forensics","windows","prefetch","execution-history","incident-response","malware-analysis"] |
| mitre_attack | ["T1059","T1204","T1036"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | ["RS.AN-01","RS.AN-03","DE.AE-02","RS.MA-01"] |
Analyzing Windows Prefetch with Python
Overview
Windows Prefetch files (.pf) record application execution data including executable names, run counts, timestamps, loaded DLLs, and accessed directories. This skill covers parsing Prefetch files using the windowsprefetch Python library to reconstruct execution timelines, detect renamed or masquerading binaries by comparing executable names with loaded resources, and identifying suspicious programs that may indicate malware execution or lateral movement.
When to Use
- When investigating security incidents that require analyzing windows prefetch with python
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Detection Gaps & Validation
- Prefetch can be disabled or absent. It is off by default on Windows Server, and
EnablePrefetcher (HKLM\SYSTEM...\Memory Management\PrefetchParameters) may be set to 0 by hardening or by an attacker. No .pf does not mean no execution — confirm the setting before concluding.
- Run-time history is shallow. Windows 8.1/10/11 store only the last 8 execution timestamps; Windows 7 stores one. Earlier runs are lost. The "first executed" estimate is the
.pf creation time minus ~10 seconds, not an exact start.
- Renamed/masquerading binaries: the hash in
EXECUTABLE-HASH.pf is derived from the full path, so the same binary run from two paths yields two different .pf files — and a renamed malware keeps its real loaded-DLL fingerprint. Compare referenced DLLs/directories, not just the name.
- Anti-forensics that defeat this analysis: deletion of
C:\Windows\Prefetch\*.pf, disabling the Prefetcher, and .pf timestomping. Carve deleted .pf (header MAM\x04 / SCCA) from unallocated space and VSS.
- Validate / cross-corroborate: confirm execution against Amcache, ShimCache/AppCompatCache, SRUM
SRUDB.dat (app usage + bytes), and Security.evtx EID 4688. The volume serial in the .pf should match the system under analysis.
- Interpretation false positives: a high run count on
svchost.exe/explorer.exe is normal; flag on , , and , never run count alone.