Communitygithub.com

分析 Windows Shellbag 鑑識artifact

使用 SBECmd 等工具分析 Windows Shellbag(BagMRU)登錄檔 artifact,重建使用者瀏覽資料夾的歷程。

分析 Windows Shellbag 鑑識artifact 是什麼?

此技能提供分析 Windows Shellbag 鑑識 artifact 的完整指引。Shellbag 是 Windows 登錄檔中的 artifacts,記錄使用者透過檔案總管與資料夾的互動,包含資料夾檢視設定、位置與存取時間。從鑑識角度,Shellbag 能提供明確的資料夾存取證據,即使資料夾已被刪除。支援平台包括 Windows 7/8/10/11,工具以 Eric Zimmerman 的 SBECmd 命令列工具與 ShellBags Explorer GUI 為主。文件詳細說明 NTUSER.DAT 與 UsrClass.dat 中的 BagMRU 與 Bags 機碼結構、分析步驟、實戰情境(如 USB 裝置瀏覽、網路共用存取、已刪除資料夾追蹤),以及限制(僅記錄資料夾層級互動,不記錄個別檔案存取)。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

分析 Windows Shellbag Artifact

總覽

Shellbag 是 Windows 登錄檔中的 artifacts,記錄使用者透過檔案總管與資料夾的互動方式,儲存圖示大小、視窗位置、排序順序與檢視模式等設定。從鑑識角度,Shellbag 能提供明確的資料夾存取證據——即使資料夾已從系統中消失。當使用者透過檔案總管、開啟/儲存對話方塊或控制台瀏覽資料夾時,使用者的登錄區中便會建立或更新 Shellbag 項目。這些項目在資料夾刪除、磁碟機斷線、甚至使用者設定檔重設後仍會留存,因此對於證明使用者曾存取本機磁碟、USB 裝置、網路共用或壓縮檔中的特定目錄極具價值。

使用時機

  • 調查需要分析 Windows shellbag artifacts 的安全性事件時
  • 建立此領域的偵測規則或威脅獵殺查詢時
  • SOC 分析師需要此分析類型的結構化程序時
  • 驗證相關攻擊技術的安全性監控覆蓋範圍時

先決條件

  • 熟悉數位鑑識概念與工具
  • 可安全執行的測試或實驗室環境
  • Python 3.8+ 及已安裝的必要相依套件
  • 執行測試活動的適當授權

登錄檔位置

Windows 7/8/10/11

登錄區機碼路徑儲存內容
NTUSER.DATSoftware\Microsoft\Windows\Shell\BagMRU資料夾層級樹狀結構
NTUSER.DATSoftware\Microsoft\Windows\Shell\Bags每個資料夾的檢視設定
UsrClass.datLocal Settings\Software\Microsoft\Windows\Shell\BagMRU桌面/檔案總管 shell
UsrClass.datLocal Settings\Software\Microsoft\Windows\Shell\Bags其他檢視設定

BagMRU 結構

BagMRU 機碼包含一個由編號子機碼組成的層級樹,代表目錄結構。每個子機碼值包含編碼資料夾身分的 Shell Item (SHITEMID) 二進位區塊:

  • 根 (BagMRU):桌面命名空間根
  • BagMRU\0:通常是「我的電腦」
  • BagMRU\0\0:第一個磁碟機(例如 C:)
  • BagMRU\0\0\0:C: 的第一個子資料夾

每個 Shell Item 包含:

  • 項目類型 (資料夾、磁碟機、網路、壓縮檔、控制台)
  • 短檔名 (8.3 格式)
  • 長檔名 (Unicode)
  • 建立/修改時間戳記
  • NTFS 資料夾的 MFT 項目/序號

使用 EZ Tools 進行分析

SBECmd (命令列)

# 從登錄區目錄解析 shellbags
SBECmd.exe -d "C:\Evidence\Registry" --csv C:\Output --csvf shellbags.csv

# 從本機系統解析 (需要系統管理員權限)
SBECmd.exe --live --csv C:\Output --csvf live_shellbags.csv

# 主要輸出欄位:
# AbsolutePath - 完整重建的路徑
# CreatedOn - 首次瀏覽資料夾的時間
# ModifiedOn - 上次變更檢視設定的時間
# AccessedOn - 上次存取時間戳記
# ShellType - Shell item 類型 (Directory, Drive, Network 等)
# Value - 原始 Shell item 資料

ShellBags Explorer (GUI)

# 啟動互動式分析 GUI 工具
ShellBagsExplorer.exe

# 載入登錄區:File > Load Hive
# 瀏覽樹狀結構以檢視資料夾層級
# 在項目上按右鍵以查看詳細 Shell item 屬性

鑑識調查情境

證明 USB 裝置瀏覽行為

Shellbag Path: My Computer\E:\Confidential\Project_Files
ShellType: Directory (on removable volume)
CreatedOn: 2025-03-15 09:30:00 UTC

這證明使用者曾透過檔案總管瀏覽 E:\Confidential\Project_Files,
即使 USB 磁碟機已不再連線。磁碟機代號 E: 與目錄時間戳記
可與 USBSTOR 和 MountPoints2 登錄項目相關聯。

偵測網路共用存取

Shellbag Path: \\FileServer01\Finance\Q4_Reports
ShellType: Network Location
AccessedOn: 2025-02-20 14:15:00 UTC

這證明使用者曾瀏覽網路共用,即使該共用
已除役或存取權限已被撤銷。

辨識已刪除資料夾的存取記錄

Shellbag Path: C:\Users\suspect\Documents\Exfiltration_Staging
ShellType: Directory
CreatedOn: 2025-01-10 08:00:00 UTC

儘管 C:\Users\suspect\Documents\Exfiltration_Staging
已不存在,Shellbag 項目仍證明使用者
曾建立並瀏覽此資料夾。

限制

  • Shellbag 僅記錄資料夾層級的互動,不記錄個別檔案存取
  • 僅透過 Windows 檔案總管 shell 與開啟/儲存對話方塊產生
  • 命令列存取 (cmd, PowerShell) 不會產生 Shellbag 項目
  • 透過 API 的程式化檔案存取不會產生 Shellbag 項目
  • 時間戳記可能反映檢視設定變更,而非資料夾存取
  • Windows 可能在檔案總管關閉時批次更新 Shellbag 項目

參考資料

輸出範例

$ SBECmd.exe -d "C:\Evidence\Users\jsmith" --csv /analysis/shellbag_output

SBECmd v2.1.0 - ShellBags Explorer (Command Line)
====================================================
Processing hives for user: jsmith
  NTUSER.DAT:  C:\Evidence\Users\jsmith\NTUSER.DAT
  UsrClass.dat: C:\Evidence\Users\jsmith\AppData\Local\Microsoft\Windows\UsrClass.dat

[+] NTUSER.DAT shellbag entries:   456
[+] UsrClass.dat shellbag entries: 1,234
[+] Total shellbag entries:        1,690

--- Folder Access Timeline (Incident Window) ---
Last Accessed (UTC)     | Folder Path                                             | Type        | Access Count
------------------------|---------------------------------------------------------|-------------|-------------
2024-01-15 14:34:05     | C:\Users\jsmith\Downloads                               | File System | 45
2024-01-15 14:36:25     | C:\ProgramData\Updates                                  | File System | 3
2024-01-15 15:05:00     | \\FILESERV01\Finance                                    | Network     | 2
2024-01-15 15:12:30     | \\FILESERV01\Finance\Q4_Reports                          | Network     | 1
2024-01-15 15:30:00     | E:\                                                     | Removable   | 4
2024-01-15 15:30:45     | E:\Backup                                               | Removable   | 3
2024-01-15 15:31:20     | E:\Backup\Corporate_Data                                | Removable   | 2
2024-01-15 16:12:45     | \\FILESERV01\HR\Employees                                | Network     | 1
2024-01-15 16:15:00     | \\FILESERV01\HR\Employees\Records_2024                   | Network     | 1
2024-01-16 02:35:00     | C:\Windows\Temp                                         | File System | 5
2024-01-17 02:44:00     | C:\ProgramData\svc                                     | File System | 2
2024-01-18 01:10:00     | C:\Users\jsmith\AppData\Local\Temp                      | File System | 8

--- Network Share Access ---
  \\FILESERV01\Finance             First: 2023-09-10  Last: 2024-01-15
  \\FILESERV01\Finance\Q4_Reports  First: 2024-01-15  Last: 2024-01-15  (NEW)
  \\FILESERV01\HR\Employees        First: 2024-01-15  Last: 2024-01-15  (NEW)
  \\DC01\SYSVOL                    First: 2023-03-15  Last: 2024-01-16  (anomalous access time)

--- Removable Device Access ---
  E:\ (USB Drive)
    Volume Name:    BACKUP_DRIVE
    First Accessed: 2024-01-15 15:30:00 UTC
    Last Accessed:  2024-01-15 15:45:22 UTC
    Folders Browsed: 3 (E:\\, E:\Backup, E:\Backup\Corporate_Data)

--- Deleted/No Longer Existing Paths ---
  C:\ProgramData\Updates\                (folder deleted, shellbag persists)
  C:\ProgramData\svc\                    (folder deleted, shellbag persists)
  C:\Windows\Temp\tools\                 (folder deleted, shellbag persists)

Summary:
  Total unique folders accessed:  1,690
  Network shares accessed:        4 (2 newly accessed during incident)
  Removable media:                1 USB device (data staging suspected)
  Deleted folder evidence:        3 paths (anti-forensics indicator)
  CSV exported to:                /analysis/shellbag_output/

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,

相關技能