Skip to main content
Windows Forensics: Registry, Prefetch, Amcache & $MFT
Lesson 7 of 20

Windows Forensics: Registry, Prefetch, Amcache & $MFT

Correlate Windows Registry hives, Prefetch files, Amcache entries, and the NTFS Master File Table ($MFT) to prove program execution, persistence, and timestamp tampering.

Advanced 32 min Forensics & IR

Learning objectives

  • Identify which Windows Registry hives store system configuration, persistence entries, and per-user execution history
  • Extract run counts, last-execution timestamps, and SHA-1 hashes from Prefetch and Amcache artifacts
  • Detect timestamp manipulation by comparing $STANDARD_INFORMATION and $FILE_NAME attributes in the $MFT
  • Correlate multiple host artifacts into a defensible execution and persistence timeline using Eric Zimmerman Tools and RegRipper

Recommended first: Disk & Deleted-File Forensics with Autopsy & Sleuth KitBrowser Artifacts (SQLite/Cache) & Super-Timeline Analysis

#Why this matters

During an incident on Windows 10, Windows 11, or Windows Server 2019/2022, an intruder often deletes dropped binaries and clears standard event logs before defenders arrive. Even when the executable is gone, Windows leaves behind overlapping operational records designed for caching, compatibility, and filesystem accounting.

No single artifact tells the full story on its own. An analyst builds high-confidence findings by linking persistence in the Registry, execution traces in Prefetch and Amcache, and file creation proof inside the NTFS Master File Table ($MFT).

  1. RegistryPersistence and user activity
  2. PrefetchRun count and 8 timestamps
  3. AmcacheBinary path and SHA-1 hash
  4. $MFTFile birth and timestomping checks

#Windows Registry hives and persistence

The Windows Registry is split across binary hive files rather than one monolithic file. System-wide hives live in C:\Windows\System32\config\, while user-specific hives live inside each user profile directory.

Hive file Typical location Primary forensic value
SYSTEM C:\Windows\System32\config\ Services, USB devices, timezone, CurrentControlSet
SOFTWARE C:\Windows\System32\config\ Installed software, Run keys, OS build info
SAM C:\Windows\System32\config\ Local user accounts, RIDs, last logon times
NTUSER.DAT C:\Users\<user>\ User Run keys, UserAssist, typed paths, MRUs
UsrClass.dat C:\Users\<user>\AppData\Local\Microsoft\Windows\ Shellbags showing folder access history

When acquiring hives from a live or mounted disk, always collect the matching .LOG1 and .LOG2 transaction logs alongside the main hive file. Unflushed changes from recent activity often sit in the transaction logs rather than the base hive, so tools like RECmd (part of Eric Zimmerman Tools) replay those logs before parsing.

Common persistence and execution locations inside these hives include:

  • Run and RunOnce keys: SOFTWARE\Microsoft\Windows\CurrentVersion\Run and the matching path in NTUSER.DAT launch commands at user logon.
  • Windows Services: SYSTEM\CurrentControlSet\Services\<ServiceName> records the ImagePath binary, start type, and last-write timestamp of the service key.
  • UserAssist: Under NTUSER.DAT, ROT13-encoded entries track GUI applications launched via Windows Explorer along with run count and focus time.
  • BAM / DAM: Located under SYSTEM\CurrentControlSet\Services\bam\State\UserSettings, Background Activity Moderator records recent executable paths and last execution times per user SID.
Inspecting a SYSTEM hive with RegRipper on a forensic workstation
$ rip.exe -r /cases/host01/SYSTEM -p services | grep -A 4 "SvcUpdate"
SvcUpdate  [Tue Oct 14 02:18:44 2025 (UTC)]
  DisplayName: System Update Helper
  ImagePath  : C:\ProgramData\cache\updhost.exe
  Start      : 2 (Auto)

Notice the key last-write timestamp (02:18:44 UTC) and non-standard ImagePath inside C:\ProgramData\. Every Registry key stores a single last-write timestamp, which often pins down the exact moment a persistence entry was created or modified.

#Execution evidence: Prefetch and Amcache

Prefetch speeds up application startup by preloading code pages into memory. On Windows 10 and 11 workstations, Prefetch is enabled by default and stores .pf files in C:\Windows\Prefetch\, named <EXECUTABLE>-<HASH>.pf where the hash reflects the full execution path.

Each .pf file holds high-value execution metadata:

  • The executable name and full path hash.
  • The total run count.
  • Up to the last 8 execution timestamps in UTC.
  • A list of files and directories loaded during the first 10 seconds of startup.

Note that Windows Server editions often have Prefetch disabled by default unless explicitly enabled. When Prefetch is absent, or when an attacker deletes .pf files, Amcache.hve provides a critical second witness.

Located at C:\Windows\AppCompat\Programs\Amcache.hve, Amcache is a Registry-formatted hive used by the Application Experience service. Unlike Prefetch, it survives deletion of the original binary and records the SHA-1 hash, file size, publisher metadata, and key first-seen timestamp under InventoryApplicationFile entries.

Parsing Prefetch files with PECmd
$ PECmd.exe -d C:\cases\host01\Prefetch --csv C:\cases\host01\out
PECmd version 1.5.0.0
...
Executable name: UPDHOST.EXE
Run count: 3
Last run: 2025-10-14 02:19:05
Other run times: 2025-10-14 02:18:51, 2025-10-14 02:18:45

Because Prefetch records up to eight timestamps per executable path, PECmd confirms not only that updhost.exe ran, but also that it executed three times right after the SvcUpdate service key was written.

#Filesystem proof with $MFT and $UsnJrnl

Every file and directory on an NTFS volume has at least one 1024-byte record in the $MFT file at the root of the volume. Two timestamp-bearing attributes inside an $MFT record matter most to investigators:

  • $STANDARD_INFORMATION ($SI): Updated by standard Windows file APIs and easily altered by user-mode tools or SetFileTime calls.
  • $FILE_NAME ($FN): Updated only by the Windows kernel during file creation, rename, or move operations.

Comparing $SI against $FN exposes timestomping, a common defense evasion tactic where an intruder sets a dropped file's $SI Modified and Created times back several years to match legitimate binaries in C:\Windows\System32\. Because standard APIs cannot directly forge $FN creation timestamps, a $SI Created time that is significantly older than $FN Created time strongly indicates tampering.

Checking an exported $MFT CSV for timestamp discrepancies
$ MFTECmd.exe -f C:\cases\host01\$MFT --csv C:\cases\host01\out --csvf mft.csv
$ grep -i "updhost.exe" C:\cases\host01\out\mft.csv | cut -d, -f7,8,9,13,17
EntryNumber,FileName,ParentPath,Created0x10,Created0x30
48192,updhost.exe,.\ProgramData\cache,2021-03-11 08:00:00,2025-10-14 02:17:58

In this output, Created0x10 ($STANDARD_INFORMATION) claims the file was created in 2021, whereas Created0x30 ($FILE_NAME) reveals the true kernel-recorded creation time of 2025-10-14 02:17:58 UTC. When available, $Extend\$UsnJrnl:$J (the NTFS Update Sequence Number journal) complements $MFT by logging sequential FileCreate, DataExtend, and FileDelete events even after the $MFT entry is reused.

#Common mistakes and analyst pitfalls

  • Ignoring Registry transaction logs: Parsing a dirty NTUSER.DAT or SYSTEM hive without .LOG1 and .LOG2 can silently miss the latest persistence keys or BAM entries.
  • Trusting Windows Explorer timestamps: Explorer displays $STANDARD_INFORMATION timestamps. If you skip $MFT parsing and rely only on directory listings, timestomped payloads look years old.
  • Mixing time zones: $MFT, Prefetch, Amcache, and Registry last-write timestamps are stored in UTC, while certain log exports or human notes use local time. Always normalize to UTC before building timelines.
  • Assuming Prefetch exists everywhere: Windows Server hosts frequently disable Prefetch by default (EnablePrefetcher = 0). Fall back to Amcache.hve, Shimcache (AppCompatCache in SYSTEM), and service logs when .pf files are absent.

#Summary

  • Windows Registry hives (SYSTEM, SOFTWARE, SAM, NTUSER.DAT) preserve persistence keys, service definitions, and user-level execution traces; always replay .LOG1/.LOG2 files before analysis.
  • Prefetch (.pf) proves execution count, last eight run times, and loaded files, while Amcache.hve preserves SHA-1 hashes and PE metadata even if the binary was deleted.
  • Comparing $STANDARD_INFORMATION (0x10) against $FILE_NAME (0x30) in the $MFT exposes timestomping and anchors file creation in UTC.
  • Combining Registry, Prefetch, Amcache, and $MFT prevents blind spots when an attacker deletes payloads or alters timestamps.

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge