Amcache and ShimCache are two of the most quoted Windows "evidence of execution" artefacts, and both are routinely over-read: neither is a true execution log, and each answers a narrower question than many reports claim. This guide takes each artefact on its own terms: where it lives, what it records, what its timestamps actually mean, and how far it can carry a finding before you need corroboration from another source.
The guide is written for incident responders, forensic analysts and threat hunters who already know the wider Windows artefact landscape. For the broader map of Prefetch, event logs, registry hives and user artefacts, see the Windows Forensic Artefacts Guide. Here the focus is depth on two artefacts and the wording you can defend in a report.
A note on sources. Microsoft does not publish a forensic specification for either artefact. The facts below come from recognised forensic research: Mandiant's ShimCache research published on the Google Cloud threat intelligence blog, Kaspersky's Securelist analysis of Amcache, SANS, and Magnet Forensics. Where those references disagree, this guide says so rather than picking a side. Validate any behaviour that matters to a case on a test system that matches the build you are examining.
Key takeaways
- ShimCache (the Application Compatibility Cache) lives in the SYSTEM hive and is commonly documented at
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache. It records file paths and the file's last modified time, not an execution time. - ShimCache entries are held in memory and written to the registry when the system shuts down, so a live system's hive may not reflect recent activity.
- ShimCache is ordered as a least recently used list, so entry position and neighbouring entries carry meaning, but the oldest entries roll out.
- Amcache is a separate registry hive file at
C:\Windows\AppCompat\Programs\Amcache.hve. Kaspersky's analysis states plainly that it "is not a true execution log". - Amcache holds a SHA-1 based FileId, but only over the first 31,457,280 bytes of a file, so hash lookups on large files need care.
- Write findings as "present", "recorded by the compatibility subsystem" or "consistent with execution" unless another artefact confirms execution.
Why these two artefacts get confused
Both artefacts belong to the Windows application compatibility machinery, both sit under names containing "AppCompat", and both are parsed by the same family of triage tools. That shared origin leads analysts to treat them as interchangeable, or to treat one as confirmation of the other. They are different data sources with different write triggers, different retention and different fields.
Mandiant's research explains the original purpose of ShimCache: "The Windows Shimcache was created by Microsoft beginning in Windows XP to track compatibility issues with executed programs." Amcache, by contrast, is populated by a set of Application Experience and inventory components. Kaspersky lists the DLLs that write it from %WinDir%\System32: aecache.dll, aeevts.dll, aeinv.dll, aelupsvc.dll, aepdu.dll and aepic.dll. Amcache is an inventory: it describes what the system found and catalogued. ShimCache is a cache: it describes what the compatibility subsystem looked at recently.
The practical consequence is simple. An entry in either artefact proves that Windows saw a file at a path. Whether that file ran, and when, is a separate question that each artefact answers only partially.
ShimCache: location, write timing and structure
SANS describes the artefact plainly: "The AppCache details are stored in the SYSTEM hive." Magnet Forensics gives the full path as HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache, and notes that on Windows XP and Server 2003 the path ends in AppCompatibility instead. When you work from an acquired SYSTEM hive rather than a live registry, remember that CurrentControlSet is a runtime link: resolve the active control set from the hive before reading the value.
Write timing
Magnet states that "the key is written when the system is shutting down" and describes the data as "a snapshot of executables present on the system at the time of its last shutdown or reboot." This matters for collection. If you export the SYSTEM hive from a machine that has been running since the intrusion, the attacker's tooling may be in the in-memory cache but not yet in the registry. Memory acquisition before shutdown, or an orderly reboot after imaging, are the two ways to capture that state. Decide which before you touch the host.
Ordering and rollover
Mandiant describes ShimCache as a "top-down, Least Recently Used (LRU) queue. This means the most recently executed entries are populated at the top of the list." Entries that are reused "bubble up", so a frequently run binary such as LogonUI.exe moves towards the top. The same research observes that proximate entries "indicate which files executed within the same timeframe", which is often the most useful property in an intrusion: a known attacker tool near the top of the list is a pointer to its neighbours.
The cache also rolls. Mandiant notes that "the oldest data is replaced by new entries" and that "the amount of data retained varies by operating system." In its case example, entries from an earlier year had already rolled out by the time of analysis, which led to the advice that the resource "is somewhat volatile and should be preserved as soon as the investigation allows." None of the references fetched for this guide state a definitive entry limit for current Windows builds, so this guide does not give one.
ShimCache: fields and what the timestamp means
Mandiant lists the fields that may be present, depending on the operating system:
| Field | What it is | Caution |
|---|---|---|
| File full path | The path the compatibility subsystem saw | Proves a file existed at that path at some point |
| File size | Size of the file | Shown in Mandiant's Server 2003 example, absent in its Server 2012 example |
| $Standard_Information last modified time | The file system modified time of the file | Not an execution time |
| ShimCache last updated time | Time the cache entry was updated | Not present on all versions |
| Process execution flag | A flag present on some versions | Its "actual name and true purpose" is "still unknown" per Mandiant |
The last modified time
This is the most misread value in Windows forensics. Mandiant is direct: "Because the last modified timestamp reflects the last time that file's contents were changed, it is not indicative of the file execution time." Magnet makes the same point: "the last modified time is not altered by execution." A ShimCache timestamp tells you when the file's content last changed on disk, as recorded in $Standard_Information.
There is one useful exception, and Mandiant's PsExec example illustrates it. When PsExec runs against a remote host it creates PSEXESVC.exe on that host. Because the file is written immediately before it runs, its last modified time is close to its execution time. Mandiant concluded that the last modified time in that case "reflected when it was executed". This works because the tool drops a fresh file each time, not because ShimCache records execution. Apply the same reasoning only to binaries you know were written and run in one action, and say so in your report.
Also note that $Standard_Information timestamps can be altered. Treat a timestamp that conflicts with $FILE_NAME or $UsnJrnl evidence as a possible sign of tampering, which ATT&CK tracks under T1070 Indicator Removal. See the Anti-Forensics Detection Guide for how to test for it.
The execution flag
The references disagree here, and this guide does not resolve the disagreement. Mandiant reports a process execution flag on Vista, Windows 7, Server 2008 and Server 2012, and notes that an entry with the flag set to FALSE may reflect a file the user browsed rather than ran, because those versions can also record files seen through the Application Experience Lookup Service. Magnet states that the flag "was deprecated after Windows XP". Given that conflict and Mandiant's own statement that the flag's purpose is unknown, do not base an execution finding on the flag alone on any version.
What ShimCache can and cannot prove
Mandiant states that "a file is executed. This is recorded on all versions of Windows beginning with XP", but also shows that newer versions record files that were not executed. Magnet summarises the limits: ShimCache "does not provide direct execution timestamps" and "does not always capture actual execution." Combining the two, the defensible statements are:
- Can prove: a file with this path existed on the system and was seen by the compatibility subsystem before the last shutdown at which the cache was written.
- Can suggest: relative order of activity, from LRU position and neighbouring entries.
- Can support: an execution finding made from another artefact, by showing the same path and a consistent file modified time.
- Cannot prove on its own: that the file executed, when it executed, how many times, or which user ran it.
- Cannot prove absence: a missing entry may have rolled out, or may still be in memory on a running system.
Amcache: the hive and its keys
Kaspersky locates the hive at C:\Windows\AppCompat\Programs\Amcache.hve, with companion Amcache.hve.LOG1 and LOG2 transaction logs in the same directory. Collect all three: replaying the transaction logs can recover data not yet committed to the primary file. The hive is in standard REGF registry format, so any registry parser can open it. It was introduced in Windows 7, fully used from Windows 8 onward, and replaced RecentFileCache.bcf.
One point surprises analysts used to version-based parsing: Kaspersky notes that "the AmCache format does not depend on the operating system version" but on the versions of the DLLs that populate it, so two hosts on the same Windows release at different patch levels can differ slightly in structure. Record the build and patch level of every host whose Amcache you parse.
The keys most used in investigations, as described by Kaspersky:
| Key | What it describes | Useful fields |
|---|---|---|
| InventoryApplicationFile | Executables discovered on the system | FileId, LowerCaseLongPath, Name, OriginalFileName, Publisher, Version, BinaryType, ProductName, LinkDate, Size, IsOsComponent |
| InventoryApplication | Formally installed software | InstallDate, MsiInstallDate, UninstallString, Publisher, ManifestPath, plus LastScanTime |
| InventoryDriverBinary | Kernel-mode drivers | FileId, LowerCaseLongPath, DigitalSignature, LastModified |
| InventoryApplicationDriver | Drivers installed by specific applications | DriverServiceName, ProgramIds |
| InventoryApplicationShortcut | Shortcut (.lnk) files | ShortcutPath, ShortcutTargetPath, ShortcutProgramId |
Magnet's comparison describes an older layout under Root\File\{Volume GUID} and says the last write time of a key there corresponds to first execution. The Kaspersky analysis does not describe that layout. If you meet it on an older host, test the claim against a known execution on a matching build before relying on it.
Amcache: hashes, timestamps and their traps
The FileId hash
Kaspersky explains that FileId is the file's SHA-1 hash with "four zeroes appended to the beginning of the hash." Strip the leading zeroes before searching threat intelligence. More importantly, the hash covers only the first 31,457,280 bytes (about 31 MB) of the file, while the Size field records the full size. For any file larger than that, the FileId will not match a full-file SHA-1 from a sandbox or intelligence feed. Check Size before declaring a hash match or a non-match.
The hash is still one of the most valuable things Amcache offers. It can identify a binary that has since been deleted, renamed or overwritten, and it allows a fleet-wide search for the same file under different names.
Timestamps
- LinkDate is the compile timestamp from the PE header. It describes the binary, not the host, and can be set by whoever built the file.
- LastModified in InventoryDriverBinary is the file system modification time of the driver.
- InstallDate and MsiInstallDate record when the operating system recognised the application and when an MSI package was applied.
- LastScanTime records when the Microsoft Compatibility Appraiser last ran. Software installed after that run may not yet appear.
None of these is an execution timestamp. LastScanTime is the most useful for bounding: it tells you that the inventory reflects the system as of that scan, which helps explain why a recently dropped tool is missing.
What Amcache can and cannot prove
Kaspersky's analysis is the clearest statement available: "Amcache.hve is not a true execution log." It grades each key:
| Key | Indicates execution? | Reasoning |
|---|---|---|
| InventoryApplicationFile | Possibly | Presence suggests execution but needs corroboration |
| InventoryApplication | No | Records installation, not necessarily execution |
| InventoryDriverBinary | Yes | The driver was loaded |
| InventoryApplicationShortcut | Possibly | Needs corroboration |
Kaspersky adds that only GUI applications that needed compatibility shimming reliably indicate execution, and that other entries mainly confirm presence. Magnet calls Amcache "a more reliable indicator of execution" than ShimCache. Both can be true: Amcache gives you more identifying data about a file, but presence in an inventory is still not a record of a process starting.
The driver key deserves attention in intrusions involving vulnerable or malicious drivers. An InventoryDriverBinary entry with a FileId, a path and a DigitalSignature value gives you a loaded driver to compare against known vulnerable driver lists, and the signature field helps separate a legitimate vendor driver from an unsigned implant.
On tampering, Kaspersky reports that no method was known, at the time of its research, to modify or remove Amcache data. Treat that as a statement about that research rather than a guarantee, and still record hive hashes at collection.
Correlating the two with other evidence
The strongest findings come from agreement between independent sources. A practical sequence for a suspected attacker binary:
- Find the path in ShimCache and note its LRU position and neighbours.
- Find the same path in Amcache InventoryApplicationFile. Record FileId, Size, Publisher, OriginalFileName and LinkDate.
- Compare the ShimCache last modified time with the file's $Standard_Information and $FILE_NAME times in the MFT, and with $UsnJrnl create and rename records.
- Look for an artefact that records process start: Prefetch where enabled, Security event logging of process creation where audited, or EDR telemetry.
- For remote service execution such as PsExec, mapped in ATT&CK as T1569.002 Service Execution, add the System event log service installation record and network logon evidence.
- Place every timestamp in one timeline with its source and meaning stated. The Forensic Timeline Analysis Guide covers building and presenting it.
If steps 1 and 2 agree but step 4 finds nothing, the honest wording is that the file was present and catalogued, and that execution is likely but not confirmed. That wording survives challenge. "The attacker executed the tool at 14:02" based on a ShimCache timestamp does not.
Collection and parsing at scale
Collect the SYSTEM hive with its transaction logs, and Amcache.hve with its LOG1 and LOG2 files, from every host in scope. Kaspersky names Aralez, Velociraptor and KAPE as collection options, Registry Explorer for viewing, and its own AmCache-EvilHunter parser, which supports date filtering, searching, CSV and JSON output, and filters for missing publishers and non-OS components. SANS describes processing ShimCache at scale with RegRipper's appcompatcache_tln plugin, modified to add a hostname to each line so that results from many hosts can be merged. For the Eric Zimmerman tool set used by many teams, see the EZ Tools Guide.
At fleet scale, both artefacts are best used for stacking: count how many hosts have each path or FileId, then look hard at the rare ones. A binary under a user profile or ProgramData path seen on two hosts out of five thousand is a better lead than any single timestamp.
Hash every collected hive at acquisition, keep originals read only, and work from copies. Record the tool and version that produced each parsed output, because parser behaviour differs across Windows builds. These are standard expectations in NIST SP 800-86.
Common failure patterns
- Reporting the ShimCache last modified time as the execution time.
- Exporting the SYSTEM hive from a running host and concluding that a tool never ran because it is not in the cache.
- Treating the ShimCache execution flag as proof on any Windows version.
- Searching intelligence feeds with the Amcache FileId including its leading zeroes, or treating a non-match on a large file as proof the file is benign.
- Reading InventoryApplication InstallDate as the date a tool was used.
- Collecting Amcache.hve without its transaction logs.
- Parsing hives from mixed Windows builds with one tool configuration and no record of version.
- Using absence from either artefact as evidence that a file was never present.
Practitioner checklist
- Decide on memory capture or orderly reboot before collecting ShimCache from a running host.
- Collect SYSTEM and Amcache.hve with all transaction logs, and hash them at acquisition.
- Resolve the active control set before reading AppCompatCache from an offline hive.
- Record Windows build and patch level for every host parsed.
- Note LRU position and neighbouring entries for every ShimCache hit.
- Strip leading zeroes from FileId and check Size against the 31,457,280 byte hashing limit.
- Use LastScanTime to explain gaps in Amcache inventory.
- Corroborate every execution claim with a process start artefact, and word findings to match the evidence.
- Stack paths and FileIds across the fleet and prioritise rare entries.
Standards and references
- Mandiant (Google Cloud): Caching Out, the value of Shimcache for investigators
- Kaspersky Securelist: Amcache forensic artefact analysis
- SANS: Mass Triage Part 4, processing AppCache and ShimCache
- Magnet Forensics: ShimCache vs AmCache
- NIST: SP 800-86 Guide to Integrating Forensic Techniques into Incident Response
- MITRE ATT&CK: T1070 Indicator Removal
- MITRE ATT&CK: T1569.002 Service Execution
Related NHI Mgmt Group resources: Windows Forensic Artefacts Guide · Forensic Timeline Analysis Guide · EZ Tools Guide · Anti-Forensics Detection Guide