Can Amcache be cleared by attackers?

Yes — but cleanup is detectable. An attacker with administrative rights can delete Amcache.hve, edit specific entries inside it, or disable the Compatibility Appraiser scheduled task. None of these options are silent. Three independent forensic sources usually preserve the prior state:

  1. Volume Shadow Copies — point-in-time snapshots of the volume taken by VSS, typically retained for one to several weeks. Each shadow has its own copy of Amcache.hve.
  2. Registry transaction logsAmcache.hve.LOG1 and Amcache.hve.LOG2 may preserve recent writes that an attacker did not think to delete.
  3. Recreation-time signature — a freshly recreated hive after deletion has a KeyLastWriteTimestamp distribution that starts abruptly at the recreation time, with no entries reaching back months as you would expect on a long-lived host.

How attackers typically try#

Three approaches, in increasing subtlety:

1. Delete the hive and its logs#

# (Attacker action — not for defenders to run)
Remove-Item 'C:\Windows\AppCompat\Programs\Amcache.hve*' -Force

Loud. The next appraiser pass recreates the hive — empty except for whatever happens to be running now. The recreation signature is obvious to any defender who knows to look.

2. Edit specific entries#

The attacker loads the hive (e.g. as a sub-tree of HKLM) and deletes specific InventoryApplicationFile sub-keys corresponding to their tooling.

More subtle, but the registry transaction logs may still hold the original writes, and Volume Shadow Copies hold the pre-tampering hive.

3. Disable the appraiser#

HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection
  AllowTelemetry = REG_DWORD 0

Or disable the scheduled task at \Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser.

The hive is not modified — it just stops updating. A defender who does not check the appraiser's LastRunTime may not notice.

How to detect tampering#

The defender workflow:

  1. Parse the live Amcache.hve and capture the KeyLastWriteTimestamp distribution (earliest, latest, density per week).
  2. Enumerate Volume Shadow Copies and parse each shadow's copy of the hive. Diff against the live hive.
  3. Check the scheduled taskLastRunTime, State, history.
  4. Check the GPOAllowTelemetry, related DataCollection values.

A live hive with a KeyLastWriteTimestamp that stops abruptly some weeks ago, on a host that you know has been running and seeing new software, is suspicious. Diff against shadows to confirm what is missing.

For the full anti-forensics workflow, see Recovering deleted-binary evidence from Amcache.

How common is this?#

Rare. Commodity malware and most APT toolkits do not bother cleaning Amcache. The artefact is not widely known among general malware authors, and effective cleanup requires Windows-internals knowledge most actors do not have.

When you do see signs of Amcache tampering, treat it as a strong signal of a more sophisticated actor — and pay extra attention to neighbouring artefacts (ShimCache, Sysmon, EDR telemetry) for similar tampering.

Related posts

  • Why is my Amcache.hve empty?

    Three common causes: the Compatibility Appraiser is disabled, the host is freshly imaged, or you're collecting from a Server / Server Core where the appraiser runs much less often.

  • Where is the Amcache registry key?

    Amcache is its own hive file at C:\Windows\AppCompat\Programs\Amcache.hve — not a key under HKLM. When loaded by tools or by Windows itself it mounts as HKLM\Amcache.

  • What does Amcache.hve contain?

    Amcache.hve contains inventory records for every PE binary, driver, and connected device the Windows Compatibility Appraiser has seen — with SHA-1 hashes, paths, publishers, and timestamps.

  • What's a .pf file vs an Amcache entry?

    .pf files are Windows Prefetch records — proof a binary executed, with run timestamps and loaded-files lists. Amcache entries record presence, with the SHA-1 hash and metadata.

Back to all posts