Communitygithub.com

分析 Windows Amcache 工件

使用 Eric Zimmerman 的工具解析 Windows Amcache.hve 登錄檔,以識別系統上曾存在或執行的程式,用於事件調查。

分析 Windows Amcache 工件 是什麼?

這項技術技能旨在協助開發者或安全分析師,利用 Eric Zimmerman 的 AmcacheParser 工具,從 Windows 系統的 Amcache.hve 登錄檔中提取並分析應用程式、檔案及驅動程式的歷史記錄。它適用於所有支援 Amcache 的現代 Windows 版本,並能產出結構化的 CSV 檔案,方便後續使用 Timeline Explorer 進行關聯分析。此技能的核心價值在於,即使在可執行檔已被刪除後,仍能識別其殘留痕跡,並透過 SHA-1 雜湊比對威脅情報資料庫(如 VirusTotal、CIRCL),以偵測潛在的惡意軟體、未經授權的程式或 rootkit。工作流程包含擷取 hive 檔案、使用各種參數解析、過濾可疑項目(如未簽署的可執行檔、安裝在敏感路徑的軟體),以及整合其他 Windows 工件(如 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 進行手動 hive 檢查
  • 一份已知良好可執行檔的 SHA-1 白名單(例如 NSRL 雜湊集)用於過濾
  • 已安裝 .NET 6+ 執行階段(EZ 工具目前所需)
  • 對輸出目錄的寫入權限,以便儲存 CSV 結果

工作流程

步驟 1:取得 Amcache.hve 檔案

從鑑識影像或即時系統中提取 Amcache hive:

# 從即時系統(需要提升權限和原始複製工具)
# Amcache.hve 被系統鎖定;請使用原始磁碟複製工具
# 選項 A:FTK Imager - 掛載影像並導航至:
# C:\Windows\appcompat\Programs\Amcache.hve
# 也請一併收集:Amcache.hve.LOG1、Amcache.hve.LOG2

# 選項 B:使用 KAPE 進行自動化 triage 收集
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) 與 hive。AmcacheParser 會從這些日誌中重播未提交的交易,以恢復最完整的資料。

步驟 2:使用 AmcacheParser 解析 Amcache

對取得的 hive 執行 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 且 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(Bring Your Own Vulnerable Driver)攻擊中所使用的易受攻擊驅動程式的未簽署第三方驅動程式。

步驟 7:從 Amcache 資料建立時間線

將 Amcache 資料與其他工件結合,以建立全面的時間線:

# 使用 Timeline Explorer 將 Amcache CSV 與其他 EZ Tools 輸出合併
# 將以下 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 登錄 hive,儲存應用程式、檔案和驅動程式的元數據,用於應用程式相容性目的
Associated File Entry連結至特定程式安裝的 Amcache 記錄,包含檔案路徑、大小、雜湊和時間戳
Unassociated File Entry來自舊版格式的孤立 Amcache 記錄,未連結至任何程式條目;常見於 Windows 7/8 系統
Program Entry包含安裝元數據的 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,

相關技能