
Analyzing Windows Shellbag Artifacts
- 179 installs
- 27.3k repo stars
- Updated August 2, 2026
- mukul975/anthropic-cybersecurity-skills
analyzing-windows-shellbag-artifacts guides solo builders, consultants, and small security teams through documenting Windows Shellbag forensic results in a consistent report layout.
About
analyzing-windows-shellbag-artifacts guides solo builders, consultants, and small security teams through documenting Windows Shellbag forensic results in a consistent report layout. Shellbags reveal historical folder browsing—including removable and UNC paths—which matters when you are validating whether a compromised laptop accessed sensitive shares or staging directories. The skill supplies tabular sections for folder access summaries, USB timelines, and network share hits so an agent does not improvise incompatible headings during IR. It fits builders who wear both dev and ops hats and need repeatable DFIR-style output without opening a full commercial case-management suite. Use it when you already extracted shellbag data with your toolchain and need human-readable case notes for clients, insurers, or internal postmortems. It does not replace proper chain-of-custody tooling; it standardizes how findings are narrated for Ship-phase security reviews and Operate-phase incident follow-up.
- Shellbag analysis report template with case metadata fields
- Folder access summary table (path, shell type, created, modified)
- USB device access timeline section
- Network share UNC path access section
- Apache License 2.0 reference material in bundled documentation
Analyzing Windows Shellbag Artifacts by the numbers
- 179 all-time installs (skills.sh)
- +9 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #817 of 2,203 Security skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill analyzing-windows-shellbag-artifactsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 179 |
|---|---|
| repo stars | ★ 27.3k |
| Security audit | 3 / 3 scanners passed |
| Last updated | August 2, 2026 |
| Repository | mukul975/anthropic-cybersecurity-skills ↗ |
How do I structure Windows Shellbag forensic findings into folder, USB, and network-share access reports during incident response or malware triage.?
Structure Windows Shellbag forensic findings into folder, USB, and network-share access reports during incident response or malware triage.
Who is it for?
Best when you're working on security and need structured help with analyzing windows shellbag artifacts.
Skip if: Teams with no security needs, or anyone wanting a generic chat assistant without this specific workflow.
When should I use this skill?
When you need to structure Windows Shellbag forensic findings into folder, USB, and network-share access reports during incident response or malware triage., or when analyzing-windows-shellbag-artifacts guides solo build
What you get
Structured output aligned to analyzing-windows-shellbag-artifacts: Shellbag analysis report template with case metadata fields, Folder access summary table (path, shell type, created, modified).
Files
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.
When to Use
- When investigating security incidents that require analyzing windows shellbag artifacts
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Prerequisites
- Familiarity with digital forensics concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
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)
# 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 dataShellBags Explorer (GUI)
# 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 propertiesForensic 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/
Example Output
$ 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/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 |
|---|---|
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to the Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by the Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding any notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. Please do not remove or change
the license header comment from a contributed file except when
necessary.
Copyright 2026 mukul975
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
API Reference: Windows ShellBag Forensics
SBECmd (Eric Zimmerman)
Syntax
SBECmd.exe -d <registry_dir> # Process directory of hives
SBECmd.exe --hive <NTUSER.DAT> # Single hive
SBECmd.exe -d <dir> --csv <output_dir> # CSV export
SBECmd.exe -d <dir> -l # Live system registryOutput Fields
| Field | Description |
|---|---|
| AbsolutePath | Full reconstructed folder path |
| CreatedOn | Folder creation timestamp |
| ModifiedOn | Folder modification timestamp |
| AccessedOn | Folder access timestamp |
| MFTEntryNumber | NTFS MFT reference |
| ShellType | Folder, network, zip, etc. |
ShellBags Explorer (GUI)
Features
- Tree view of folder access history
- Timeline view of access patterns
- Filtering by date range
- Export to CSV/JSON
Registry Paths
NTUSER.DAT
Software\Microsoft\Windows\Shell\BagMRU
Software\Microsoft\Windows\Shell\Bags
Software\Microsoft\Windows\ShellNoRoam\BagMRUUsrClass.dat
Local Settings\Software\Microsoft\Windows\Shell\BagMRU
Local Settings\Software\Microsoft\Windows\Shell\Bagsregipy (Python)
Installation
pip install regipyUsage
from regipy.registry import RegistryHive
hive = RegistryHive("NTUSER.DAT")
key = hive.get_key("Software\Microsoft\Windows\Shell\BagMRU")
for value in key.iter_values():
print(value.name, type(value.value))Shell Item Types
| Type Byte | Description |
|---|---|
| 0x1F | Root folder (GUID - Desktop, My Computer) |
| 0x2F | Volume (drive letter) |
| 0x31 | File entry (directory) |
| 0x32 | File entry (file) |
| 0x41 | Network location |
| 0x42 | Compressed folder |
| 0x46 | Network share (UNC path) |
| 0x71 | Control Panel item |
Forensic Value
| Artifact | Intelligence |
|---|---|
| Network paths | Remote share access (lateral movement) |
| USB paths | Removable media (data exfiltration) |
| Deleted folders | Evidence of anti-forensics awareness |
| Temp directories | Staging areas for tools/malware |
| AppData paths | Persistence mechanism locations |
| Recycle Bin | Awareness of deleted content |
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
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#!/usr/bin/env python3
"""Windows ShellBag artifact analysis agent.
Parses ShellBag registry artifacts to reconstruct folder access history,
directory browsing patterns, and evidence of accessed network shares.
"""
import os
import sys
import json
import struct
import hashlib
import datetime
from collections import defaultdict
try:
import Registry
HAS_REGISTRY = True
except ImportError:
try:
from regipy.registry import RegistryHive
HAS_REGIPY = True
HAS_REGISTRY = False
except ImportError:
HAS_REGISTRY = False
HAS_REGIPY = False
SHELLBAG_PATHS = {
'ntuser': [
r'Software\Microsoft\Windows\Shell\BagMRU',
r'Software\Microsoft\Windows\Shell\Bags',
r'Software\Microsoft\Windows\ShellNoRoam\BagMRU',
r'Software\Microsoft\Windows\ShellNoRoam\Bags',
],
'usrclass': [
r'Local Settings\Software\Microsoft\Windows\Shell\BagMRU',
r'Local Settings\Software\Microsoft\Windows\Shell\Bags',
],
}
def filetime_to_datetime(filetime):
if not filetime or filetime == 0:
return None
try:
epoch = datetime.datetime(1601, 1, 1)
delta = datetime.timedelta(microseconds=filetime // 10)
return (epoch + delta).isoformat() + 'Z'
except (OverflowError, OSError):
return None
def parse_shell_item(data):
if len(data) < 2:
return None
item_size = struct.unpack_from('<H', data, 0)[0]
if item_size < 2 or item_size > len(data):
return None
item_type = data[2] if len(data) > 2 else 0
result = {'size': item_size, 'type': hex(item_type)}
if item_type == 0x1F:
result['class'] = 'Root Folder (GUID)'
if len(data) >= 18:
guid = data[4:20].hex()
result['guid'] = guid
elif item_type in (0x31, 0x32, 0x35):
result['class'] = 'File Entry'
if len(data) > 14:
file_size = struct.unpack_from('<I', data, 4)[0]
result['file_size'] = file_size
name_offset = 14
if name_offset < len(data):
name_end = data.find(b'\x00', name_offset)
if name_end > name_offset:
result['short_name'] = data[name_offset:name_end].decode('ascii', errors='replace')
elif item_type in (0x41, 0x42, 0x46, 0x47):
result['class'] = 'Network Location'
if len(data) > 5:
name_start = 5
name_end = data.find(b'\x00', name_start)
if name_end > name_start:
result['network_path'] = data[name_start:name_end].decode('ascii', errors='replace')
elif item_type == 0x71:
result['class'] = 'Control Panel'
else:
result['class'] = 'Unknown'
return result
def parse_bagmru_value(data):
items = []
offset = 0
while offset < len(data) - 2:
item_size = struct.unpack_from('<H', data, offset)[0]
if item_size == 0:
break
item_data = data[offset:offset + item_size]
parsed = parse_shell_item(item_data)
if parsed:
items.append(parsed)
offset += item_size
return items
def analyze_shellbags_regipy(hive_path):
if not HAS_REGIPY:
return []
hive = RegistryHive(hive_path)
results = []
for path_group in SHELLBAG_PATHS.values():
for reg_path in path_group:
try:
key = hive.get_key(reg_path)
if key:
for value in key.iter_values():
if isinstance(value.value, bytes):
items = parse_bagmru_value(value.value)
for item in items:
item['registry_path'] = reg_path
item['value_name'] = value.name
results.append(item)
except Exception:
continue
return results
def detect_suspicious_paths(shellbag_entries):
findings = []
suspicious_indicators = [
('\\', 'UNC path access (network share)'),
('temp', 'Temp directory access'),
('appdata', 'AppData directory (persistence location)'),
('recycle', 'Recycle Bin access'),
('usb', 'USB device path'),
('removable', 'Removable media'),
('.tor', 'Tor browser directory'),
('sysinternals', 'Sysinternals tools directory'),
('mimikatz', 'Mimikatz tool directory'),
('powershell', 'PowerShell directory'),
]
for entry in shellbag_entries:
path = (entry.get('short_name', '') + ' ' + entry.get('network_path', '')).lower()
for pattern, description in suspicious_indicators:
if pattern in path:
findings.append({
'type': 'suspicious_path',
'path': entry.get('short_name', entry.get('network_path', '')),
'indicator': description,
'severity': 'HIGH' if 'mimikatz' in pattern else 'MEDIUM',
})
break
return findings
if __name__ == '__main__':
print('=' * 60)
print('Windows ShellBag Artifact Analysis Agent')
print('Registry parsing, folder history, network share detection')
print('=' * 60)
target = sys.argv[1] if len(sys.argv) > 1 else None
if not target or not os.path.exists(target):
print('\n[DEMO] Usage: python agent.py <NTUSER.DAT|UsrClass.dat>')
print(f' regipy available: {HAS_REGIPY if not HAS_REGISTRY else False}')
print(f' python-registry available: {HAS_REGISTRY}')
sys.exit(0)
print(f'\n[*] Analyzing: {target}')
entries = analyze_shellbags_regipy(target)
print(f'[*] ShellBag entries: {len(entries)}')
print('\n--- Folder Access History ---')
for e in entries[:20]:
name = e.get('short_name', e.get('network_path', e.get('guid', '?')))
print(f' [{e["class"]:20s}] {name}')
findings = detect_suspicious_paths(entries)
print(f'\n--- Suspicious Paths ({len(findings)}) ---')
for f in findings[:10]:
print(f' [{f["severity"]}] {f["indicator"]}: {f["path"]}')
#!/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])
Related skills
FAQ
What does analyzing-windows-shellbag-artifacts do?
analyzing-windows-shellbag-artifacts guides developers, consultants, and small security teams through documenting Windows Shellbag forensic results in a consistent report layout.
When should I use analyzing-windows-shellbag-artifacts?
When you need to structure Windows Shellbag forensic findings into folder, USB, and network-share access reports during incident response or malware triage., or when analyzing-windows-shellbag-artifacts guides developers, consultants, and small security teams through documenti
What are the main capabilities?
Shellbag analysis report template with case metadata fields; Folder access summary table (path, shell type, created, modified); USB device access timeline section.
Is Analyzing Windows Shellbag Artifacts safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.