Forensic ArtifactWindows: Execution

Shimcache / AppCompatCache

The Application Compatibility Cache records executable metadata for compatibility checking. Entries prove a file existed on the system even if the file has been deleted. Written on shutdown only. ~1024 entries.

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.

Key Insight

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

PropertyDetail
HiveSYSTEMC:\Windows\System32\config\SYSTEM
Key pathControlSet00X\Control\Session Manager\AppCompatCache
Value nameAppCompatCache
Value typeREG_BINARY
Max entries~1,024 (varies by OS version)
Write triggerOrderly 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 VersionHeader SignatureEntry FieldsExecution FlagMax Entries
Windows XP (32-bit)0xDEADBEEFPath (MAX_PATH), Last Modified, File SizeYes (reliable)96
Windows Vista / Server 20030xBADC0FEEPath (variable), Last Modified, File SizeYes (InsertFlag)512
Windows 7 / Server 2008 R20xBADC0FFEPath (variable), Last Modified, File Size, InsertFlagYes (InsertFlag bit)1,024
Windows 8 / 8.10x00000080Path (variable), Last ModifiedNo — removed1,024
Windows 10 / 110x00000034Path (variable), Last ModifiedNo — removed~1,024
Critical Distinction

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:

Entry Position as Timeline

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

Collection Warning

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

CMD / ADMIN
:: 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

BASH / FORENSICS
# 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

BASH / FORENSICS
# 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

ToolAuthorLicenseOutputNotes
AppCompatCacheParserEric ZimmermanFreeCSVIndustry standard; handles all OS versions; part of EZ Tools suite
ShimCacheParser.pyMandiant (Andrew Davis)Open sourceCSV / timelineOriginal research tool from the “Caching Out the Val” whitepaper
RegRipperHarlan CarveyOpen source (Perl)Textappcompatcache plugin; lightweight, fast parsing
Registry ExplorerEric ZimmermanFreeGUI + exportVisual inspection of raw binary value; hex view with field overlay
Volatility shimcachememVolatility FoundationOpen sourceText / CSVParses in-memory cache from RAM dump; captures entries not yet flushed to disk
VelociraptorRapid7Open sourceJSON / CSVWindows.Registry.AppCompatCache artifact; scalable remote collection

Parsing with AppCompatCacheParser

CMD / FORENSICS
:: 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)

BASH / FORENSICS
# 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

PYTHON / SHIMCACHE ANALYSIS
# 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

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
Reading the Output

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

PropertyWindows 7Windows 8 / 8.1Windows 10 / 11
Maximum entries1,0241,024~1,024
Write triggerOrderly shutdown onlyOrderly shutdown onlyOrderly shutdown only
Survives rebootYes — persists in registry hiveYes — persists in registry hiveYes — persists in registry hive
Survives file deletionYes — entries reference path, not fileYes — entries reference path, not fileYes — entries reference path, not file
Execution flagYes (InsertFlag)No — removedNo — removed
Eviction policyFIFO — oldest entries removed when capacity reachedFIFOFIFO
Crash behaviorIn-memory entries lost; disk retains last shutdown stateSameSame
Retention Note

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 / TechniqueClears Shimcache?Explanation
CCleanerNoDoes not target SYSTEM hive registry values
EraserNoTargets user-specified files; does not modify registry binary values
SDeleteNoSecurely deletes files; has no registry manipulation capability
BleachBitNoNo module targets AppCompatCache registry value
Prefetch cleanupNoPrefetch and Shimcache are independent subsystems
Event Log clearingNoEvent Logs and Shimcache are unrelated artifacts
TimestompingNoShimcache records the timestamp at insertion time; post-insertion timestomping does not update the cache
Registry Editor (regedit)PossibleManually deleting or zeroing the AppCompatCache value is possible but detectable via registry transaction logs
Crash/power lossPartialIn-memory entries since last shutdown are lost; disk entries from prior shutdown survive
Why Shimcache Survives

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:

TechniqueNameShimcache Evidence
T1059 T1059Command and Scripting InterpreterEntries for cmd.exe, powershell.exe, wscript.exe in unusual contexts or from unexpected paths (e.g., copied to staging directories)
T1036 T1036MasqueradingExecutables 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.004Indicator Removal: File DeletionShimcache entry for a file that no longer exists on disk is direct evidence of post-exploitation cleanup

Related Artifacts & Cross-Correlation

Corroborating Artifacts

ArtifactRelationship to ShimcacheCross-Correlation Value
Amcache.hveRecords SHA-1 hash, publisher, compile timeAmcache provides the file hash that Shimcache lacks; together they prove both existence and identity
PrefetchRecords execution count, last 8 run times, DLLs loadedPrefetch confirms execution; Shimcache proves file placement even after Prefetch is cleared
UserAssistRecords GUI application launches with run count and focus timeUserAssist confirms interactive use; Shimcache captures non-GUI executables that UserAssist misses
BAM/DAMRecords execution timestamps for background appsBAM provides precise execution timestamps that Shimcache cannot; Shimcache survives reboots that BAM may not
$MFTFile system metadata including creation and modification timesMFT provides file size and timestamps for files still on disk; Shimcache persists after MFT entry reuse
SRUM.dbNetwork transfer data per applicationSRUM shows what a tool did on the network; Shimcache proves the tool existed even after SRUM entries age out

References

  1. 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
  2. Eric Zimmerman, “AppCompatCacheParser” — https://ericzimmerman.github.io/
  3. SANS Institute, “Application Compatibility Cache (ShimCache) Forensics” — https://www.sans.org/blog/
  4. Harlan Carvey, “RegRipper — Windows Registry Forensics” — https://github.com/keydet89/RegRipper3.0
  5. 13Cubed, “Shimcache Analysis for DFIR” — https://www.13cubed.com/blog
  6. Microsoft, “Application Compatibility Infrastructure” — https://learn.microsoft.com
  7. Volatility Foundation, “shimcachemem Plugin” — https://github.com/volatilityfoundation/volatility3
  8. 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.

Digital ForensicsIncident ResponseExpert WitnessArtifact AnalysisTimeline ReconstructionMalware Triage

mjolnirsecurity.com — 24/7: +1 833 403 5875