USB & External Device Forensics - SOC Analyst Cheatsheet
Practical Guide for USB Device Investigation & Data Exfiltration
Quick Reference: USB Artifacts Matrix
USBSTOR
Device identity
SYSTEM hive
Persistent
Vendor, product, serial
MountPoints2
User attribution
NTUSER.DAT
Persistent
Which user accessed device
Timestamps
Connection times
SYSTEM hive, setupapi.dev.log
Medium
First/last connect, removal
Volume Serial Number
Device-to-file linking
Event 1006, EMDMgmt
Medium
Critical for LNK correlation
Drive Letters
Mount points
MountedDevices
Last only
Historical not available
Investigation Priority Matrix
CRITICAL
USBSTOR + USB
Device identification
Vendor, product, serial number
CRITICAL
Volume Serial Number
File access correlation
Links USB to LNK files
CRITICAL
MountPoints2
User attribution
Which user accessed USB
HIGH
Connection Timestamps
Timeline construction
First/last connection times
MEDIUM
Drive Letters
Current mapping
Drive letter assignments
Core Investigation Questions
Primary Questions:
What devices connected? (USBSTOR - Device identification)
When did they connect? (Timestamps - Timeline)
Who accessed them? (MountPoints2 - User attribution)
What files were accessed? (VSN + LNK files - File correlation)
The Critical Link:
Volume Serial Number (VSN) is the KEY to linking USB devices to file access via LNK files!
Understanding USB Forensics Components
Key Concept: Multiple Serial Numbers
DO NOT CONFUSE:
USB Unique Serial
Device firmware serial
USBSTOR key
Identifies physical USB device
Volume Serial Number (VSN)
File system serial
Event 1006, EMDMgmt, LNK files
Links device to files accessed
Printed Serial
Label on device
Physical device
May not match internal serial
Critical Understanding:
SOC Investigation Workflows
Workflow 1: Data Exfiltration Investigation (CRITICAL)
Scenario: Suspected data theft via USB drive
Investigation Steps (Priority Order):
Step 1: Identify ALL USB Devices Connected
Registry Location: SYSTEM\CurrentControlSet\Enum\USBSTOR
PowerShell - Enumerate USB Devices:
Key USBSTOR Fields:
Vendor - Manufacturer (Kingston, SanDisk, etc.)
Product - Model name
Version/Revision - Firmware version
Serial Number - Device identifier
FriendlyName - Windows display name
ParentIdPrefix - Links USBSTOR to SCSI key
Red Flags:
β Unknown vendors (unrecognised brands)
β Multiple similar devices (many USBs in short time)
β Recently connected devices during incident window
β Windows-generated serials (& in 2nd position = device lacks unique serial)
Step 2: Extract Connection Timestamps (First/Last Connection)
Three Sources for Timestamps:
A. SYSTEM Registry Properties Keys (Most Reliable)
Location:
PowerShell - Extract Timestamps:
B. setupapi.dev.log (First Connection - LOCAL TIMEZONE!)
Location: C:\Windows\inf\setupapi.dev.log
CRITICAL: Timestamps in LOCAL TIMEZONE (not UTC like most forensic artifacts!)
PowerShell - Parse setupapi.dev.log:
C. Event ID 1006 (Connection/Disconnection Events)
Location: Microsoft-Windows-Partition/Diagnostic.evtx
Event ID 1006: Logged for each USB connect/disconnect
Caveat: Log cleared during major OS updates
PowerShell - Parse Event 1006:
Timestamp Summary Table:
Properties 0064
First Install
UTC
High
Win7+
Properties 0066
Last Connected
UTC
High
Win8+
Properties 0067
Last Removal
UTC
High
Win8+
setupapi.dev.log
First Connection
LOCAL
High
Persistent
Event 1006
Each connect/disconnect
UTC
Medium
Cleared on updates
Step 3: Identify User Attribution (MountPoints2)
Critical for Attribution: Which user account accessed the USB device?
Registry Location: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2
How It Works:
USB device assigned Volume GUID
User accesses USB β MountPoints2 entry created in their NTUSER.DAT
Volume GUID links to specific USB device
PowerShell - Check Current User:
Offline Analysis (All Users):
Step 4: Extract Volume Serial Number (VSN) - THE CRITICAL LINK
Why VSN is Critical:
Three Methods to Get VSN:
Method 1: Event ID 1006 (Windows 10+)
Event 1006 may include VBR (Volume Boot Record) data containing VSN
VSN Location in VBR:
FAT: Offset 0x43 (4 bytes)
exFAT: Offset 0x64 (4 bytes)
NTFS: Offset 0x48 (8 bytes, but only first 4 bytes used)
Method 2: EMDMgmt Registry Key (Legacy)
Location: SOFTWARE\Microsoft\Windows NT\CurrentVersion\EMDMgmt
Caveat: Often missing on modern systems with SSDs
PowerShell - Extract from EMDMgmt:
Method 3: Cross-Reference with LNK Files (Most Reliable)
LNK files contain VSN! Extract from LNK files and correlate back to USB devices.
Using LECmd (Zimmerman Tool):
Step 5: Correlate Device to File Access (THE KEY CORRELATION)
Critical Workflow:
Extract USB Device Info:
Device serial number (USBSTOR)
Connection timestamps (Properties keys)
User who accessed it (MountPoints2)
Extract VSN:
From Event 1006 or EMDMgmt
OR from LNK files (DriveType = Removable)
Find LNK Files with Matching VSN:
Parse all LNK files with LECmd
Filter for matching VolumeSerialNumber
These LNK files = files accessed from that USB
Build Timeline:
USB connected at time X
Files accessed (LNK timestamps)
USB disconnected at time Y
Complete Correlation Script:
Step 6: Identify Drive Letter Assignments
Registry Location: SYSTEM\MountedDevices
Caveat: Only shows LAST drive letter assignment (no historical record)
PowerShell - Check Drive Letters:
Complete USB Investigation Script
Real Investigation Scenarios
Scenario 1: Data Exfiltration via USB
Evidence Chain:
Timeline:
Scenario 2: Unauthorised Device Usage
Evidence Chain:
Scenario 3: VSN Correlation Success
Investigation Steps:
Quick Reference Commands
Registry Queries
PowerShell One-Liners
Investigation Checklists
USB Data Exfiltration Investigation
[ ] Enumerate all USB devices (USBSTOR)
[ ] Extract connection timestamps (Properties 0064/0066/0067)
[ ] Identify Windows-generated serials (& in 2nd position)
[ ] Check MountPoints2 for user attribution
[ ] Parse LNK files with LECmd
[ ] Filter LNK for DriveType = "Removable"
[ ] Extract Volume Serial Numbers from LNK files
[ ] Correlate VSN to USB device
[ ] Build timeline: connect β access β disconnect
[ ] Check for file deletion (Recycle Bin)
[ ] Cross-reference with Recent Files registry
[ ] Document complete evidence chain
Unauthorised Device Investigation
[ ] Identify unknown/suspicious devices (USBSTOR)
[ ] Check connection times (off-hours indicator)
[ ] Verify authorised device list
[ ] Check user attribution (MountPoints2)
[ ] Look for malware/suspicious files (LNK + Prefetch)
[ ] Review execution artifacts (Prefetch, BAM)
[ ] Check for policy violations
[ ] Document user and device details
Timeline Construction
[ ] Extract all timestamp sources (0064/0066/0067)
[ ] Parse setupapi.dev.log (LOCAL timezone!)
[ ] Parse Event 1006 (if available)
[ ] Extract LNK file access times
[ ] Correlate all timestamps in single timeline
[ ] Note timezone differences
[ ] Build narrative of events
USB Forensics Tools
Essential Tools
Zimmerman Tools:
LECmd - LNK file parser (CRITICAL for VSN extraction)
Registry Explorer - Offline registry analysis
Timeline Explorer - Timeline visualisation
NirSoft:
USBDeview - GUI USB device viewer
USBLogView - setupapi.dev.log parser
Microsoft:
Registry Editor - Live registry queries
Event Viewer - Event 1006 analysis
Best Practices
Live Response
β DO:
Collect registry hives (SYSTEM, SOFTWARE, NTUSER.DAT)
Copy setupapi.dev.log immediately
Export Event 1006 before it's cleared
Collect all LNK files from all users
Document current time and timezone
Hash all collected artifacts
β DON'T:
Plug in your own USB (creates new entries!)
Modify registry during investigation
Forget timezone differences (setupapi = LOCAL)
Skip LNK file collection (VSN source!)
Offline Analysis
β DO:
Load registry hives read-only
Parse all user NTUSER.DAT files
Correlate VSN across all sources
Cross-reference with LNK files
Build complete timeline
Validate all correlations
β DON'T:
Rely on single artifact
Skip VSN correlation
Ignore setupapi timezone
Forget about Windows-generated serials
Summary: Critical Takeaways
The Most Important Concept
Volume Serial Number (VSN) is THE KEY:
Key Differences to Remember
USB Unique Serial
Identifies physical USB
USBSTOR registry
Volume Serial Number (VSN)
Identifies file system
LNK files, Event 1006
Printed Serial
Marketing label
Physical device
Top 5 USB Investigation Steps
USBSTOR - Identify devices connected
Timestamps - When connected (0064/0066/0067)
MountPoints2 - Who accessed device
VSN - Extract from LNK files
Correlation - Match VSN to prove file access
Critical Registry Paths
Key Principle
USB forensics requires correlation of multiple artifacts. The Volume Serial Number (VSN) from LNK files is your most reliable evidence linking a USB device to specific file access. Always cross-reference USBSTOR, timestamps, MountPoints2, and LNK files to build complete evidence chain.
Remember: Volume Serial Number (VSN) is THE critical link between USB devices and files accessed. Extract VSN from LNK files (DriveType=Removable) and correlate with USB device records. This proves which files were accessed from which USB device!
Last updated