Communitygithub.com

分析Windows Amcache工件

使用Eric Zimmerman工具解析Windows Amcache.hve注册表配置单元,提取程序执行痕迹、驱动加载历史和恶意软件取证线索。

分析Windows Amcache工件 是什么?

该专业技能指导安全分析师和取证专家如何获取、解析并分析Windows系统的Amcache.hve注册表配置单元。Amcache是Windows应用程序兼容性缓存,记录了系统上存在或执行过的程序、驱动和设备的元数据,包括SHA-1哈希、编译时间戳、文件路径等信息。技能详细说明了从活系统或取证镜像中提取Amcache.hve及关联事务日志(.LOG1、.LOG2)的方法,并使用Eric Zimmerman的AmcacheParser工具生成结构化CSV输出。它涵盖了七步清晰的工作流程:获取配置单元、解析数据、分析可疑文件条目、关联威胁情报(VirusTotal、CIRCL、MISP)、审核已安装程序、检查驱动程序二进制文件(用于检测rootkit和BYOVD攻击),以及结合Prefetch和ShimCache构建完整时间线。该技能支持PowerShell命令自动化,并强调Amcache与Prefetch、ShimCache等工件配合使用,以确认程序执行而非仅仅文件存在。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-windows-amcache-artifacts

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

分析Windows Amcache工件 是做什么的?

使用时机

  • 在事件响应期间,确定哪些程序已在Windows系统上存在或执行过
  • 将Amcache中的SHA-1哈希与已知恶意软件数据库(VirusTotal、CIRCL、MISP)进行关联
  • 为取证调查构建应用程序安装和执行时间线
  • 识别即使在文件删除后仍会在Amcache中留下痕迹的已删除可执行文件
  • 通过记录哪些便携式或未经授权的应用程序存在来调查内部威胁
  • 分析驱动程序加载历史以检测rootkit或恶意内核模块

请勿将其作为程序执行的唯一证据。Amcache证明文件存在和元数据注册,但ShimCache(AppCompatCache)和Prefetch提供更强的执行证据。应结合所有三种工件进行最终分析。

前提条件

  • 取证镜像或实时采集副本:C:\Windows\appcompat\Programs\Amcache.hve(及关联的.LOG1、.LOG2事务日志)
  • 从 https://ericzimmerman.github.io/ 下载的Eric Zimmerman的AmcacheParser(AmcacheParser.exe)
  • Eric Zimmerman的Timeline Explorer用于查看解析后的CSV输出
  • (可选)Registry Explorer用于手动检查配置单元
  • 已知良好可执行文件的SHA-1白名单(例如NSRL哈希集)用于过滤
  • 已安装.NET 6+运行时(当前EZ工具所需)
  • 输出目录的写入权限,用于保存CSV结果

工作流程

步骤1:获取Amcache.hve文件

从取证镜像或活系统中提取Amcache配置单元:

# 从活系统(需要提升权限和原始复制工具)
# Amcache.hve被系统锁定;请使用原始磁盘复制工具
# 选项A:FTK Imager - 挂载镜像并导航至:
# C:\Windows\appcompat\Programs\Amcache.hve
# 同时收集:Amcache.hve.LOG1, Amcache.hve.LOG2

# 选项B:使用KAPE进行自动化采集
kape.exe --tsource C: --tdest D:\Evidence\%m --target Amcache

# 选项C:从已挂载的取证镜像中(E: = 已挂载的镜像)
copy "E:\Windows\appcompat\Programs\Amcache.hve" D:\Evidence\
copy "E:\Windows\appcompat\Programs\Amcache.hve.LOG1" D:\Evidence\
copy "E:\Windows\appcompat\Programs\Amcache.hve.LOG2" D:\Evidence\

始终与配置单元一同收集事务日志文件(.LOG1、.LOG2)。AmcacheParser会从这些日志中重放未提交的事务,以恢复最完整的数据。

步骤2:使用AmcacheParser解析Amcache

对获取的配置单元运行AmcacheParser:

# 基础解析,输出CSV
AmcacheParser.exe -f "D:\Evidence\Amcache.hve" --csv "D:\Evidence\Output"

# 使用SHA-1白名单排除已知良好条目(NSRL)
AmcacheParser.exe -f "D:\Evidence\Amcache.hve" -w "D:\Whitelists\nsrl_sha1.txt" --csv "D:\Evidence\Output"

# 使用SHA-1包含列表(仅显示与已知恶意哈希匹配的条目)
AmcacheParser.exe -f "D:\Evidence\Amcache.hve" -b "D:\IOCs\malware_sha1.txt" --csv "D:\Evidence\Output"

# 包含已删除条目,并采用高精度时间戳
AmcacheParser.exe -f "D:\Evidence\Amcache.hve" --csv "D:\Evidence\Output" -i --mp

AmcacheParser会在输出目录中生成多个CSV文件:

输出文件内容
Amcache_AssociatedFileEntries.csv文件条目,包含SHA-1哈希、路径、大小和时间戳
Amcache_UnassociatedFileEntries.csv来自旧版Amcache格式的孤立文件条目
Amcache_ProgramEntries.csv已安装程序元数据(名称、发布者、版本、安装日期)
Amcache_DeviceContainers.csvUSB和设备连接历史
Amcache_DevicePnps.csv即插即用设备驱动程序信息
Amcache_DriverBinaries.csv已加载的驱动程序二进制文件,包含路径和哈希

步骤3:分析文件条目中的可疑程序

在Timeline Explorer中打开AssociatedFileEntries.csv并检查关键列:

需要检查的关键列:
- ProgramId          : 将文件链接到其父程序条目
- SHA1               : 用于威胁情报查询的哈希
- FullPath           : 磁盘上的原始文件位置
- FileSize           : 可执行文件的大小
- FileKeyLastWriteTimestamp : Amcache条目最后更新的时间
- Name               : 文件名
- Publisher           : 代码签名发布者(空白表示未签名)
- BinProductVersion  : PE头中的版本字符串
- LinkDate           : PE编译时间戳(用于检测时间戳篡改)

筛选可疑指标:

# 在Timeline Explorer中,应用以下筛选条件:

# 1. 查找未签名的可执行文件(可能为恶意)
Publisher 列 = (空)

# 2. 查找来自可疑路径的可执行文件
FullPath 包含:\temp\, \appdata\, \downloads\, \public\, \programdata\

# 3. 查找事件窗口内具有最新时间戳的可执行文件
FileKeyLastWriteTimestamp 介于:2026-03-15 00:00:00 和 2026-03-16 00:00:00 之间

# 4. 查找存在可疑编译日期的可执行文件(时间戳篡改)
LinkDate 年份 < 2015 AND FileKeyLastWriteTimestamp 年份 = 2026

步骤4:将SHA-1哈希与威胁情报关联

提取SHA-1哈希并与恶意软件数据库核对:

# 从解析输出中提取唯一的SHA-1哈希
# 使用PowerShell提取SHA1列
Import-Csv "D:\Evidence\Output\Amcache_AssociatedFileEntries.csv" |
  Select-Object -ExpandProperty SHA1 -Unique |
  Where-Object { $_ -ne "" } |
  Out-File "D:\Evidence\Output\extracted_hashes.txt"

# 使用vt-cli检查哈希是否存在于VirusTotal
foreach ($hash in Get-Content "D:\Evidence\Output\extracted_hashes.txt") {
    vt file $hash --format json | Select-Object -Property meaningful_name, last_analysis_stats
}

# 检查哈希是否存在于CIRCL hashlookup
foreach ($hash in Get-Content "D:\Evidence\Output\extracted_hashes.txt") {
    Invoke-RestMethod -Uri "https://hashlookup.circl.lu/lookup/sha1/$hash"
}

# 与NSRL交叉引用以识别已知良好与未知文件
# 不在NSRL中的未知哈希需要更仔细的调查

步骤5:分析程序条目中的未经授权安装

检查ProgramEntries.csv以查找攻击者可能已安装的软件:

ProgramEntries中的关键列:
- ProgramName        : 已安装应用程序的显示名称
- ProgramVersion     : 版本字符串
- Publisher          : 软件发布者
- InstallDate        : 程序安装时间
- Source             : 安装源(msi, exe等)
- UninstallKey       : 注册表卸载路径
- PathsList         : 安装目录

查找以下内容:

  • 远程访问工具(AnyDesk、TeamViewer、ngrok、Chisel)
  • 黑客工具(Mimikatz、PsExec、Cobalt Strike)
  • 隧道工具(plink、socat、WireGuard)
  • 在事件窗口内安装的程序
  • 安装到非标准位置的程序

步骤6:分析驱动程序二进制文件中的Rootkit证据

检查DriverBinaries.csv中可疑的已加载驱动程序:

DriverBinaries中的关键列:
- DriverName         : 驱动程序名称
- DriverInBox        : 是否随Windows提供(false = 第三方)
- DriverSigned       : 驱动程序是否具有有效签名
- DriverTimeStamp    : 编译时间戳
- Product            : 与驱动程序关联的产品
- ProductVersion     : 驱动程序版本
- SHA1               : 驱动程序二进制文件的哈希

筛选条件:DriverInBox = false 且 DriverSigned = false,以查找可能为rootkit或在BYOVD(自带易受攻击驱动程序)攻击中使用的未签名第三方驱动程序。

步骤7:利用Amcache数据构建时间线

结合Amcache数据与其他工件构建全面时间线:

# 使用Timeline Explorer将Amcache CSV与其他EZ工具输出合并
# 将以下CSV加载到Timeline Explorer中:
# - Amcache_AssociatedFileEntries.csv(文件证据)
# - Amcache_ProgramEntries.csv(安装证据)
# - 来自PECmd.exe的Prefetch输出(执行证据)
# - 来自AppCompatCacheParser.exe的ShimCache输出(执行证据)

# 按时间戳对所有条目进行排序,以重建攻击序列
# Timeline Explorer支持多文件加载和基于列的排序

# 导出合并后的时间线
# 文件 > 另存为CSV > combined_timeline.csv

关键概念

术语定义
Amcache.hve位于 C:\Windows\appcompat\Programs\Amcache.hve 的Windows注册表配置单元,存储应用程序、文件和驱动程序的元数据,用于应用程序兼容性目的
关联文件条目链接到特定程序安装的Amcache记录,包含文件路径、大小、哈希和时间戳
非关联文件条目来自旧版格式的孤立Amcache记录,未链接到程序条目;常见于Windows 7/8系统
程序条目包含安装元数据的Amcache记录:程序名称、版本、发布者、安装日期和卸载键
SHA-1哈希Amcache为每个注册文件存储的加密哈希,可通过威胁情报查询识别恶意软件
LinkDate嵌入在可执行文件头中的PE编译时间戳;与文件系统时间戳的差异可能表明时间戳篡改
事务日志.LOG1 和 .LOG2 文件,包含未提交的注册表事务,AmcacheParser重放这些日志以恢复完整数据
NSRL(国家软件参考库)NIST维护的已知商业软件SHA-1哈希数据库,用作白名单以过滤良性条目

验证清单

  • 已从取证镜像中收集Amcache.hve及事务日志(LOG1、LOG2)
  • AmcacheParser已生成所有预期的CSV输出文件,且无错误
  • 已提取SHA-1哈希并针对VirusTotal或CIRCL hashlookup进行检查
  • 可疑路径中的未签名可执行文件已标记以进行进一步分析
  • 程序条目显示事件窗口内的所有软件安装
  • 已检查驱动程序二进制文件中是否存在未签名或非内置条目
  • 已执行LinkDate与FileKeyLastWriteTimestamp的比较,以检测时间戳篡改
  • Amcache发现结果已与Prefetch和ShimCache关联以确认执行
  • 最终时间线已整合Amcache数据与其他取证工件

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

相关技能