BLUE-LAB — home

Shimcache: What is it good for?

I’ve been working back through the Windows application execution artefacts, and Shimcache is the one where it’s worth being precise about what you’re actually looking at. It’s a useful artefact. It’s just useful for a narrower thing than people often assume, and what it can tell you changed considerably around Windows 10.

WTF is SHIMCACHE?

The Application Compatibility Cache (Shimcache, AppCompatCache, same thing) isn’t a forensics feature. It exists so Windows can work out whether an application needs compatibility shims to run properly on the current version of the OS.

Shimming is a proxy layer between the application and Windows. Incompatible calls from an older binary get intercepted and alternative code substituted, so the thing keeps working on an OS it was never written for. The cache is Windows’ record of which binaries it has already assessed, so it doesn’t have to work it out again.

Everything we get from it forensically is a side effect of that. Worth holding onto, because it explains most of the artefact’s quirks.

It lives in the SYSTEM hive, which on disk is:

C:\Windows\System32\config\SYSTEM

and within that hive, at:

CurrentControlSet is a runtime pointer to whichever control set is active, so it only exists on a live system. On an offline hive you’ll see ControlSet001, ControlSet002 and so on. Don’t just reach for ControlSet001. Read SYSTEM\Select\Current, which holds the number of the set that was last booted, and use that one. It’s usually 001. Usually isn’t always.

What each entry holds depends on the Windows version. Modern entries (Vista onwards) carry the path and the file’s last-write timestamp plus version-specific flag data. File size is XP and Server 2003 only, part of the old structure and gone from Vista on. You can confirm that in the parser itself: only its WindowsXP handler reads a file size.

On Windows XP the key also sits at …\Session Manager\AppCompatibility\AppCompatCache rather than …\Session Manager\AppCompatCache.

Entries cover executables on local disks, network shares and removable media, which makes the artefact useful for spotting things encountered somewhere other than the machine’s own drive.

Parsing it (where we make it useful)

The value is a binary blob, so you need something that understands the format. Two options, both Eric Zimmerman’s:

Registry Explorer ships a dedicated AppCompatCache plugin, so it will render the key for you if you’re already in the hive. Navigate to the Session Manager\AppCompatCache value and the plugin handles the translation.

AppCompatCacheParser is the better route for bulk work, because it gives you comma-separated values (CSV) you can sort, filter and timeline. Point it at an exported SYSTEM hive:

AppCompatCacheParser.exe -f "C:\Cases\Sample\Export\SYSTEM" --csv "C:\Cases\Sample\Reports" --csvf Example_ACC.csv

The switches:

  • -f = path to the SYSTEM hive
  • --csv = the directory output goes to. Mandatory.
  • --csvf = overrides the default output filename
  • -c = which control set to parse. Default is all of them
  • -t = sort by last modified timestamp, descending
  • --nl = ignore transaction logs for dirty hives. Off by default, and you usually want it off, since the logs may hold entries the hive itself doesn’t

Two practical notes.

Always pass -f. With no hive supplied the tool falls back to the live registry of whatever machine you’re running it on, and hands you a perfectly valid CSV of your own analysis workstation. There is exactly one tell: with no hive, the default filename is built from Environment.MachineName, so your own hostname appears in it. Override the name with --csvf and even that goes away.

Use an absolute path for -f, and quote it. The tool wants a full path, and unquoted arguments containing spaces cause parsing errors.

Left alone, output lands as {timestamp}_{OperatingSystem}_{hive}_AppCompatCache.csv. That operating system (OS) token isn’t decoration. It names the handler the parser selected, and therefore the rule that produced your Executed column. The console reports the same thing as it runs: Found N cache entries for {OperatingSystem} in {ControlSet}. That’s your OS check, and it beats querying the registry of whatever box you happen to be sitting at.

The CSV opens in anything, but Timeline Explorer (also Zimmerman’s) is the better choice here. It sorts by timestamp, handles the wide columns and long paths without a fight, and importantly it’s read-only. Excel will happily let you modify evidence with a misclick and say nothing about it.

If you’re parsing a live system rather than an exported hive, run Command Prompt or PowerShell as Administrator or the hive read will fail.

The fields

FieldWhat it is
ControlSetWhich control set the entry came from
CacheEntryPositionWhere in the cache the entry sits
PathPath of the executable
LastModifiedTimeUTCLast modified timestamp of the file
ExecutedWhether the executable was run
DuplicateEntry is a duplicate from another ControlSet
SourceFileThe hive the entry came from

Two of those need unpacking.

LastModifiedTimeUTC is a file property

It’s the last-modified time of the file on disk, captured at the point the cache entry was written. It describes the file, not the event.

Mandiant, who did the original research on this artefact, put it plainly back in 2015: the timestamp “represents the time the contents of the file (specifically, its $DATA or $INDEX attributes) were last modified”, and “because the last modified timestamp reflects the last time that file’s contents were changed, it is not indicative of the file execution time.”

In practice:

  • A binary whose filesystem last-write time is 2019 can first appear on a host in 2026 and still show 2019 in Shimcache. Note that’s the filesystem timestamp, not the PE header’s compile time, a different field entirely.
  • Whether a copy carries the original timestamp depends on the mechanism. robocopy preserves it by default; other methods may not.
  • It can also be deliberately manipulated, so it shouldn’t be assumed trustworthy.

So it isn’t an execution time and shouldn’t go onto a timeline as one. It will sit there looking perfectly reasonable, which is the difficulty with it.

That said, the fact it doesn’t change turns out to be useful, and I’ll come back to that.

The Executed column depends on your Windows version

This is the part that’s moved, and where the column comes from changes with the Windows version. The clearest way to see it is in AppCompatCacheParser‘s own source, which uses a separate handler class per OS family:

Hive fromHow the Executed column is derived
Windows XPAlways NA. There is no flag to read
Vista, 7, Server 2008InsertFlags bitwise check → Yes / No
Windows 8, 8.1Same InsertFlags check → Yes / No
Windows 10, 11, Server 2016+Last four bytes of the entry’s Data field equal to 1 → Yes / No

That Windows 10 row is newer than most Shimcache material realises. It comes from research published by ØSecurity in August 2024, and Zimmerman only added the check to AppCompatCacheParser in March 2023, a tool that had existed since 2015. So on Windows 10 you’ll get a Yes or a No, not NA, but it’s derived from a byte pattern rather than a field Microsoft set.

The research is candid about how far it goes. A Yes means the binary has “very likely been executed”. A No means very little: testing found lsass.exe, cmd.exe and explorer.exe all reporting No on systems where they had unquestionably run. Other values turned up (02 00, 4C 01, 64 86) whose meaning still isn’t known. The author’s own conclusion is that he “wouldn’t rely on this until more definitive evidence comes forward”.

The pattern holds better for non-native binaries than for system files, but that isn’t a clean rule either. conhost.exe, mmc.exe, msiexec.exe, regsvr32.exe and dwm.exe have all been observed flagging Yes.

Even where the flag is a real field rather than an inference, Mandiant’s original research hedged it: “the actual name and true purpose of this flag is still unknown, however, we have observed that the Client/Server Runtime Subsystem (CSRSS) process will set this flag during process creation/execution on those operating systems.” Observed behaviour, not documented guarantee.

Practically, and this is the phrasing I’d be comfortable putting in a report: on Windows 10, 11 and Server 2016+, treat Executed = Yes as corroborative evidence consistent with execution, not standalone proof. Treat Executed = No as inconclusive: the known false negatives mean it cannot establish that a binary didn’t run.

It’s written at shutdown

This one matters for live response and it’s easy to miss.

The Shimcache registry value is written at shutdown, not continuously as entries are created. Harlan Carvey notes it’s trivial to demonstrate on a timeline.

So if you’re pulling the SYSTEM hive from a running machine, you’re reading whatever was committed at the last clean shutdown. Everything since then is sitting in memory and isn’t in the hive yet. On a box that’s been up for three weeks, that’s three weeks of activity your Shimcache doesn’t know about, including quite possibly the activity you’re investigating.

It also means an ungraceful shutdown can lose the lot.

There is a way round it, though. The cache is held in kernel memory while the system runs, so if you have a memory image of the host you can pull it from there instead — Volatility has a shimcache plugin for exactly this. On a long-uptime box that’s not a nice-to-have, it’s the difference between seeing the incident and missing it.

Separately from all of that, an entry can be created by a file being seen rather than run. This isn’t a Windows 10 novelty: Mandiant documented browsing-creates-entries back in 2015 on Vista, 7, Server 2008 and 2012.

The cleanest demonstration is in the nullsec.us research. 100 copies of a binary were placed in a folder, 19 of them visible in the Explorer window. The 18 visible-but-never-run copies were all cached. The 81 that were never on screen were not.

It’s a graphical user interface (GUI) behaviour specifically. Listing the same directory from the command line doesn’t populate the key, which is a useful distinction. An entry does tell you something about how the file was encountered, just not that it ran.

Those entries sit in the CSV alongside everything that genuinely ran, and nothing in the output separates them.

What it’s good for (absolutely something!)

Quite a lot, given the right question.

Shimcache is evidence that a file with that path was present on the system and that Windows saw it. It survives deletion, so the binary can be long gone while the entry remains.

Three things it does well:

Anomalous paths. Scan the Path column for binaries in places they shouldn’t be: secondary drives (D:\, E:\), Temp, AppData, the Recycle Bin. Odd filenames too: single characters, near-miss spellings of legitimate binaries.

Clusters. Mandiant describe the cache as typically sequential and least-recently-used, most recent at the top, so CacheEntryPosition gives useful relative context. Don’t lean on it too hard. The cache has a fixed capacity and wraps, and entries can be updated in place, so proximity is a hypothesis generator rather than proof of ordering. It still surfaces shapes worth chasing: net.exe, whoami.exe and ipconfig.exe sitting together reads as reconnaissance.

Tracking a binary as it moves. A new entry appears when a file is renamed, moved, or run from a new location. Where the timestamp survived that, the same last-write time turns up against several different paths, which is a useful signal that you’re looking at one binary copied around the estate. Actual modification does change the timestamp, so this works for movement rather than editing. The field that’s no use as an execution time is genuinely useful as a correlation key, though not a unique identifier, so corroborate with hashes, Amcache or $MFT/USN journal data before asserting two entries are the same file.

Confirm any such match against another artefact before relying on it. Identical last-write times are a lead rather than proof.

One limit worth stating plainly: Shimcache carries no user attribution. There’s nothing in an entry that tells you who was logged on, or whose action caused it. If you need to tie activity to a person, that comes from JumpLists, shellbags or the event logs, not from here.

One caveat across all of this: the cache is a registry key like any other, and an attacker with sufficient privilege can modify or clear it. Treat absence of an entry as absence of evidence rather than evidence of absence, and preserve the hive properly so you can show the data hasn’t shifted under you.

Pair it for execution evidence

Shimcache gets you a candidate. Something else confirms it.

ArtefactWhat it adds
PrefetchGenuine execution evidence, with run counts and last-run times. First place to look, though it’s off by default on servers.
AmcacheFile and application inventory with SHA-1 (Secure Hash Algorithm 1) hashes. Excellent for identifying and correlating a binary even once deleted, but treat it as evidence of presence rather than standalone proof of execution.
Event logs4688 process creation, which needs Audit Process Creation enabled. A separate policy, Include command line in process creation events, controls whether the command line is populated. Strongest single source when you have both.
SRUMThe System Resource Usage Monitor: per-application resource and network usage. Worth checking if data movement is the question.

Shimcache showing a path plus Prefetch showing a matching run count is a solid finding. Shimcache alone supports “Windows encountered a file at this path”, and that’s the sentence to write.

Checking what you’ve got

Before reading anything into the Executed column, confirm which OS the hive came from, because that determines which rule produced the column.

The parser has already told you. The operating system appears in the default output filename and in the console line as it runs. That’s the quickest answer and it’s derived from the hive you actually parsed.

If you want to corroborate it, read the target’s exported SOFTWARE hive under Microsoft\Windows NT\CurrentVersion and record ProductName, CurrentBuild and DisplayVersion. Don’t run reg query against HKLM (HKEY_LOCAL_MACHINE) on your own analysis machine: that reports your workstation, not the evidence. And don’t trust ProductName alone: Windows 11 still reports itself as Windows 10 there, so use CurrentBuild (22000 or above means Windows 11).

It’s also worth verifying the timestamp behaviour once on something you can check independently. Take a known binary, compare its Shimcache LastModifiedTimeUTC against the file’s actual last-write time on disk, and watch them match. Seeing it once makes it stick better than reading about it.

Summary

Shimcache answers “did Windows encounter a file at this path?” far more reliably than it answers “did this run?”. It survives deletion and gives you paths, a filesystem timestamp and relative cache position.

On Windows 10, 11 and Server 2016+, Executed = Yes adds corroborative weight in applicable cases but isn’t standalone proof, and Executed = No can’t rule execution out. Correlate with Prefetch and process-creation auditing for execution, Amcache for file identity, and filesystem artefacts for context, before drawing a conclusion either way.

Note the phrasing: encountered a file at this path, not on the system. Paths pointing at network shares or removable media mean exactly what they say.

Amcache next, since it’s the artefact that keeps coming up as the thing to pair this with.


Sources and further reading

Current state of the artefact

Further reading