Skip to content

USB & external devices

USB device history

USB forensics cheat sheet: USBSTOR and USB keys, serial numbers, first and last connection times, drive letters, volume serials, setupapi.dev.log and event IDs.

Location
SYSTEM\CurrentControlSet\Enum\USBSTOR
Proves
Which USB storage devices were connected, when first and last, and by which user
Timestamps
Properties 0064 to 0067 and MountPoints2 LastWrite as FILETIME, UTC; setupapi.dev.log in local time; event logs in UTC
Retention
Keys persist until uninstall or cleanup; feature updates can reset USBSTOR and setupapi.dev.log; event logs roll over
Access
Administrator; SYSTEM, SOFTWARE and NTUSER.DAT locked live: collect via raw NTFS (KAPE) or VSS; setupapi logs copy directly
Type
Registry
Windows
XPVista / 78 / 8.11011
KAPE target
RegistryHivesSystemRegistryHivesUserUSBDevicesLogsEventLogs
Velociraptor
Windows.Triage.Targets:RegistryHivesSystemRegistryHivesUserUSBDevicesLogsEventLogs

What it is

Windows keeps several independent records every time a USB device is plugged in: the Plug and Play manager registers the device in the SYSTEM hive, the mount manager assigns a drive letter, the user's profile records the mount point, the driver installation is logged in a text file, and on Windows 10/11 several event logs capture the connection. No single source is complete; the investigation consists in correlating them around the device's serial number and the volume's serial number.

Location

ArtifactLocationWindows
USB storage devicesSYSTEM\ControlSet00x\Enum\USBSTOR\<Disk&Ven_&Prod_&Rev_>\<serial>All
All USB devices (VID/PID)SYSTEM\ControlSet00x\Enum\USB\VID_xxxx&PID_yyyy\<serial>All
Connection times...\<serial>\Properties\{83da6326-97a6-4088-9453-a1923f573b29}\0064 / 0065 / 0066 / 00670064/0065: 7+; 0066/0067: 8+
Drive letters and volume GUIDsSYSTEM\MountedDevicesAll
Friendly names (phones, MTP, drives)SOFTWARE\Microsoft\Windows Portable Devices\DevicesVista+
Volume serial number (ReadyBoost)SOFTWARE\Microsoft\Windows NT\CurrentVersion\EMDMgmtVista+ (not populated when the system disk is an SSD)
User who mounted itNTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{volume GUID}All
First installationC:\Windows\inf\setupapi.dev.log (C:\Windows\setupapi.log on XP)All
Connection eventsMicrosoft-Windows-Partition/Diagnostic 1006; Microsoft-Windows-Kernel-PnP/Configuration 400/410; Microsoft-Windows-DriverFrameworks-UserMode/Operational (disabled by default)10 / 11

What it proves

  • A USB storage device with a given vendor, product and serial number was connected to this host.
  • When: first installation, last connection and last removal (Windows 8+), plus individual connections from event logs.
  • Which drive letter it received and, through MountPoints2, which user was logged on when it was mounted.
  • With the volume serial number, you can tie the device to LNK files, Jump Lists and ShellBags that reference files on it.
  • A serial whose second character is & was generated by Windows because the device has no unique serial; it is not stable across hosts.

Key fields

FieldMeaning
USBSTOR subkey nameDevice class, vendor, product and revision
Serial subkey nameDevice serial (or Windows-generated ID)
FriendlyNameName shown to the user
ContainerIDLinks the USBSTOR entry to the matching Enum\USB and other entries
0064First install date
0065Install date (last driver install)
0066Last arrival (connection) date
0067Last removal date
MountedDevices value dataLinks \DosDevices\E: or a volume GUID to the device ID

Timestamps

TimestampSet whenFormatPitfalls
0064–0067 PropertiesDevice install, arrival, removalFILETIME, UTCOnly the first and most recent events are kept
setupapi.dev.log "Section start" linesDriver installationText, local timeConvert with the host's time zone (UTC vs local time)
MountPoints2\{GUID} LastWriteVolume mounted in that user's sessionFILETIME, UTCLast mount for that user
Partition/Diagnostic 1006Every connection/volume mountUTCIncludes disk capacity, serials and partition data (sometimes the VBR)

Retention and clearing

  • Registry entries persist until removed (Device Manager uninstall, cleanup tools such as USBOblivion).
  • Windows feature updates can remove USBSTOR and related Enum keys and recreate setupapi.dev.log; migrated device data may survive under SYSTEM\Setup\Upgrade\Pnp\CurrentControlSet\Control\DeviceMigration, and older hives may exist in Windows.old and shadow copies.
  • Event logs roll over; the Partition/Diagnostic channel is usually small.

Collection

  • KAPE targets: RegistryHivesSystem, RegistryHivesUser, USBDevicesLogs (setupapi logs) and EventLogs; the compound target USBDetective bundles them.
  • Velociraptor (Windows.Triage.Targets): the same names; Windows.Registry.MountPoints2 and Windows.Detection.Thumbdrives.List help live.
  • Built-in:
reg query HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR /s
reg query HKLM\SYSTEM\MountedDevices
findstr /i "USBSTOR" C:\Windows\inf\setupapi.dev.log
wevtutil qe Microsoft-Windows-Partition/Diagnostic /f:text /c:20

Parsing tools

  • Registry Explorer / RECmd (Eric Zimmerman): USB-related bookmarks and batch files.
  • RegRipper: usbstor, usb, mountdev, mp2 plugins.
  • USBDeview (NirSoft): live overview of every device ever connected.
  • EvtxECmd: maps for Partition/Diagnostic 1006 and Kernel-PnP events.

Investigation tips

  • Pivot on the device serial across USBSTOR, USB, MountedDevices and Windows Portable Devices, then on the volume serial number to LNK and Jump List entries.
  • Build a connection timeline from Partition/Diagnostic 1006: it records each connection, unlike the registry, which keeps first and last only.
  • Compare 0066 / 0067 with SRUM and file activity to show data was copied during the connection window.
  • Check whether a feature update happened after the incident before concluding that a device was never connected.
  • Phones and cameras (MTP) appear under Windows Portable Devices and in ShellBags, not in USBSTOR.

Related artifacts

Glossary terms

Guides

All artifacts on one page: cheat sheet