Forensic ArtifactWindows: Registry

ShellBags — Folder Access History

ShellBags record every folder a user has viewed in Explorer including view settings, window positions, and timestamps — even for folders on removable media or network shares that no longer exist.

ShellBags are one of the most persistent and underappreciated forensic artifacts in Windows. They record every folder a user has ever viewed in Windows Explorer — including folders on USB drives that have been disconnected, network shares that no longer exist, and directories that have been deleted. Even after a folder is removed from disk, the ShellBag entry proving the user navigated to it persists indefinitely in the registry.

What Are ShellBags?

ShellBags are registry entries that Windows creates to store the user’s Explorer shell preferences for each folder they visit. When a user opens a folder in Explorer, Windows records the folder’s view settings (icon size, sort order, column layout), window position, and window size. These preferences are stored so that the next time the user visits the same folder, Explorer restores their preferred view. The forensic value is not in the view settings themselves, but in the fact that Windows must record the folder path to store the preference — creating an indelible record of folder navigation.

The ShellBag data is stored as binary registry values organized in a tree structure under BagMRU and Bags keys. The BagMRU tree mirrors the folder hierarchy: each node represents a folder, and its binary value contains a Shell Item structure that encodes the folder name, timestamps, and metadata. The Bags keys store the actual view preferences (icon size, sort order, etc.) indexed by a NodeSlot number that links back to the corresponding BagMRU entry.

ShellBags are created on Windows XP and all later versions. The storage location shifted between Windows XP (primarily in NTUSER.DAT) and Windows 7+ (primarily in UsrClass.dat), but both hives should be analyzed. The artifact persists across reboots, survives folder deletion, and is not targeted by any widely deployed consumer cleanup tool.

Why ShellBags Persist

ShellBags are never automatically pruned by the operating system. Windows has no garbage collection for orphaned ShellBag entries — if a user viewed a folder on a USB drive in 2022 and the USB drive was never connected again, the ShellBag entry remains in the registry indefinitely. This makes ShellBags one of the longest-retention artifacts on a Windows system, often spanning the entire lifetime of the user profile.

Location & Format

ComponentPathDescription
UsrClass.dat (primary, Win 7+)C:\Users\{user}\AppData\Local\Microsoft\Windows\UsrClass.datPrimary ShellBag location on Windows 7/8/10/11; contains Local Settings\Software\Microsoft\Windows\Shell\BagMRU and Bags
NTUSER.DAT (secondary)C:\Users\{user}\NTUSER.DATSecondary location; contains Software\Microsoft\Windows\Shell\BagMRU and Bags; also Software\Microsoft\Windows\ShellNoRoam\BagMRU on XP
UsrClass.dat logsUsrClass.dat.LOG1, .LOG2Transaction logs with uncommitted writes; may contain most recent ShellBag entries

BagMRU Tree Structure

The BagMRU registry key contains a hierarchical tree of binary values. The root BagMRU key represents “Desktop.” Each subkey (numbered 0, 1, 2, etc.) represents a child folder. The binary data in each subkey’s default value is a Shell Item (also called SHITEMID) structure that encodes:

Each BagMRU subkey also contains a NodeSlot value (DWORD) that maps to the corresponding Bags\{NodeSlot} key where the view settings are stored. The Bags\{NodeSlot}\Shell key contains values like Rev, FFlags, Mode, Vid, ColInfo, and Sort that define the Explorer view preferences. The MRUListEx value in each BagMRU node records the most-recently-used order of child folders.

REGISTRY TREE / EXAMPLE
UsrClass.dat
Local Settings\Software\Microsoft\Windows\Shell\BagMRU
    (default) = Shell Item for Desktop
    MRUListEx = 01 00 00 00 00 00 00 00 FF FF FF FF
    \0         = Shell Item for "This PC"
        \0     = Shell Item for "C:\"
            \0 = Shell Item for "Users"
            \1 = Shell Item for "Windows"
        \1     = Shell Item for "D:\" (USB drive, volume label "SANDISK_USB")
            \0 = Shell Item for "Client_Data"
            \1 = Shell Item for "Backups"
    \1         = Shell Item for "\\FILESERVER01"
        \0     = Shell Item for "Projects"
        \1     = Shell Item for "HR_Confidential"
Reading the Tree

The tree above shows the user navigated to D:\Client_Data and D:\Backups on a USB drive labeled SANDISK_USB, as well as \\FILESERVER01\Projects and \\FILESERVER01\HR_Confidential on a network share. Even if the USB drive is disconnected and the network share is decommissioned, these ShellBag entries persist indefinitely.

What It Reveals

ShellBags answer investigative questions that few other artifacts can address:

Proof of Navigation, Not File Access

ShellBags prove the user navigated to a directory in Explorer. They do not prove the user opened a specific file within that directory. To prove file access, correlate ShellBag entries with Jump Lists (which record file opens), RecentDocs (MRU file lists), or $UsnJrnl (file system operations). ShellBags show where the user went; other artifacts show what they did there.

Forensic Use Cases

1. USB Data Staging and Exfiltration

An employee under investigation for IP theft denies ever using a USB drive at their workstation. ShellBags in UsrClass.dat show a complete directory tree browsed on drive E:\ with volume label KINGSTON_32GB: E:\Client_Data\, E:\Client_Data\Contracts\, E:\Client_Data\Financials\, and E:\Client_Data\Source_Code\. The ShellBag timestamps show navigation over a 45-minute window on the employee’s last day. The USB device is not in the company’s possession, but ShellBags reconstruct the folder structure the employee created on it. Cross-referencing with SYSTEM\MountedDevices and setupapi.dev.log confirms the Kingston device serial number.

2. Network Share Reconnaissance

During a lateral movement investigation, ShellBags reveal the attacker (using a compromised user account) navigated to \\DC01\C$\, \\DC01\C$\Windows\NTDS\, \\SQLSERVER\C$\Program Files\Microsoft SQL Server\, and \\FILESERVER\Finance\. This navigation pattern is consistent with a threat actor performing Active Directory reconnaissance (targeting ntds.dit), database server enumeration, and sensitive data discovery. The ShellBag timestamps establish the order and timing of the reconnaissance, which can be correlated with network logon events (Event ID 4624 Type 3).

3. Deleted Staging Directory

An attacker created a directory C:\ProgramData\Updates\Stage\ to collect files before exfiltration, then deleted the directory after completing the operation. The directory no longer exists on disk and does not appear in the $MFT (the MFT record has been reallocated). However, the ShellBag entry for C:\ProgramData\Updates\Stage\ persists in the user’s UsrClass.dat, proving the directory existed and the user navigated to it. The embedded Shell Item timestamps capture when the directory was created.

4. Removable Media Forensics Without the Device

In a child exploitation investigation, the suspect claims they never stored prohibited material on removable media. ShellBags contain entries for F:\Images\{folder_name}\ on a volume labeled SECURE_USB. The directory names and hierarchy are fully reconstructable from the ShellBag tree, providing evidence of folder structure even though the USB device has been destroyed. The ShellBag timestamps provide the time window of navigation.

5. ZIP Archive Browsing Evidence

A user received a ZIP file via email, browsed its contents in Explorer (without extracting), then deleted the ZIP file. The ZIP file is gone from disk and the Recycle Bin. However, ShellBags record the internal folder structure of the ZIP archive as if it were a regular directory tree. The investigator can prove which folders inside the archive the user navigated to, establishing awareness of the archive’s contents.

Shell Item Types

The binary Shell Item (SHITEMID) structures stored in BagMRU values come in several types, each encoding different metadata:

TypeIndicatorEmbedded MetadataForensic Notes
Root FolderClass type 0x1FKnown folder GUID (Desktop, This PC, Recycle Bin, Control Panel)Identifies the root of the navigation tree
Volume (Drive)Class type 0x2FDrive letterAppears for local drives, mapped drives
File EntryClass type 0x300x3FShort name, long name, created/modified/accessed timestamps, file size, MFT entry/sequenceMost common type; contains the richest metadata
Network LocationClass type 0x400x4FUNC path (\\server\share), network providerProves network share access; server name persists after share removal
ZIP/Compressed FolderClass type 0x52Archive path, internal folder nameExplorer treats ZIP files as folders; browsing inside creates ShellBag entries
FTP LocationDelegate itemFTP server hostname, pathExplorer FTP navigation (legacy) creates ShellBag entries
Timestamp Interpretation

The timestamps embedded in Shell Item structures are snapshots captured at the time the ShellBag entry was created. They reflect the folder’s MAC timestamps on the file system at the moment of navigation — not the time the user navigated to it. The registry key’s last-write timestamp is the best indicator of when the user actually visited the folder. Use both: the Shell Item timestamps for folder metadata, and the registry key timestamp for navigation timing.

Acquisition Methods

Collection Warning

UsrClass.dat is locked by the operating system while the user is logged on, just like NTUSER.DAT. Use Volume Shadow Copy, forensic imaging, or raw-disk copy. Always collect both UsrClass.dat (primary ShellBag location on Win 7+) and NTUSER.DAT (secondary location) along with their transaction logs (.LOG1, .LOG2). Incomplete collection means incomplete ShellBag data.

Live System — Volume Shadow Copy

CMD / ADMIN
:: Create a Volume Shadow Copy
vssadmin create shadow /for=C:

:: Copy UsrClass.dat and transaction logs
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3\Users\jdoe\AppData\Local\Microsoft\Windows\UsrClass.dat C:\Evidence\
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3\Users\jdoe\AppData\Local\Microsoft\Windows\UsrClass.dat.LOG1 C:\Evidence\
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3\Users\jdoe\AppData\Local\Microsoft\Windows\UsrClass.dat.LOG2 C:\Evidence\

:: Also collect NTUSER.DAT for secondary ShellBag data
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3\Users\jdoe\NTUSER.DAT C:\Evidence\

Live System — KAPE Collection

CMD / ADMIN
:: KAPE target for registry hives (includes UsrClass.dat and NTUSER.DAT)
kape.exe --tsource C: --tdest C:\Evidence\KAPE_Output --target RegistryHives

:: Velociraptor collection
:: Artifact: Windows.KapeFiles.Targets with target "RegistryHives"
:: Or: SELECT * FROM glob(globs="C:/Users/*/AppData/Local/Microsoft/Windows/UsrClass.dat*")

Forensic Image — Direct Extraction

BASH / FORENSICS
# Mount forensic image read-only
mount -o ro,noexec,nodev /dev/sdb1 /mnt/evidence

# Extract UsrClass.dat for all users
for user in /mnt/evidence/Users/*/; do
    uname=$(basename "$user")
    mkdir -p /analysis/shellbags/"$uname"
    cp "$user"AppData/Local/Microsoft/Windows/UsrClass.dat* /analysis/shellbags/"$uname"/ 2>/dev/null
    cp "$user"NTUSER.DAT /analysis/shellbags/"$uname"/ 2>/dev/null
done

Parsing Tools & Analysis

ToolAuthorLicenseOutputNotes
ShellBags ExplorerEric ZimmermanFreeGUIIndustry standard; tree view of ShellBag hierarchy; timeline view; transaction log replay
SBECmdEric ZimmermanFreeCSVCLI companion to ShellBags Explorer; batch processing for multiple hives
RegRipper (shellbags plugin)Harlan CarveyOpen sourceTextRegRipper shellbags and shellbags_tln plugins for timeline output
python-registry + ShellItemsWill BallenthinOpen sourcePython APIProgrammatic Shell Item parsing for custom analysis
AutopsySleuth KitOpen sourceGUIBuilt-in ShellBag parser in Recent Activity module

Parsing with SBECmd

CMD / FORENSICS
:: Parse UsrClass.dat to CSV
SBECmd.exe -d C:\Evidence --csv C:\Analysis\ShellBags

:: Parse a single hive
SBECmd.exe --hive C:\Evidence\UsrClass.dat --csv C:\Analysis\ShellBags

:: Output columns include:
::   AbsolutePath, CreatedOn, ModifiedOn, AccessedOn,
::   MFTEntryNumber, MFTSequenceNumber, ShellType,
::   Value, NodeSlot, LastWriteTime, BagPath

Analysis Script — Removable Media and Network Share Detection

PYTHON / ANALYSIS
import pandas as pd

df = pd.read_csv('/analysis/ShellBags/SBECmd_Output.csv')

# Filter for removable media paths (drive letters beyond C:)
removable = df[df['AbsolutePath'].str.match(r'^[D-Z]:\\', na=False)].copy()

# Filter for network share paths
network = df[df['AbsolutePath'].str.startswith('\\\\', na=False)].copy()

print('=== REMOVABLE MEDIA PATHS ===')
for _, row in removable.iterrows():
    print(f'  {row["LastWriteTime"]:<22} {row["AbsolutePath"]}')

print('\n=== NETWORK SHARE PATHS ===')
for _, row in network.iterrows():
    print(f'  {row["LastWriteTime"]:<22} {row["AbsolutePath"]}')

Sample Output

OUTPUT
=== REMOVABLE MEDIA PATHS ===
  2026-03-18 22:15:00    E:\Client_Data
  2026-03-18 22:18:00    E:\Client_Data\Contracts
  2026-03-18 22:23:00    E:\Client_Data\Financials
  2026-03-18 22:31:00    E:\Client_Data\Source_Code
  2026-03-18 22:45:00    E:\Backups

=== NETWORK SHARE PATHS ===
  2026-03-15 14:02:00    \\FILESERVER01\Projects
  2026-03-15 14:05:00    \\FILESERVER01\Projects\ClientA
  2026-03-16 21:30:00    \\FILESERVER01\HR_Confidential
  2026-03-16 21:32:00    \\FILESERVER01\HR_Confidential\Exec_Comp
  2026-03-17 02:14:00    \\DC01\C$\Windows\NTDS

Retention & Persistence

PropertyBehavior
Retention periodIndefinite — no automatic pruning or garbage collection exists
Survives rebootYes
Survives folder deletionYes — ShellBag entries persist after the target folder is deleted from disk
Survives media disconnectionYes — entries for USB drives and network shares persist indefinitely after disconnection
Survives application uninstallN/A (ShellBags track folder navigation, not application execution)
Survives OS upgradeGenerally yes; in-place upgrades preserve user profile hives
Growth over timeShellBag count grows monotonically — entries are added but never automatically removed
Typical entry countActive users may have hundreds to thousands of ShellBag entries accumulated over the profile’s lifetime
Retention Note

ShellBags are among the longest-retention artifacts on a Windows system. On a user profile that has been active for several years, the ShellBag tree may contain thousands of entries spanning the entire period. This makes ShellBags particularly valuable in cases where the incident timeline extends months or years into the past and other artifacts (event logs, Prefetch) have rolled over.

Anti-Forensics Resilience

ShellBags are highly resilient to anti-forensics activity. They are stored in a system-protected registry hive that is locked while the user is logged on, and no widely deployed consumer cleanup tool targets them.

ToolClears ShellBags?Explanation
CCleanerNoNo ShellBag module; does not target UsrClass.dat or BagMRU/Bags keys
BleachBitNoNo ShellBag cleaner exists in any version
Privacy EraserNoDoes not target ShellBag registry locations
Windows Disk CleanupNoSystem cleanup does not target user registry hives
“Clear activity history”NoWindows privacy settings do not clear ShellBag data
SDelete / cipher /wNoCannot target locked registry hive files
Manual registry deletionPossible but rareUser must know the exact BagMRU/Bags key paths in two separate hives; deleted keys may be recoverable from unallocated hive space
ShellBag cleaner toolsPartialNiche tools like “Shellbag Analyzer & Cleaner” exist but are extremely uncommon; may not clean both hive locations
Why ShellBags Survive

ShellBags are stored in UsrClass.dat, a hidden system file in a deeply nested AppData path. The BagMRU/Bags key structure is undocumented binary data that appears meaningless in a standard registry editor. No consumer cleanup tool (CCleaner, BleachBit, Windows Disk Cleanup, Windows privacy settings) has ever included a ShellBag cleaning module. Even forensically aware adversaries who clear event logs, browser history, and Prefetch almost never address ShellBags because the artifact is obscure and the data is not human-readable without specialized parsing tools.

MITRE ATT&CK Detection Mapping

ShellBag data provides evidentiary support for detecting the following MITRE ATT&CK techniques:

TechniqueNameShellBag Evidence
T1083 T1083File and Directory DiscoveryShellBag entries prove the user navigated through directory structures; breadth and depth of navigation indicates reconnaissance
T1005 T1005Data from Local SystemShellBag entries for sensitive local directories (e.g., C:\Users\{admin}\Documents\, C:\ProgramData\) prove navigation to data collection targets
T1039 T1039Data from Network Shared DriveUNC paths in ShellBags prove navigation to network shares; server names and share paths are recorded
T1135 T1135Network Share DiscoveryShellBag entries for administrative shares (\\server\C$, \\server\ADMIN$) prove share enumeration
T1074 T1074Data StagedShellBag entries for staging directories on removable media or temporary folders prove data staging activity
T1052 T1052Exfiltration Over Physical MediumShellBag entries for removable media drive letters with folder hierarchies prove data was organized on external storage

Related Artifacts & Cross-References

Corroborating Artifacts

ArtifactRelationship to ShellBagsCross-Correlation Value
Jump ListsRecords files opened per applicationShellBags prove folder navigation; Jump Lists prove file access within those folders
NTUSER.DAT (TypedPaths)Paths manually typed into Explorer address barTypedPaths proves intentional navigation; ShellBags capture subsequent folder browsing
LNK FilesShortcuts created by file accessLNK files record specific file targets; ShellBags record directory navigation context
$MFTFile system metadata with timestampsShell Item MFT entry/sequence numbers in ShellBags can be cross-referenced with $MFT records
MountPoints2 (NTUSER.DAT)Mounted volumes and network sharesMountPoints2 proves a volume was mounted; ShellBags prove which folders within it were navigated
SYSTEM\MountedDevicesMaps volume serial numbers to device identifiersShellBag drive letter entries + MountedDevices = specific physical device identification
setupapi.dev.logDevice installation historyConfirms when USB devices were first connected; ShellBags show subsequent folder navigation on those devices

References

  1. Eric Zimmerman, “ShellBags Explorer & SBECmd” — https://ericzimmerman.github.io/
  2. Harlan Carvey, “Windows Registry Forensics, 2nd Edition” — ShellBags chapter
  3. Joachim Metz, “Windows Shell Items Format Specification” — https://github.com/libyal/libfwsi
  4. SANS Institute, “ShellBags Forensics” — https://www.sans.org/blog/
  5. 13Cubed, “Windows ShellBags for DFIR” — https://www.13cubed.com/blog
  6. ForensicArtifacts.com, “ShellBags Artifact Definition” — https://github.com/ForensicArtifacts/artifacts
  7. Vincent Lo, “Advanced ShellBag Forensics” — SANS Reading Room

Mjolnir Security — Digital Forensics & Incident Response

Mjolnir Security provides 24/7 incident response, digital forensics, and expert witness testimony. Our DFIR team specializes in ShellBag analysis, folder navigation reconstruction, and removable media forensics in insider threat and data exfiltration cases.

Digital ForensicsIncident ResponseExpert WitnessArtifact AnalysisInsider ThreatRemovable Media

mjolnirsecurity.com — 24/7: +1 833 403 5875