Windows Prefetch

Windows Prefetch (.pf) is a critical artifact for establishing proof of execution. Initially introduced to speed up the boot process and application launch times, it serves as a persistent log of recent application activity. By monitoring the page faults that occur during an application's startup, the Memory Manager creates a trace file that maps the code and data loaded from disk. We use this mechanism to definitively prove that a specific binary executed on the system.

Imagine you go to a restaurant every Tuesday and order the same meal. After a few weeks, the waiter sees you walking in and tells the kitchen to start cooking your food before you even sit down. This makes your service much faster. Prefetch is that waiter. It remembers what programs you use and "pre-loads" the necessary files into memory so they start up instantly next time.

General

Prefetch files are generated by the Windows Memory Manager and stored in the C:\Windows\Prefetch directory. The system limits the number of files available depending on the OS version resulting in files rolling over once limits are reached. A Prefetch file contains a header followed by several data sections and compresses this data using the XPRESS Huffman algorithm starting in Windows 10. The filename format dictates that an 8-character hex hash is appended to the executable name to differentiate applications with the same name located in different paths.

Traces

Parsing a Prefetch file reveals an extensive timeline and mapping of how a program behaves during startup. Here are the core data points we extract:

Forensic Value

We leverage Prefetch files to prove malicious activity and reconstruct adversary timelines:

For more Info check out these Articles: Execution, AmCache