Communitygithub.com

Windows Shellbag アーティファクトの分析

Windows Shellbag(BagMRU)レジストリアーティファクトを SBECmd と ShellBags Explorer を用いて分析するためのスキルです。

Windows Shellbag アーティファクトの分析 とは?

このスキルは、Windows フォレンジック調査において重要な Shellbag レジストリアーティファクトの分析手順を提供します。Shellbag はユーザーがエクスプローラーでフォルダーを閲覧した際に作成・更新されるエントリであり、削除されたフォルダーや接続解除された USB ドライブへのアクセス履歴も含むため、フォレンジック上非常に価値が高いです。本スキルでは、EZ Tools に含まれる SBECmd(コマンドライン)と ShellBags Explorer(GUI)を使った解析方法、レジストリの保存場所(NTUSER.DAT、UsrClass.dat)、BagMRU の階層構造、USB デバイスやネットワーク共有へのアクセス証明、削除フォルダの特定など具体的な調査シナリオを網羅しています。また、コマンドラインからの操作では Shellbag が生成されないといった制限事項も明記されており、セキュリティインシデント対応や検知ルール開発に役立ちます。

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

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Windows Shellbag アーティファクトの分析 は何をしますか?

概要

Shellbag は、Windows エクスプローラーを通じてユーザーがフォルダーを操作した方法を追跡する Windows レジストリアーティファクトであり、アイコンのサイズ、ウィンドウの位置、並べ替え順序、表示モードなどの表示設定を保存します。フォレンジックの観点からは、Shellbag はフォルダーへのアクセスの決定的な証拠を提供します。システム上に存在しなくなったフォルダーでさえもです。ユーザーがエクスプローラー、開く/保存ダイアログ、またはコントロールパネルを介してフォルダーを参照すると、ユーザーのレジストリハイブ内に Shellbag エントリが作成または更新されます。これらのエントリは、フォルダー削除後、ドライブ切断後、さらにはユーザープロファイルのリセット後も存続するため、ユーザーがローカルドライブ、USB デバイス、ネットワーク共有、zip アーカイブ上の特定のディレクトリに移動したことを証明する上で非常に価値があります。

使用すべきタイミング

  • Shellbag アーティファクトの分析が必要なセキュリティインシデントを調査する場合
  • このドメインに関する検知ルールや脅威ハンティングクエリを作成する場合
  • 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デスクトップ/エクスプローラーシェル
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 には以下が含まれます:

  • アイテムタイプ(フォルダ、ドライブ、ネットワーク、zip、コントロールパネル)
  • ショートネーム(8.3 形式)
  • ロングネーム(Unicode)
  • 作成/変更タイムスタンプ
  • NTFS フォルダの MFT エントリ/シーケンス

EZ Tools による分析

SBECmd(コマンドライン)

# レジストリハイブのディレクトリから Shellbag を解析
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 - シェルアイテムのタイプ(Directory、Drive、Network など)
# Value - 生のシェルアイテムデータ

ShellBags Explorer(GUI)

# 対話的分析用の GUI ツールを起動
ShellBagsExplorer.exe

# レジストリハイブを読み込む: ファイル > ハイブの読み込み
# ツリー構造をナビゲートしてフォルダ階層を表示
# エントリを右クリックして詳細なシェルアイテムプロパティを表示

フォレンジック調査シナリオ

USB デバイスの参照の証明

Shellbag パス: My Computer\E:\Confidential\Project_Files
Shellタイプ: Directory(リムーバブルボリューム上)
作成日時: 2025-03-15 09:30:00 UTC

これは、USB ドライブが接続されていない場合でも、ユーザーが Windows エクスプローラーを介して
E:\Confidential\Project_Files に移動したことを証明します。
ボリュームレター E: とディレクトリのタイムスタンプは、USBSTOR や
MountPoints2 レジストリエントリと関連付けることができます。

ネットワーク共有アクセスの検出

Shellbag パス: \\FileServer01\Finance\Q4_Reports
Shellタイプ: Network Location
アクセス日時: 2025-02-20 14:15:00 UTC

これは、共有が廃止されたりアクセスが取り消されたりした場合でも、
ユーザーがネットワーク共有を参照したことを証明します。

削除されたフォルダの知識の特定

Shellbag パス: C:\Users\suspect\Documents\Exfiltration_Staging
Shellタイプ: Directory
作成日時: 2025-01-10 08:00:00 UTC

C:\Users\suspect\Documents\Exfiltration_Staging が存在しなくなったとしても、
Shellbag エントリはユーザーがこのフォルダを作成し、
移動したことを証明します。

制限事項

  • Shellbag はフォルダレベルの操作のみを記録し、個別のファイルアクセスは記録しません
  • Windows エクスプローラーシェルと開く/保存ダイアログを介してのみ作成されます
  • コマンドラインアクセス(cmd、PowerShell)では Shellbag エントリは生成されません
  • API を介したプログラムによるファイルアクセスでは Shellbag エントリは生成されません
  • タイムスタンプは表示設定の変更を反映している場合があり、必ずしもフォルダアクセスを意味するわけではありません
  • Windows はエクスプローラーのシャットダウン時に Shellbag エントリを一括更新する場合があります

参考資料

出力例

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

SBECmd v2.1.0 - ShellBags Explorer(コマンドライン)
====================================================
ユーザー jsmith のハイブを処理中:
  NTUSER.DAT:  C:\Evidence\Users\jsmith\NTUSER.DAT
  UsrClass.dat: C:\Evidence\Users\jsmith\AppData\Local\Microsoft\Windows\UsrClass.dat

[+] NTUSER.DAT の Shellbag エントリ:   456
[+] UsrClass.dat の Shellbag エントリ: 1,234
[+] 合計 Shellbag エントリ:           1,690

--- フォルダアクセス時系列(インシデントウィンドウ) ---
最終アクセス日時 (UTC)   | フォルダパス                                            | タイプ       | アクセス回数
------------------------|---------------------------------------------------------|-------------|-------------
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

--- ネットワーク共有アクセス ---
  \\FILESERV01\Finance             最初: 2023-09-10  最後: 2024-01-15
  \\FILESERV01\Finance\Q4_Reports  最初: 2024-01-15  最後: 2024-01-15  (新規)
  \\FILESERV01\HR\Employees        最初: 2024-01-15  最後: 2024-01-15  (新規)
  \\DC01\SYSVOL                    最初: 2023-03-15  最後: 2024-01-16  (異常なアクセス時刻)

--- リムーバブルデバイスアクセス ---
  E:\ (USB ドライブ)
    ボリューム名:    BACKUP_DRIVE
    最初のアクセス: 2024-01-15 15:30:00 UTC
    最後のアクセス: 2024-01-15 15:45:22 UTC
    参照されたフォルダ数: 3 (E:\, E:\Backup, E:\Backup\Corporate_Data)

--- 削除済み/存在しないパス ---
  C:\ProgramData\Updates\                (フォルダは削除されたが、shellbag は存続)
  C:\ProgramData\svc\                    (フォルダは削除されたが、shellbag は存続)
  C:\Windows\Temp\tools\                 (フォルダは削除されたが、shellbag は存続)

サマリー:
  アクセスされた一意のフォルダ数:    1,690
  アクセスされたネットワーク共有:    4(うちインシデント中に新規アクセス: 2)
  リムーバブルメディア:             1 台の USB デバイス(データステージングの疑い)
  削除フォルダの証拠:              3 パス(アンチフォレンジックの指標)
  CSV エクスポート先:               /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,

関連スキル