Shellbags Forensic Analysis
Executive Summary
Section titled โExecutive SummaryโShellbags are a collection of Windows Registry keys designed to store user preferences for folder views (window size, icon settings, view type). For digital forensics and incident response (DFIR) analysts, they function as a โphotographic memoryโ of user navigation within Windows Explorer. Shellbags persist long after the folders or files they reference have been deleted, making them crucial for reconstructing an attackerโs reconnaissance activities.
Objective and Mechanism
Section titled โObjective and MechanismโThe purpose of Shellbags is to provide a consistent user experience. When a user configures a folder, Windows stores these settings so they persist across sessions.
How it Works:
Section titled โHow it Works:โ- Every time a user interacts with or even views a folder in the Explorer tree, Windows updates specific Registry keys.
- These keys are hierarchically structured, effectively mapping the path navigated by the user.
Location and Structure
Section titled โLocation and StructureโShellbags are stored in Registry hives, depending on the user context:
- Current User Context:
- Hive:
NTUSER.DAT - Registry Keys:
Software\Microsoft\Windows\Shell\BagMRUandSoftware\Microsoft\Windows\Shell\Bags
- Hive:
- System/Other User Contexts:
- Hive:
UsrClass.dat - Path:
C:\Users\<username>\AppData\Local\Microsoft\Windows\UsrClass.dat - Registry Keys:
Local Settings\Software\Microsoft\Windows\Shell\BagMRUandLocal Settings\Software\Microsoft\Windows\Shell\Bags
- Hive:
Forensic Utility
Section titled โForensic UtilityโShellbags are essential for identifying the โintentโ of a user or attacker on a system.
- Proving Access to Deleted Folders: Because the Registry keys persist, Shellbags can prove a folder existed and was accessed even if the folder and its contents were subsequently deleted.
- Tracing Attacker Reconnaissance: Analysts can use Shellbags to reconstruct an attackerโs movement, such as browsing:
- Network shares (
\\server\share) - Other usersโ directories (
C:\Users\) - Sensitive system paths (
C:\Windows\System32\)
- Network shares (
- Identifying External Media Usage: Shellbags record access to directories on removable media (USB drives, external hard drives), providing evidence of potential data exfiltration or malware introduction vectors.
Analysis Tools
Section titled โAnalysis ToolsโGiven the extreme complexity of their binary structure within the Registry, manual analysis is inefficient.
- ShellBagsExplorer.exe (Eric Zimmerman): The industry-standard tool for parsing and visualizing Shellbags data in a readable directory-tree format.
- RegRipper: An alternative tool that includes dedicated plugins to extract Shellbags information.
Detection and Hunting
Section titled โDetection and HuntingโShellbags findings should be correlated with other forensic artefacts for a comprehensive timeline: