Detect Peripheral Device Discovery in Elastic Security
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/
Elastic Detection Query
sequence by host.name, user.name with maxspan=5m
[process where event.type == "start" and (
(process.name : "wmic.exe" and process.args : ("logicaldisk", "diskdrive", "USBHub", "USBController", "PhysicalMedia", "CDROMDrive", "Win32_USB*", "PnPEntity", "printer")) or
(process.name : ("powershell.exe", "pwsh.exe") and process.args : ("Win32_USBHub", "Win32_USBController", "Win32_DiskDrive", "Win32_PhysicalMedia", "Win32_CDROMDrive", "Win32_PrinterConfiguration", "Win32_Printer", "Win32_PnPEntity", "Win32_SoundDevice", "Get-PnpDevice", "Get-PnpDevice", "DriveInfo", "GetDrives", "Get-Volume", "Get-Disk")) or
(process.name : "fsutil.exe" and process.args : ("fsinfo", "drives")) or
(process.name : "reg.exe" and process.args : ("USBSTOR", "Enum\\USB"))
)] Detects peripheral device discovery activity on Windows endpoints. Identifies use of wmic.exe, PowerShell, fsutil, and reg.exe to enumerate USB devices, printers, disk drives, PnP devices, and USB registry history — techniques commonly used by ransomware, RATs, and APT groups to profile connected hardware.
Data Sources
Required Tables
False Positives & Tuning
- IT asset management tools (e.g., Lansweeper, SCCM hardware inventory) that regularly enumerate connected devices using WMI queries
- System administrators running diagnostic scripts to inventory USB devices or printers across managed endpoints
- Security tools and EDR agents performing hardware fingerprinting or baseline enumeration during system health checks
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.
- 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.
- 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.
- 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.
- 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.
- 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.
References (12)
- https://attack.mitre.org/techniques/T1120/
- https://linuxhint.com/list-usb-devices-linux/
- https://ss64.com/osx/system_profiler.html
- https://www.cybereason.com/blog/threat-alert-inc-ransomware
- https://securelist.com/scarcruft-surveilling-north-korean-defectors-and-human-rights-activists/90065/
- https://www.welivesecurity.com/2020/12/02/turla-crutch-keeping-back-door-open/
- https://www.mandiant.com/resources/blog/roadsweep-ransomware-chimneysweep
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1120/T1120.md
- https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-diskdrive
- https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-usbhub
- https://learn.microsoft.com/en-us/windows-hardware/drivers/install/inf-classinstall32-services-section
- https://www.sans.org/blog/openssh-client-enumeration/
Unlock Pro Content
Get the full detection package for T1120 including response playbook, investigation guide, and atomic red team tests.