T1120 Splunk · SPL

Detect Peripheral Device Discovery in Splunk

Adversaries may attempt to gather information about attached peripheral devices and components connected to a computer system. Peripheral devices could include auxiliary resources that support a variety of functionalities such as keyboards, printers, cameras, smart card readers, or removable storage. The information may be used to enhance their awareness of the system and network environment or may be used for further actions — ransomware families identify removable drives for encryption and printers for ransom note delivery, RATs enumerate cameras and Bluetooth devices for surveillance capability profiling, and APT groups map USB storage history to understand data exfiltration opportunities.

MITRE ATT&CK

Tactic
Discovery
Technique
T1120 Peripheral Device Discovery
Canonical reference
https://attack.mitre.org/techniques/T1120/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(
  (Image="*\\wmic.exe" AND (
    CommandLine="*logicaldisk*" OR CommandLine="*diskdrive*" OR
    CommandLine="*USBHub*" OR CommandLine="*USBController*" OR
    CommandLine="*PhysicalMedia*" OR CommandLine="*CDROMDrive*" OR
    CommandLine="*Win32_USB*" OR CommandLine="*PnPEntity*" OR
    CommandLine="*printer*"
  ))
  OR ((Image="*\\powershell.exe" OR Image="*\\pwsh.exe") AND (
    CommandLine="*Win32_DiskDrive*" OR CommandLine="*Win32_USBHub*" OR
    CommandLine="*Win32_USBController*" OR CommandLine="*Get-PnpDevice*" OR
    CommandLine="*Win32_LogicalDisk*" OR CommandLine="*Win32_Printer*" OR
    CommandLine="*Win32_CDROMDrive*" OR CommandLine="*Win32_PnPEntity*" OR
    CommandLine="*DriveInfo*" OR CommandLine="*Get-Volume*" OR CommandLine="*Get-Disk*"
  ))
  OR (Image="*\\fsutil.exe" AND CommandLine="*fsinfo drives*")
  OR (Image="*\\reg.exe" AND (CommandLine="*USBSTOR*" OR CommandLine="*Enum\\USB*"))
)
| eval USBEnum=if(match(CommandLine, "(?i)(USBHub|USBController|Win32_USBController|Win32_DiskDrive|USBSTOR|Win32_USBHub)"), 1, 0)
| eval PrinterEnum=if(match(CommandLine, "(?i)(printer|Win32_Printer|PrinterConfiguration)"), 1, 0)
| eval DriveEnum=if(match(CommandLine, "(?i)(logicaldisk|Win32_LogicalDisk|fsinfo\s+drives|DriveInfo|Get-Volume|Get-Disk|PhysicalMedia)"), 1, 0)
| eval PnPEnum=if(match(CommandLine, "(?i)(PnpDevice|PnPEntity|CDROMDrive|Win32_SoundDevice)"), 1, 0)
| eval RegistryEnum=if(match(CommandLine, "(?i)(USBSTOR|Enum.USB)"), 1, 0)
| eval EnumerationType=case(
    USBEnum=1, "USB_Device",
    PrinterEnum=1, "Printer",
    DriveEnum=1, "Drive_Enumeration",
    PnPEnum=1, "PnP_Device",
    RegistryEnum=1, "USB_Registry_Enum",
    true(), "General_Peripheral"
  )
| eval SuspicionScore=USBEnum + PrinterEnum + DriveEnum + PnPEnum + RegistryEnum
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, EnumerationType, USBEnum, PrinterEnum, DriveEnum, PnPEnum, RegistryEnum, SuspicionScore
| sort - _time
medium severity medium confidence

Detects peripheral device discovery using Sysmon Event ID 1 (Process Creation). Identifies WMIC queries for USB hubs, controllers, disk drives, printers, and PnP entities; PowerShell WMI queries using Win32_DiskDrive, Win32_USBHub, Win32_LogicalDisk, Get-PnpDevice, Get-Volume, and Get-Disk; fsutil drive listing; and reg.exe queries to USBSTOR or USB enumeration registry paths. Classifies each detection by enumeration type and assigns a cumulative suspicion score. USB_Device and USB_Registry_Enum types with high suspicion scores warrant immediate investigation, especially when the parent process is an unexpected shell or script interpreter.

Data Sources

Process: Process CreationCommand: Command ExecutionSysmon Event ID 1

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • IT asset management and hardware inventory tools (SCCM hardware inventory running under CcmExec.exe, Tanium, Lansweeper, Spiceworks) that periodically query WMI for device configuration
  • Disk health and monitoring software (CrystalDiskInfo, SMART monitoring agents, backup software like Veeam or Acronis) that enumerate drives at startup or on schedule
  • Help desk and remote support tools (TeamViewer, ConnectWise, Dameware) that collect hardware information automatically when a session starts
  • Data Loss Prevention (DLP) agents that legitimately monitor USB connections will themselves query USBSTOR registry paths and WMI USB classes — identify DLP agent executables and exclude them
  • Legitimate system administration scripts using Get-PnpDevice or wmic for driver troubleshooting and device inventory audits
Download portable Sigma rule (.yml)

Other platforms for T1120


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1USB Hub and Disk Enumeration via WMIC

    Expected signal: Sysmon Event ID 1: Two Process Create events with Image=wmic.exe. First CommandLine contains 'Win32_USBHub' and 'DeviceID,Name,Description'. Second CommandLine contains 'Win32_DiskDrive' and 'MediaType' and 'Removable Media'. Security Event ID 4688 (if command line auditing enabled) for both executions. Microsoft-Windows-WMI-Activity/Operational shows the WMI namespace queries.

  2. Test 2Removable Drive Discovery via PowerShell WMI and PnP

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Win32_LogicalDisk', 'DriveType', 'eq 2', and 'Get-PnpDevice'. PowerShell ScriptBlock Log Event ID 4104 with full deobfuscated script content showing the WMI query with DriveType filter. Console output lists all removable drives with DeviceID and volume names.

  3. Test 3Printer Enumeration via WMIC for Ransom Note Targeting

    Expected signal: Sysmon Event ID 1: Process Create with Image=wmic.exe, CommandLine containing 'printer' and 'PortName,DriverName'. Security Event ID 4688 with full command line. Microsoft-Windows-WMI-Activity/Operational Event ID 5857 showing the Win32_Printer provider loaded. Output lists all configured printers with network vs local status.

  4. Test 4Drive Letter Enumeration via fsutil LOLBin

    Expected signal: Sysmon Event ID 1: Process Create with Image=fsutil.exe, CommandLine='fsutil fsinfo drives'. Security Event ID 4688 if command line auditing is enabled. Output format: 'Drives: C:\ D:\ E:\' — presence of multiple drives beyond C:\ indicates attached removable or additional storage.

  5. Test 5USB Device History Extraction from Registry

    Expected signal: Sysmon Event ID 1: Process Create for reg.exe with CommandLine containing 'USBSTOR'. Sysmon Event ID 12 or 13: RegistryEvent for HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR registry key queries (if registry monitoring is configured for this path). Security Event ID 4663 if object access auditing is enabled on the USBSTOR registry key. Output contains all USB device classes with vendor IDs, product IDs, and serial numbers.

Unlock Pro Content

Get the full detection package for T1120 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections