mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-07-18 21:49:40 +03:00
Initial commit - 611 cybersecurity skills across all subdomains
This commit is contained in:
@@ -0,0 +1,128 @@
|
||||
---
|
||||
name: analyzing-windows-shellbag-artifacts
|
||||
description: Analyze Windows Shellbag registry artifacts to reconstruct folder browsing activity, detect access to removable media and network shares, and establish user interaction with directories even after deletion using SBECmd and ShellBags Explorer.
|
||||
domain: cybersecurity
|
||||
subdomain: digital-forensics
|
||||
tags: [shellbags, windows-registry, sbecmd, shellbags-explorer, folder-access, user-activity, removable-media, network-shares, bagmru, dfir]
|
||||
version: "1.0"
|
||||
author: mahipal
|
||||
license: MIT
|
||||
---
|
||||
|
||||
# Analyzing Windows Shellbag Artifacts
|
||||
|
||||
## Overview
|
||||
|
||||
Shellbags are Windows registry artifacts that track how users interact with folders through Windows Explorer, storing view settings such as icon size, window position, sort order, and view mode. From a forensic perspective, Shellbags provide definitive evidence of folder access -- even folders that no longer exist on the system. When a user browses to a folder via Windows Explorer, the Open/Save dialog, or the Control Panel, a Shellbag entry is created or updated in the user's registry hive. These entries persist after folder deletion, drive disconnection, and even across user profile resets, making them invaluable for proving that a user navigated to specific directories on local drives, USB devices, network shares, or zip archives.
|
||||
|
||||
## Registry Locations
|
||||
|
||||
### Windows 7/8/10/11
|
||||
|
||||
| Hive | Key Path | Stores |
|
||||
|------|---------|--------|
|
||||
| NTUSER.DAT | Software\Microsoft\Windows\Shell\BagMRU | Folder hierarchy tree |
|
||||
| NTUSER.DAT | Software\Microsoft\Windows\Shell\Bags | View settings per folder |
|
||||
| UsrClass.dat | Local Settings\Software\Microsoft\Windows\Shell\BagMRU | Desktop/Explorer shell |
|
||||
| UsrClass.dat | Local Settings\Software\Microsoft\Windows\Shell\Bags | Additional view settings |
|
||||
|
||||
### BagMRU Structure
|
||||
|
||||
The BagMRU key contains a hierarchical tree of numbered subkeys representing the directory structure. Each subkey value contains a Shell Item (SHITEMID) binary blob encoding the folder identity:
|
||||
|
||||
- **Root (BagMRU)**: Desktop namespace root
|
||||
- **BagMRU\0**: Typically "My Computer"
|
||||
- **BagMRU\0\0**: First drive (e.g., C:)
|
||||
- **BagMRU\0\0\0**: First subfolder on C:
|
||||
|
||||
Each Shell Item contains:
|
||||
- Item type (folder, drive, network, zip, control panel)
|
||||
- Short name (8.3 format)
|
||||
- Long name (Unicode)
|
||||
- Creation/modification timestamps
|
||||
- MFT entry/sequence for NTFS folders
|
||||
|
||||
## Analysis with EZ Tools
|
||||
|
||||
### SBECmd (Command Line)
|
||||
|
||||
```powershell
|
||||
# Parse shellbags from a directory of registry hives
|
||||
SBECmd.exe -d "C:\Evidence\Registry" --csv C:\Output --csvf shellbags.csv
|
||||
|
||||
# Parse from a live system (requires admin)
|
||||
SBECmd.exe --live --csv C:\Output --csvf live_shellbags.csv
|
||||
|
||||
# Key output columns:
|
||||
# AbsolutePath - Full reconstructed path
|
||||
# CreatedOn - When the folder was first browsed
|
||||
# ModifiedOn - When view settings were last changed
|
||||
# AccessedOn - Last access timestamp
|
||||
# ShellType - Type of shell item (Directory, Drive, Network, etc.)
|
||||
# Value - Raw shell item data
|
||||
```
|
||||
|
||||
### ShellBags Explorer (GUI)
|
||||
|
||||
```powershell
|
||||
# Launch GUI tool for interactive analysis
|
||||
ShellBagsExplorer.exe
|
||||
|
||||
# Load registry hives: File > Load Hive
|
||||
# Navigate the tree structure to see folder hierarchy
|
||||
# Right-click entries for detailed shell item properties
|
||||
```
|
||||
|
||||
## Forensic Investigation Scenarios
|
||||
|
||||
### Proving USB Device Browsing
|
||||
|
||||
```
|
||||
Shellbag Path: My Computer\E:\Confidential\Project_Files
|
||||
ShellType: Directory (on removable volume)
|
||||
CreatedOn: 2025-03-15 09:30:00 UTC
|
||||
|
||||
This proves the user navigated to E:\Confidential\Project_Files
|
||||
via Windows Explorer, even if the USB drive is no longer connected.
|
||||
The volume letter E: and directory timestamps can be correlated
|
||||
with USBSTOR and MountPoints2 registry entries.
|
||||
```
|
||||
|
||||
### Detecting Network Share Access
|
||||
|
||||
```
|
||||
Shellbag Path: \\FileServer01\Finance\Q4_Reports
|
||||
ShellType: Network Location
|
||||
AccessedOn: 2025-02-20 14:15:00 UTC
|
||||
|
||||
This proves the user browsed to a network share, even if
|
||||
the share has been decommissioned or access revoked.
|
||||
```
|
||||
|
||||
### Identifying Deleted Folder Knowledge
|
||||
|
||||
```
|
||||
Shellbag Path: C:\Users\suspect\Documents\Exfiltration_Staging
|
||||
ShellType: Directory
|
||||
CreatedOn: 2025-01-10 08:00:00 UTC
|
||||
|
||||
Even though C:\Users\suspect\Documents\Exfiltration_Staging
|
||||
no longer exists, the Shellbag entry proves the user
|
||||
created and navigated to this folder.
|
||||
```
|
||||
|
||||
## Limitations
|
||||
|
||||
- Shellbags only record folder-level interactions, not individual file access
|
||||
- Only created through Windows Explorer shell and Open/Save dialogs
|
||||
- Command-line access (cmd, PowerShell) does not generate Shellbag entries
|
||||
- Programmatic file access via APIs does not generate Shellbag entries
|
||||
- Timestamps may reflect view setting changes, not necessarily folder access
|
||||
- Windows may batch-update Shellbag entries during Explorer shutdown
|
||||
|
||||
## References
|
||||
|
||||
- Shellbags Forensic Analysis 2025: https://www.cybertriage.com/blog/shellbags-forensic-analysis-2025/
|
||||
- SANS Shellbag Forensics: https://www.sans.org/blog/computer-forensic-artifacts-windows-7-shellbags
|
||||
- Magnet Forensics Shellbag Analysis: https://www.magnetforensics.com/blog/forensic-analysis-of-windows-shellbags/
|
||||
- ShellBags Explorer: https://ericzimmerman.github.io/
|
||||
@@ -0,0 +1,18 @@
|
||||
# Shellbag Analysis Report
|
||||
## Case Info
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
| Case Number | |
|
||||
| Examiner | |
|
||||
## Folder Access Summary
|
||||
| Path | Shell Type | Created | Modified |
|
||||
|------|-----------|---------|----------|
|
||||
| | | | |
|
||||
## USB Device Access
|
||||
| Path | First Access | Last Access |
|
||||
|------|-------------|------------|
|
||||
| | | |
|
||||
## Network Share Access
|
||||
| UNC Path | Access Time |
|
||||
|----------|------------|
|
||||
| | |
|
||||
@@ -0,0 +1,14 @@
|
||||
# Standards - Shellbag Forensics
|
||||
## Standards
|
||||
- NIST SP 800-86: Guide to Integrating Forensic Techniques
|
||||
- SWGDE Best Practices for Computer Forensics
|
||||
## Tools
|
||||
- SBECmd (Eric Zimmerman): Command-line shellbag parser
|
||||
- ShellBags Explorer (Eric Zimmerman): GUI shellbag viewer
|
||||
- Registry Explorer (Eric Zimmerman): Registry hive analysis
|
||||
## Registry Locations
|
||||
- NTUSER.DAT: Software\Microsoft\Windows\Shell\BagMRU and Bags
|
||||
- UsrClass.dat: Local Settings\Software\Microsoft\Windows\Shell\BagMRU and Bags
|
||||
## MITRE ATT&CK
|
||||
- T1083 - File and Directory Discovery
|
||||
- T1005 - Data from Local System
|
||||
@@ -0,0 +1,15 @@
|
||||
# Workflows - Shellbag Analysis
|
||||
## Workflow 1: Folder Access Investigation
|
||||
```
|
||||
Extract NTUSER.DAT and UsrClass.dat from evidence
|
||||
|
|
||||
Parse with SBECmd to CSV
|
||||
|
|
||||
Open in Timeline Explorer
|
||||
|
|
||||
Filter by path patterns (USB drives, network shares)
|
||||
|
|
||||
Correlate with MFT and LNK file timestamps
|
||||
|
|
||||
Document folder access timeline
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Shellbag Forensic Analyzer - Parses SBECmd CSV output for investigation."""
|
||||
import csv, json, os, sys
|
||||
from datetime import datetime
|
||||
from collections import defaultdict
|
||||
|
||||
def analyze_shellbags(csv_path: str, output_dir: str) -> str:
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
entries = []
|
||||
usb_access = []
|
||||
network_access = []
|
||||
with open(csv_path, "r", encoding="utf-8-sig") as f:
|
||||
for row in csv.DictReader(f):
|
||||
entries.append(row)
|
||||
path = row.get("AbsolutePath", "")
|
||||
if any(d in path for d in ["E:\\", "F:\\", "G:\\", "H:\\"]):
|
||||
usb_access.append(row)
|
||||
if path.startswith("\\\\"):
|
||||
network_access.append(row)
|
||||
report = {
|
||||
"analysis_timestamp": datetime.now().isoformat(),
|
||||
"total_entries": len(entries),
|
||||
"usb_access_entries": len(usb_access),
|
||||
"network_access_entries": len(network_access),
|
||||
"usb_paths": [r.get("AbsolutePath", "") for r in usb_access],
|
||||
"network_paths": [r.get("AbsolutePath", "") for r in network_access],
|
||||
}
|
||||
report_path = os.path.join(output_dir, "shellbag_analysis.json")
|
||||
with open(report_path, "w") as f:
|
||||
json.dump(report, f, indent=2)
|
||||
print(f"[*] Total entries: {len(entries)}, USB: {len(usb_access)}, Network: {len(network_access)}")
|
||||
return report_path
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 3:
|
||||
print("Usage: python process.py <shellbag_csv> <output_dir>")
|
||||
sys.exit(1)
|
||||
analyze_shellbags(sys.argv[1], sys.argv[2])
|
||||
Reference in New Issue
Block a user