Every time Windows shuts down, it writes the Application Compatibility Cache — commonly called Shimcache — to the SYSTEM registry hive. This artifact records metadata about executables the operating system evaluated for compatibility shims, and its entries persist even after the original files are deleted from disk. For investigators, Shimcache is often the only proof that a specific tool ever existed on the system.
What Is Shimcache?
The Application Compatibility Cache, known in the forensic community as Shimcache or AppCompatCache, is a Windows subsystem that records metadata about executable files the operating system evaluates for application compatibility. When an executable is accessed (opened, executed, or in some cases merely traversed during directory enumeration), Windows checks it against the Application Compatibility Database (sysmain.sdb) to determine if any compatibility shims — small patches that modify API behavior — need to be applied. The cache stores the results of these lookups to avoid repeated disk reads on subsequent accesses.
The cache is maintained in memory during system operation and flushed to the SYSTEM registry hive only during an orderly shutdown. This means the on-disk version of Shimcache represents the state of the cache at the last clean shutdown. If a system crashes or loses power unexpectedly, the most recent entries will be lost. Conversely, entries from weeks or months ago may persist if the system has not been rebooted frequently, because older entries are only evicted when the cache reaches its maximum capacity of approximately 1,024 entries.
The forensic value of Shimcache lies in its ability to prove that a specific file, at a specific path, with a specific last-modified timestamp, existed on the system at some point. Even if the file has been securely deleted, even if Prefetch has been cleared, even if the MFT entry has been overwritten — the Shimcache entry persists in the registry until it is pushed out by newer entries or the registry hive is tampered with.
Shimcache proves a file existed on the system — not necessarily that it executed. On Windows 8 and later, the execution flag was removed. The presence of an entry means the OS evaluated the file for compatibility, which occurs on file access, directory traversal, or execution. Only on Windows 7 and earlier does the InsertFlag reliably indicate execution.
Location & Format
Registry Path
| Property | Detail |
|---|---|
| Hive | SYSTEM — C:\Windows\System32\config\SYSTEM |
| Key path | ControlSet00X\Control\Session Manager\AppCompatCache |
| Value name | AppCompatCache |
| Value type | REG_BINARY |
| Max entries | ~1,024 (varies by OS version) |
| Write trigger | Orderly shutdown only |
Binary Format by OS Version
The binary structure of the AppCompatCache value has changed across every major Windows release. Each version uses a different header signature, entry size, and field layout. Parsing tools must identify the OS version from the header magic bytes before interpreting the data.
| OS Version | Header Signature | Entry Fields | Execution Flag | Max Entries |
|---|---|---|---|---|
| Windows XP (32-bit) | 0xDEADBEEF | Path (MAX_PATH), Last Modified, File Size | Yes (reliable) | 96 |
| Windows Vista / Server 2003 | 0xBADC0FEE | Path (variable), Last Modified, File Size | Yes (InsertFlag) | 512 |
| Windows 7 / Server 2008 R2 | 0xBADC0FFE | Path (variable), Last Modified, File Size, InsertFlag | Yes (InsertFlag bit) | 1,024 |
| Windows 8 / 8.1 | 0x00000080 | Path (variable), Last Modified | No — removed | 1,024 |
| Windows 10 / 11 | 0x00000034 | Path (variable), Last Modified | No — removed | ~1,024 |
On Windows 7, the InsertFlag field indicates whether the executable was actually run (flag = 1) or merely evaluated (flag = 0). On Windows 8 and later, this field no longer exists. The presence of a Shimcache entry on Windows 10/11 means the file was accessed, not necessarily executed. Do not testify that Shimcache proves execution on Windows 8+ systems.
What It Reveals
Shimcache entries contain a limited but highly valuable set of metadata about each file the operating system evaluated. The following investigative questions are directly answerable from Shimcache data:
- Did a specific file ever exist at a specific path? — The full file path is recorded, including the drive letter, directory structure, and filename. This proves placement even after deletion.
- What was the file’s last modification timestamp? — The
$STANDARD_INFORMATIONlast-modified time is captured at the moment of cache insertion. This is the timestamp from the NTFS metadata, not the Shimcache insertion time. - Was the file executed (Windows 7 only)? — The
InsertFlagbit on Windows 7 and earlier distinguishes between files that were merely evaluated and files that were actually launched. - What is the approximate order of file access? — Shimcache entries are ordered: the most recently accessed file is at the top (position 0), and older entries are pushed down. Position in the cache provides relative temporal ordering.
- Were tools staged in suspicious directories? — Paths like
C:\Users\Public\,C:\ProgramData\,C:\Windows\Temp\, orC:\Perflogs\for unexpected executables are immediately suspicious. - Were files renamed to masquerade as legitimate tools? — An entry for
C:\Windows\System32\svchost.exewith a last-modified timestamp that does not match the legitimate OS file suggests binary replacement or masquerading (T1036).
Because Shimcache is an ordered list, the position of each entry relative to others establishes a temporal sequence. If mimikatz.exe appears at position 12 and procdump.exe appears at position 15, then mimikatz was accessed more recently than procdump. Combined with the last-modified timestamps, investigators can reconstruct the approximate sequence of tool deployment without relying on file system timestamps.
Forensic Use Cases
1. Proving Deleted Malware Existed
An attacker deploys a credential harvesting tool to C:\Windows\Temp\svc_update.exe, uses it to dump LSASS, then deletes the binary and clears Prefetch. The MFT entry is overwritten by subsequent file operations. However, Shimcache retains the full path and the file’s last-modified timestamp. The investigator can prove the file existed, determine approximately when it was placed relative to other executables, and correlate the last-modified time with known malware build timestamps from threat intelligence feeds.
2. Lateral Movement Reconstruction
During a network intrusion, the attacker uses PsExec to execute tools on remote hosts. Each target machine’s Shimcache records the PsExec service binary (PSEXESVC.exe) along with whatever payload was deployed. By collecting Shimcache from every endpoint and comparing entry positions, the investigator can reconstruct the order in which machines were compromised and identify the lateral movement path through the network.
3. Insider Threat Tool Usage
A departing employee brings a USB drive containing data collection utilities. They run robocopy.exe with specific flags to copy proprietary data, then remove the USB and delete any evidence of the tool. Shimcache records the path E:\Tools\robocopy.exe (or the path it was copied to locally), proving the tool was present on the system even though the USB is no longer connected and the file no longer exists on any local drive.
4. Timestomping Detection
Shimcache records the $STANDARD_INFORMATION last-modified timestamp at the time of cache insertion. If an attacker timestomps a binary after it has been cached, the Shimcache entry retains the original timestamp. Comparing the Shimcache timestamp against the current $SI timestamps in the MFT can reveal timestomping activity — a discrepancy between the two is strong evidence of anti-forensics (T1070.006).
5. Validating Timeline Gaps
When other artifacts (Prefetch, Event Logs, USN Journal) have gaps due to retention limits or cleanup, Shimcache can fill in the blanks. Because it retains up to 1,024 entries and is only flushed on shutdown, a system that reboots infrequently may have Shimcache entries spanning weeks or months — far beyond the typical 128-entry Prefetch limit or the 7-day default Event Log retention.
Acquisition Methods
On a live system, the in-memory Shimcache contains the most current entries but the on-disk registry hive reflects the state at last shutdown. For the freshest data, use tools that read the in-memory cache directly (e.g., Volatility’s shimcachemem plugin). For standard triage, extract the SYSTEM hive via Volume Shadow Copy or forensic imaging.
Live System — Registry Export
:: Export the SYSTEM hive using reg.exe (requires elevation) reg save HKLM\SYSTEM C:\Evidence\SYSTEM_hive /y :: Alternative: Use KAPE for targeted collection kape.exe --tsource C: --tdest C:\Evidence\KAPE_Output --target RegistryHives :: Alternative: Volume Shadow Copy for locked hive access vssadmin create shadow /for=C: copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3\Windows\System32\config\SYSTEM C:\Evidence\SYSTEM
Live System — Memory-Based Collection
# Volatility 3: Extract Shimcache from memory image # This captures the LIVE in-memory cache, not the stale on-disk version vol -f memory.raw windows.shimcachemem # Velociraptor: Remote live collection via VQL # Artifact: Windows.Registry.AppCompatCache # This parses the registry directly from the live system
Forensic Image — Direct Extraction
# Mount the forensic image read-only mount -o ro,noexec,nodev /dev/sdb1 /mnt/evidence # Copy the SYSTEM hive cp /mnt/evidence/Windows/System32/config/SYSTEM /analysis/shimcache/ # Also collect transaction logs for dirty-hive recovery cp /mnt/evidence/Windows/System32/config/SYSTEM.LOG* /analysis/shimcache/
Parsing Tools & Analysis
| Tool | Author | License | Output | Notes |
|---|---|---|---|---|
| AppCompatCacheParser | Eric Zimmerman | Free | CSV | Industry standard; handles all OS versions; part of EZ Tools suite |
| ShimCacheParser.py | Mandiant (Andrew Davis) | Open source | CSV / timeline | Original research tool from the “Caching Out the Val” whitepaper |
| RegRipper | Harlan Carvey | Open source (Perl) | Text | appcompatcache plugin; lightweight, fast parsing |
| Registry Explorer | Eric Zimmerman | Free | GUI + export | Visual inspection of raw binary value; hex view with field overlay |
| Volatility shimcachemem | Volatility Foundation | Open source | Text / CSV | Parses in-memory cache from RAM dump; captures entries not yet flushed to disk |
| Velociraptor | Rapid7 | Open source | JSON / CSV | Windows.Registry.AppCompatCache artifact; scalable remote collection |
Parsing with AppCompatCacheParser
:: Parse Shimcache from an offline SYSTEM hive AppCompatCacheParser.exe -f C:\Evidence\SYSTEM --csv C:\Analysis\Shimcache_Output :: Output columns: ControlSet, CacheEntryPosition, Path, :: LastModifiedTimeUTC, Executed (Win7 only), Duplicate :: Parse with specific ControlSet AppCompatCacheParser.exe -f C:\Evidence\SYSTEM --csv C:\Analysis\ -t --cs 1
Parsing with ShimCacheParser.py (Mandiant)
# Clone the Mandiant ShimCacheParser repository git clone https://github.com/mandiant/ShimCacheParser.git # Parse a SYSTEM hive python ShimCacheParser.py -i /analysis/shimcache/SYSTEM -o /analysis/shimcache/output.csv # Output in bodyfile format for timeline integration python ShimCacheParser.py -i /analysis/shimcache/SYSTEM -t -o /analysis/shimcache/bodyfile.txt
Analysis Script — Suspicious Path Detection
# Identify executables in suspicious staging directories import pandas as pd df = pd.read_csv('/analysis/shimcache/AppCompatCache.csv') # Define suspicious path patterns suspicious_paths = [ r'\\Windows\\Temp\\', r'\\ProgramData\\', r'\\Users\\Public\\', r'\\Perflogs\\', r'\\Recycle', r'\\AppData\\Local\\Temp\\', ] import re pattern = '|'.join(suspicious_paths) hits = df[df['Path'].str.contains(pattern, case=False, regex=True)] print(f"Suspicious entries: {len(hits)}") print(hits[['CacheEntryPosition', 'Path', 'LastModifiedTimeUTC']].to_string())
Sample Output
Suspicious entries: 4
CacheEntryPosition Path LastModifiedTimeUTC
3 C:\Windows\Temp\svc_update.exe 2026-02-14 03:22:18
7 C:\ProgramData\Microsoft\Crypto\RSA\beacon.exe 2026-02-13 22:15:41
12 C:\Users\Public\Documents\mimikatz.exe 2026-02-13 18:30:02
45 C:\Perflogs\procdump64.exe 2026-01-28 11:44:19
Entry position 3 (most recent) shows svc_update.exe in Windows\Temp — a common attacker staging directory. Position 7 shows a beacon in the RSA crypto directory — an unusual location designed to blend in with legitimate Windows paths. Position 12 shows mimikatz in the Public Documents folder, and position 45 shows procdump deployed weeks earlier. The position ordering reveals the chronological sequence of tool deployment across the intrusion.
Retention & Persistence
| Property | Windows 7 | Windows 8 / 8.1 | Windows 10 / 11 |
|---|---|---|---|
| Maximum entries | 1,024 | 1,024 | ~1,024 |
| Write trigger | Orderly shutdown only | Orderly shutdown only | Orderly shutdown only |
| Survives reboot | Yes — persists in registry hive | Yes — persists in registry hive | Yes — persists in registry hive |
| Survives file deletion | Yes — entries reference path, not file | Yes — entries reference path, not file | Yes — entries reference path, not file |
| Execution flag | Yes (InsertFlag) | No — removed | No — removed |
| Eviction policy | FIFO — oldest entries removed when capacity reached | FIFO | FIFO |
| Crash behavior | In-memory entries lost; disk retains last shutdown state | Same | Same |
A system that shuts down infrequently may retain Shimcache entries spanning months. A server that reboots nightly and runs hundreds of executables during each session may retain only 1–2 days of history. The effective retention window is entirely dependent on system activity volume and reboot frequency. Always check the total entry count and the last-modified times of the oldest entries to establish the actual coverage window.
Anti-Forensics Resilience
Shimcache is stored within the SYSTEM registry hive — a critical operating system file that is locked and protected during normal operation. This makes it resistant to most standard cleanup operations, though not immune to deliberate registry manipulation.
| Tool / Technique | Clears Shimcache? | Explanation |
|---|---|---|
| CCleaner | No | Does not target SYSTEM hive registry values |
| Eraser | No | Targets user-specified files; does not modify registry binary values |
| SDelete | No | Securely deletes files; has no registry manipulation capability |
| BleachBit | No | No module targets AppCompatCache registry value |
| Prefetch cleanup | No | Prefetch and Shimcache are independent subsystems |
| Event Log clearing | No | Event Logs and Shimcache are unrelated artifacts |
| Timestomping | No | Shimcache records the timestamp at insertion time; post-insertion timestomping does not update the cache |
| Registry Editor (regedit) | Possible | Manually deleting or zeroing the AppCompatCache value is possible but detectable via registry transaction logs |
| Crash/power loss | Partial | In-memory entries since last shutdown are lost; disk entries from prior shutdown survive |
The AppCompatCache value is a single binary blob inside the SYSTEM registry hive. Standard anti-forensics tools do not target it because it is not a file on disk — it is a binary value within a locked, system-critical registry hive. An attacker would need to either modify the live registry (detectable via Security Event Log 4657) or offline-edit the SYSTEM hive (detectable via hive transaction log analysis). In practice, fewer than 5% of threat actors in Mjolnir case history have attempted Shimcache tampering.
MITRE ATT&CK Detection Mapping
Shimcache data provides evidentiary support for detecting the following MITRE ATT&CK techniques:
| Technique | Name | Shimcache Evidence |
|---|---|---|
T1059 T1059 | Command and Scripting Interpreter | Entries for cmd.exe, powershell.exe, wscript.exe in unusual contexts or from unexpected paths (e.g., copied to staging directories) |
T1036 T1036 | Masquerading | Executables with legitimate names (svchost.exe, explorer.exe) at non-standard paths, or with last-modified timestamps inconsistent with the genuine OS binary |
T1070.004 T1070.004 | Indicator Removal: File Deletion | Shimcache entry for a file that no longer exists on disk is direct evidence of post-exploitation cleanup |
Related Artifacts & Cross-Correlation
Corroborating Artifacts
| Artifact | Relationship to Shimcache | Cross-Correlation Value |
|---|---|---|
| Amcache.hve | Records SHA-1 hash, publisher, compile time | Amcache provides the file hash that Shimcache lacks; together they prove both existence and identity |
| Prefetch | Records execution count, last 8 run times, DLLs loaded | Prefetch confirms execution; Shimcache proves file placement even after Prefetch is cleared |
| UserAssist | Records GUI application launches with run count and focus time | UserAssist confirms interactive use; Shimcache captures non-GUI executables that UserAssist misses |
| BAM/DAM | Records execution timestamps for background apps | BAM provides precise execution timestamps that Shimcache cannot; Shimcache survives reboots that BAM may not |
| $MFT | File system metadata including creation and modification times | MFT provides file size and timestamps for files still on disk; Shimcache persists after MFT entry reuse |
| SRUM.db | Network transfer data per application | SRUM shows what a tool did on the network; Shimcache proves the tool existed even after SRUM entries age out |
References
- Andrew Davis (Mandiant), “Caching Out the Val — Leveraging the Application Compatibility Cache in Forensic Investigations” — https://www.mandiant.com/resources/blog/caching-out-the-val
- Eric Zimmerman, “AppCompatCacheParser” — https://ericzimmerman.github.io/
- SANS Institute, “Application Compatibility Cache (ShimCache) Forensics” — https://www.sans.org/blog/
- Harlan Carvey, “RegRipper — Windows Registry Forensics” — https://github.com/keydet89/RegRipper3.0
- 13Cubed, “Shimcache Analysis for DFIR” — https://www.13cubed.com/blog
- Microsoft, “Application Compatibility Infrastructure” — https://learn.microsoft.com
- Volatility Foundation, “shimcachemem Plugin” — https://github.com/volatilityfoundation/volatility3
- ForensicArtifacts.com, “Windows AppCompatCache Definition” — https://github.com/ForensicArtifacts/artifacts
Mjolnir Security — Digital Forensics & Incident Response
Mjolnir Security provides 24/7 incident response, digital forensics, and expert witness testimony. Our DFIR team specializes in Shimcache analysis, timeline reconstruction, and attribution investigations where standard artifacts have been destroyed.
mjolnirsecurity.com — 24/7: +1 833 403 5875