Prefetch files are one of the most valuable artifacts in Windows forensics. They provide evidence of program execution, including timestamps, run counts, and referenced files.
What is Prefetch?
Prefetch is a performance optimization feature that monitors application loading patterns. Every time an executable runs, Windows creates (or updates) a .pf file in C:\Windows\Prefetch\.
File Format
<EXECUTABLE_NAME>-<HASH>.pf
For example:
CMD.EXE-4A81B364.pf
POWERSHELL.EXE-022A1004.pf
The hash is calculated based on the file path and, in some cases, command-line arguments.
What Can We Extract?
| Field | Forensic Value |
|---|---|
| Executable name | What ran |
| Run count | How many times |
| Last execution time | When (up to 8 timestamps since Windows 8; a single one on Windows 7 and earlier) |
| Referenced files/dirs | What it touched |
| Volume information | Where it ran from |
Analysis with PECmd
Eric Zimmerman’s PECmd is the go-to tool for parsing Prefetch files. It is free and is part of the tool set Eric Zimmerman publishes on his website.
The examples point at the C:\Windows\Prefetch of a live system. If you work from a forensic image or a triage, use the path of the Prefetch folder you extracted instead: PECmd reads the .pf files in any folder.
PECmd.exe -f "C:\Windows\Prefetch\CMD.EXE-4A81B364.pf"
Or process the entire Prefetch directory:
PECmd.exe -d "C:\Windows\Prefetch" --csv "C:\output" --csvf prefetch_results.csv
Key Investigative Questions
- Was a specific tool executed? Check for its
.pffile. - When was it last run? Look at the last 8 execution timestamps.
- What files did it access? The referenced files list can reveal lateral movement, data staging, or exfiltration paths.
- Was it run from a USB? Volume serial numbers in the Prefetch data can indicate removable media.
Limitations
- On Windows 10/11 Prefetch stays enabled on SSDs too. In some earlier Windows versions it was disabled by default when the disk was an SSD.
- Maximum of 1024 Prefetch files since Windows 8 (128 on Windows 7 and earlier). Once the limit is reached, older ones get deleted.
- Only available on Windows client editions (not Server by default).
- Timestamps can be manipulated via timestomping, but the Prefetch metadata itself is harder to forge.
Quick Reference
- Location:
C:\Windows\Prefetch\ - Tools: PECmd, WinPrefetchView, Autopsy
- Registry key to check status:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParametersEnablePrefetcher = 3→ Enabled for both applications and boot
Prefetch files are your first stop when answering the fundamental forensic question: “Did this program run on this system?”
$ comments