Replication Through Removable Media
Adversaries may move onto systems, possibly those on disconnected or air-gapped networks, by copying malware to removable media and taking advantage of Autorun features when the media is inserted into a system. This technique serves dual purposes: Initial Access (introducing malware into isolated or air-gapped environments) and Lateral Movement (propagating between networked systems via USB). Common implementations include creating autorun.inf files that auto-execute malware on media insertion, copying malicious executables to the drive root disguised as legitimate files, and creating LNK shortcut files that silently execute hidden payloads. Notable threat actors include Stuxnet (targeting air-gapped ICS/SCADA networks via CVE-2010-2568 LNK vulnerability), Flame (modular USB infection framework), Gamaredon Group (LNK files on all removable and network drives via UserAssist persistence), Mustang Panda and APT30 (customized PlugX USB variants), Raspberry Robin (worm spread via infected USB media), HIUPAN (periodic drive polling for propagation), and Aoqin Dragon (removable device dropper for breaching secure network environments).
What is T1091 Replication Through Removable Media?
Replication Through Removable Media (T1091) maps to the Lateral Movement and Initial Access tactics — the adversary is trying to move through your environment in MITRE ATT&CK.
This page provides production-ready detection logic for Replication Through Removable Media, covering the data sources and telemetry it touches: File: File Creation, File: File Modification, Process: Process Creation, Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Lateral Movement Initial Access
- Canonical reference
- https://attack.mitre.org/techniques/T1091/
let NonSystemDrivePattern = @"(?i)^[d-z]:\\";
let DriveRootPattern = @"(?i)^[d-z]:\\$";
let SuspiciousExtensions = dynamic([".exe", ".dll", ".bat", ".cmd", ".vbs", ".js", ".lnk", ".hta", ".ps1", ".scr", ".pif", ".com"]);
// Signal 1: autorun.inf creation on non-system drive — classic USB worm indicator (Stuxnet, Agent.btz, Flame)
let AutorunInfSignal = DeviceFileEvents
| where Timestamp > ago(24h)
| where FileName =~ "autorun.inf"
| where FolderPath matches regex NonSystemDrivePattern
| where not(FolderPath startswith @"\\\\")
| extend Signal = "AutorunInfCreated", SignalSeverity = "High", RiskScore = 90;
// Signal 2: Executable or script written to root of non-system drive (PlugX, HIUPAN, DustySky pattern)
let ExecAtDriveRootSignal = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified")
| where FolderPath matches regex DriveRootPattern
| where FileName has_any (SuspiciousExtensions)
| where not(FolderPath startswith @"\\\\")
| extend Signal = "ExecutableAtDriveRoot", SignalSeverity = "High", RiskScore = 85;
// Signal 3: Executable written to non-system drive by unexpected initiating process
let ExecOnRemovableSignal = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified")
| where FolderPath matches regex NonSystemDrivePattern
| where not(FolderPath startswith @"\\\\")
| where FileName has_any (SuspiciousExtensions)
| where InitiatingProcessFileName !in~ ("explorer.exe", "robocopy.exe", "xcopy.exe",
"msiexec.exe", "setup.exe", "install.exe", "installer.exe")
| extend Signal = "SuspiciousExecOnRemovableMedia", SignalSeverity = "Medium", RiskScore = 65;
// Signal 4: Process launched directly FROM non-system drive (Raspberry Robin, Aoqin Dragon pattern)
let ProcFromRemovableSignal = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FolderPath matches regex NonSystemDrivePattern
| where not(FolderPath startswith @"\\\\")
| extend Signal = "ProcessLaunchedFromRemovableMedia", SignalSeverity = "High", RiskScore = 88;
union AutorunInfSignal, ExecAtDriveRootSignal, ExecOnRemovableSignal, ProcFromRemovableSignal
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
Signal, SignalSeverity, RiskScore,
InitiatingProcessFileName, InitiatingProcessCommandLine,
SHA256
| sort by RiskScore desc, Timestamp desc Multi-signal detection for T1091 Replication Through Removable Media using Microsoft Defender for Endpoint DeviceFileEvents and DeviceProcessEvents tables. Monitors four high-fidelity indicators: (1) autorun.inf creation on non-system drives — the classic worm propagation mechanism used by Stuxnet, Agent.btz, and Flame with essentially no legitimate modern use; (2) executables written to the root directory of non-system drives — preferred placement for disguised USB malware; (3) executables written anywhere on non-system drives by unexpected initiating processes, excluding common legitimate file-copy utilities; and (4) process execution originating directly from non-system drive paths. Uses regex matching against drive letter patterns to identify non-C: drive activity while excluding UNC network share paths. Risk scores enable analyst triage prioritization across signal types.
Data Sources
Required Tables
False Positives
- Software installations from USB drives — legitimate setup.exe or msiexec.exe processes writing executable files to D: or E: drives during product installation or portable app setup
- Backup software (Acronis, Veeam, Windows Backup, robocopy scripts) writing backup archives or system images containing executables to external USB hard drives on scheduled backup paths
- IT administrators manually copying diagnostic tools, deployment packages, or OS installers to removable media for endpoint remediation or imaging tasks
- Portable application suites (PortableApps.com platform, U3 smart drive) that legitimately store and execute full application stacks from USB drives by design
- Multi-drive workstations where D:, E:, or other letters refer to secondary fixed internal drives (NVMe, SSD, HDD) rather than removable media — tuning against known fixed drive letters in your environment is required
- Developer workflows using large external drives to store build toolchains, compilers, or VM images accessed directly from non-C: drive paths
Sigma rule & cross-platform mapping
The detection logic for Replication Through Removable Media (T1091) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1091
References (5)
- https://attack.mitre.org/techniques/T1091/
- https://www.threatexpert.com/report.aspx?md5=4c48f0dc5c55e26d5b68dfafe2e54b31
- https://www.sentinelone.com/labs/aoqin-dragon-newly-discovered-chinese-linked-apt-has-been-quietly-spying-on-organizations-for-10-years/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1091/T1091.md
- https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4663
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 1Create autorun.inf on Non-System Drive
Expected signal: Sysmon Event ID 11 (File Create): TargetFilename=D:\autorun.inf, Image=cmd.exe. DeviceFileEvents in MDE: FileName=autorun.inf, FolderPath=D:\, ActionType=FileCreated, InitiatingProcessFileName=cmd.exe.
- Test 2Copy Executable to Removable Drive Root (PlugX/HIUPAN Pattern)
Expected signal: Sysmon Event ID 11 (File Create): TargetFilename=D:\system_update.exe, Image=cmd.exe, MD5 matches cmd.exe hash. DeviceFileEvents in MDE: FileName=system_update.exe, FolderPath=D:\, ActionType=FileCreated, SHA256 matches cmd.exe.
- Test 3Create Malicious LNK Shortcut on Removable Drive (Gamaredon Technique)
Expected signal: Sysmon Event ID 11 (File Create): TargetFilename=D:\Documents.lnk, Image=powershell.exe. DeviceFileEvents in MDE: FileName=Documents.lnk, FolderPath=D:\, ActionType=FileCreated, InitiatingProcessFileName=powershell.exe. WindowStyle=7 (minimized/hidden window) indicates deliberate concealment.
- Test 4Execute Process Directly from Removable Drive
Expected signal: Sysmon Event ID 1 (Process Create): Image=D:\usb_payload.exe, CommandLine=D:\usb_payload.exe /C whoami, ParentImage=cmd.exe. DeviceProcessEvents in MDE: FileName=usb_payload.exe, FolderPath=D:\, ProcessCommandLine contains 'whoami'. Preceded by Sysmon Event ID 11 for the file copy.
- Test 5Enumerate Removable Drives via WMI (USB Worm Reconnaissance)
Expected signal: Sysmon Event ID 1 (Process Create): Image=powershell.exe, CommandLine contains 'Win32_LogicalDisk' and 'DriveType'. DeviceProcessEvents in MDE: FileName=powershell.exe, ProcessCommandLine contains WMI query. WMI Activity log (Microsoft-Windows-WMI-Activity/Operational Event ID 5857/5858) may record the Win32_LogicalDisk query.
Response Playbook
Triage
- Confirm the drive is actually removable media — cross-reference with USB device insertion events in Microsoft-Windows-DriverFrameworks-UserMode/Operational (Event IDs 2003, 2010) or check setupapi.dev.log at C:\Windows\INF\setupapi.dev.log for the drive letter assignment timestamp. False positive rate drops significantly once you confirm the path is a physical USB device vs. a secondary internal drive.
- For autorun.inf detections: immediately read the file content to determine what executable it references (look for 'open=', 'shellexecute=', 'action=' directives). The referenced binary is the malware payload — collect its SHA256 and check against VirusTotal, MalwareBazaar, or your threat intel platform.
- Determine the direction of the malware — was it READ from or WRITTEN to the USB drive? If InitiatingProcessFileName is a user application (Word, browser) or a scheduled task writing to the USB, the endpoint is already compromised and the USB is being seeded for lateral movement. If the process ran FROM the USB, the USB is the initial infection vector.
- Examine the UserAssist registry key at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist — Gamaredon Group specifically uses UserAssist-based LNK execution for USB propagation. ROT13-decode subkey names to identify files that were recently executed from the USB drive.
- Check the MountPoints2 registry key at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2 to identify the volume GUID of the drive, then use that GUID to track the same physical USB across multiple machines in your environment via USBSTOR registry entries.
- Query DeviceFileEvents across ALL devices in your environment for the same SHA256 hash or autorun.inf pattern over the past 7 days to determine how many systems were exposed to the same infected USB drive.
Containment
- If active infection confirmed on the endpoint: isolate immediately via EDR network isolation or emergency VLAN change to prevent the malware from seeding additional USB drives or communicating with C2.
- Physically seize the USB drive as evidence — do NOT allow it to be reinserted into any other system. Document chain of custody, bag and label the device with the incident ticket number and timestamp.
- Block removable media organization-wide via Group Policy if widespread infection is suspected: Computer Configuration > Administrative Templates > System > Removable Storage Access > All Removable Storage classes: Deny all access.
- Disable AutoRun/AutoPlay via Group Policy to prevent autorun.inf execution on any newly inserted media: Computer Configuration > Administrative Templates > Windows Components > AutoPlay Policies > Turn off AutoPlay > set to 'All Drives'.
- If the malware copied itself to the USB to seed other systems, identify all systems the USB was inserted into (via USBSTOR GUID tracking across your SIEM) and deploy the detection indicators across those devices immediately.
- For air-gapped network environments: if a USB infected in a connected zone was brought into an air-gapped segment, treat this as a critical incident — notify the OT/ICS security team and initiate full scope assessment of the isolated network.
Evidence Collection
- setupapi.dev.log at C:\Windows\INF\setupapi.dev.log — contains complete USB device installation history with exact timestamps, device IDs (VID/PID), driver info, and the drive letter assigned at each insertion.
- Registry: HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR\ — each subkey represents a unique USB storage device with serial number, VID/PID, and ParentIdPrefix for correlating across systems.
- Registry: HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{GUID}\ — volume GUIDs of every mounted drive with last-mount context; use the GUID to identify the same physical USB across different hosts.
- Registry: HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{GUID}\Count\ — execution counts and last-run timestamps for any file executed from the USB drive; keys are ROT13-encoded (decode with: python3 -c "import codecs; print(codecs.decode('<key>', 'rot_13'))").
- Windows Event Log: Microsoft-Windows-DriverFrameworks-UserMode/Operational — Event IDs 2003 (device connected to bus), 2010 (device attached to driver stack), 2100 (device removal started) provide precise USB plug/unplug timestamps.
- Prefetch files at C:\Windows\Prefetch\*.pf — if malware executed from USB drive, prefetch entries will contain the full path including the drive letter and list of DLLs loaded from the USB.
- LNK files at C:\Users\*\AppData\Roaming\Microsoft\Windows\Recent\*.lnk — shortcut files referencing recently accessed USB content contain embedded volume serial number and MAC address of the system that created the LNK.
- Forensic image of the USB drive including unallocated space via FTK Imager or dd — malware may delete itself after installation; MFT ($MFT) on the USB records all files including deleted ones with creation/modification/access timestamps.
- Sysmon Event ID 11 logs for the window spanning USB insertion to removal — provides complete file creation timeline on the device.
- $RECYCLE.BIN on the USB drive — some malware variants use the recycle bin as a hidden execution staging area.
Escalation Criteria
- ! autorun.inf confirmed on the drive with a corresponding malicious executable — deliberate propagation mechanism detected; initiate Incident Response immediately.
- ! File hash matches known threat actor tooling: Raspberry Robin dropper, PlugX USB variant, Stuxnet components (mrxnet.sys, mrxcls.sys), Flame modules, or Gamaredon LNK stager — treat as nation-state level incident and notify senior security leadership.
- ! Evidence the USB was introduced into an air-gapped or OT/ICS network segment — escalate to CISO, OT security team, and consider mandatory shutdown of affected isolated systems pending investigation.
- ! The same USB device GUID appears in USBSTOR registry entries across more than 3 endpoints — active worm spreading across the organization; trigger mass containment and USB quarantine procedures.
- ! Process launched from USB drive spawns network connections to external IPs, accesses LSASS memory, creates scheduled tasks or registry run keys, or performs WMI lateral movement — the malware has established post-exploitation persistence.
- ! Malware modifies existing executables already on the USB drive (DLL sideloading or executable patching as used by Darkhotel) — this indicates a sophisticated supply chain-aware adversary capable of trojanizing media.
Investigation Guide
Forensic Artifacts
- >
Registry: HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR\Disk&Ven_*&Prod_*&Rev_*\ — each subkey identifies a unique USB storage device by vendor/product/revision; subkeys contain DeviceDesc, FriendlyName, and first/last installation timestamps in the 0000\ key. - >
Registry: HKLM\SYSTEM\CurrentControlSet\Enum\USB\ — USB class records with hardware VID and PID for device manufacturer identification (use usb.ids database to decode). - >
Registry: HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{volume-GUID}\ — GUID-keyed entries for every mounted volume; allows tracking the same USB across multiple user sessions or systems. - >
Registry: HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{GUID}\Count\ — ROT13-encoded execution history including files run from removable drives; Gamaredon specifically abuses this for USB spreading. - >
File: C:\Windows\INF\setupapi.dev.log — the authoritative USB device installation history; search for 'USBSTOR' entries to find USB storage device connection timestamps and assigned drive letters. - >
File: C:\Windows\Prefetch\*.pf — prefetch files for any process run from removable media will have a path containing the non-C: drive letter; use PECmd (Eric Zimmermann tools) to parse timestamps and referenced files. - >
File: C:\Users\*\AppData\Roaming\Microsoft\Windows\Recent\*.lnk — LNK files contain: target path on USB, volume serial number, MAC address of system that created the shortcut; use LECmd to parse. - >
Event Log: Microsoft-Windows-DriverFrameworks-UserMode/Operational — Event ID 2003 (device connected to bus), 2010 (attached to driver stack), 2100 (device removal); provides precise insertion/removal timestamps for correlation. - >
Event Log: System — Event ID 7045 (new service installed) if malware established persistence via service installation after USB execution. - >
USB drive MFT ($MFT) — parse with Autopsy, MFTECmd, or similar; reveals all files ever created on the drive including deleted ones; $STANDARD_INFORMATION timestamps show creation/modification dates.
Tuning Guidance
The primary tuning challenge for this detection is distinguishing removable USB drives from secondary fixed internal drives that are assigned D:, E:, or higher drive letters in multi-drive workstations. Recommended approach: maintain an allowlist of known secondary internal drive paths in your environment and exclude them in the detection. For standardized workstation builds where secondary drives follow a predictable pattern (e.g., D: is always a data drive), you can exclude that drive letter directly. For higher accuracy, correlate file and process events with USB device insertion events from Microsoft-Windows-DriverFrameworks-UserMode/Operational to confirm the drive letter is genuinely a removable device before alerting — this nearly eliminates false positives but requires event log forwarding from that provider. The autorun.inf signal (Signal 1) has an extremely low false positive rate in modern environments — Windows 7+ disabled AutoRun by default and autorun.inf has no legitimate enterprise use; tune this signal only in environments running legacy embedded systems. For the executable-on-removable-media signals, start by focusing exclusively on drive root (depth 1 after drive letter) to minimize noise from legitimate backup operations, then expand to subdirectories once your baseline is established. Consider adding a file size filter to exclude files larger than 50MB which are more likely legitimate backups or installers rather than malware payloads. Build a allowlist of known portable application user accounts (developers commonly use portable git, Node.js, or Python from USB) by allowlisting specific account + drive letter combinations with known SHA256 hashes. Enable Sysmon Event ID 6 (Driver Loaded) to detect DLL-based payloads loading from removable media — this catches DLL sideloading attacks (Darkhotel) that the file creation signals alone may miss.
Hunting Queries
Hunt for autorun.inf creation across the entire environment over 7 days. autorun.inf has essentially no legitimate use in modern enterprise environments — any result should be treated as high-priority. Multiple affected devices with the same file hash indicates the same infected USB is being circulated between systems, revealing the propagation path.
DeviceFileEvents
| where Timestamp > ago(7d)
| where FileName =~ "autorun.inf"
| where not(FolderPath startswith "C:\\")
| where not(FolderPath startswith "\\\\")
| summarize Count=count(), AffectedDevices=dcount(DeviceName),
Devices=make_set(DeviceName), LastSeen=max(Timestamp),
InitiatingProcesses=make_set(InitiatingProcessFileName)
by FolderPath, SHA256
| sort by AffectedDevices desc, Count desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11 TargetFilename="*\\autorun.inf" NOT TargetFilename="C:\\*" NOT TargetFilename="\\\\*"
| stats count as Count, dc(host) as AffectedDevices, values(host) as Devices,
latest(_time) as LastSeen, values(Image) as InitiatingProcesses
by TargetFilename, MD5
| sort - AffectedDevices Count Hunt for executables and LNK files placed at the root level of non-system drives — the most common USB worm placement pattern. This targets PlugX, HIUPAN, and DustySky USB copying behavior, as well as the Gamaredon LNK-on-all-drives technique. High AffectedDevices count from the same initiating process indicates an active worm actively seeding connected removable drives.
DeviceFileEvents
| where Timestamp > ago(7d)
| where ActionType == "FileCreated"
| where FolderPath matches regex @"(?i)^[d-z]:\\$"
| where not(FolderPath startswith "\\\\")
| where FileName has_any (".exe", ".lnk", ".dll", ".vbs", ".js", ".bat")
| summarize FileCount=count(), AffectedDevices=dcount(DeviceName),
UniqueHashes=dcount(SHA256), DriveLetters=make_set(FolderPath),
Files=make_set(FileName)
by InitiatingProcessFileName, InitiatingProcessSHA256
| where FileCount > 0
| sort by AffectedDevices desc, FileCount desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11 NOT TargetFilename="C:\\*" NOT TargetFilename="\\\\*"
| eval path_depth=len(TargetFilename) - len(replace(TargetFilename, "\\\\", ""))
| where path_depth=2 AND match(lower(TargetFilename), "\\.(exe|lnk|dll|vbs|js|bat)$")
| stats count as FileCount, dc(host) as AffectedDevices, dc(MD5) as UniqueHashes,
values(host) as Hosts, values(TargetFilename) as Files
by Image
| sort - AffectedDevices FileCount Hunt for processes executed directly from non-system drive paths across the environment. Cross-device execution of the same binary (matched by SHA256/MD5) from a removable media path is the strongest indicator of active USB worm propagation. Comparing FirstSeen to LastSeen timestamps reveals the chronological spread of the malware from device to device as the USB is physically carried between systems.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FolderPath matches regex @"(?i)^[d-z]:\\"
| where not(FolderPath startswith "\\\\")
| summarize ExecutionCount=count(), AffectedDevices=dcount(DeviceName),
UniqueUsers=dcount(AccountName), FirstSeen=min(Timestamp),
LastSeen=max(Timestamp), Hosts=make_set(DeviceName)
by FileName, FolderPath, SHA256
| sort by AffectedDevices desc, ExecutionCount desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 NOT Image="C:\\*" NOT Image="\\\\*"
| where match(Image, "(?i)^[A-Z]:\\\\")
| stats count as ExecutionCount, dc(host) as AffectedDevices, dc(User) as UniqueUsers,
earliest(_time) as FirstSeen, latest(_time) as LastSeen, values(host) as Hosts
by Image, MD5
| sort - AffectedDevices ExecutionCount Atomic Red Team Tests
Creates an autorun.inf file at the root of a non-system drive, simulating the classic USB worm propagation mechanism used by Agent.btz, Stuxnet, and Flame. The file specifies an executable that would auto-run when the media is inserted on Windows XP/Vista systems, and serves as a high-confidence malicious indicator even on modern Windows where AutoRun is disabled. Requires a writable non-C: drive (D: assumed; adjust as needed).
Command
cmd.exe /C "echo [autorun] > D:\autorun.inf && echo open=malware.exe >> D:\autorun.inf && echo action=Open folder to view files >> D:\autorun.inf && echo icon=malware.exe >> D:\autorun.inf" Cleanup
del /F D:\autorun.inf 2>nul Expected Telemetry
Sysmon Event ID 11 (File Create): TargetFilename=D:\autorun.inf, Image=cmd.exe. DeviceFileEvents in MDE: FileName=autorun.inf, FolderPath=D:\, ActionType=FileCreated, InitiatingProcessFileName=cmd.exe.
Expected Detection
KQL AutorunInfSignal fires with RiskScore=90, Signal=AutorunInfCreated. SPL signal=AutorunInfCreated, risk_score=90. This is the highest-confidence T1091 indicator — any hit should be immediately escalated.
Copies a system binary to the root of a non-system drive, simulating the PlugX, HIUPAN, DustySky, and H1N1 technique of propagating by placing copies on all connected removable drives. Uses cmd.exe as the payload binary to keep the test benign. Drive root placement (e.g., D:\payload.exe rather than D:\subfolder\payload.exe) is the most common malware placement pattern as it maximizes visibility to users and autorun compatibility.
Command
copy C:\Windows\System32\cmd.exe D:\system_update.exe Cleanup
del /F D:\system_update.exe 2>nul Expected Telemetry
Sysmon Event ID 11 (File Create): TargetFilename=D:\system_update.exe, Image=cmd.exe, MD5 matches cmd.exe hash. DeviceFileEvents in MDE: FileName=system_update.exe, FolderPath=D:\, ActionType=FileCreated, SHA256 matches cmd.exe.
Expected Detection
KQL ExecAtDriveRootSignal fires with RiskScore=85, Signal=ExecutableAtDriveRoot. SPL: signal=ExecutableAtDriveRoot, is_root_level=1, is_executable=1, risk_score=85. SHA256 will match cmd.exe in this test — real incidents will show a previously-unseen hash.
Creates a .lnk shortcut file at the root of a non-system drive pointing to a hidden payload, simulating the Gamaredon Group USB spreading technique. Gamaredon creates LNK files on all available removable and network drives that execute a hidden malware payload when the user opens the shortcut, which appears as a legitimate folder icon. The shortcut is disguised with a folder icon from shell32.dll to deceive the user.
Command
powershell.exe -NoProfile -Command "$ws = New-Object -ComObject WScript.Shell; $sc = $ws.CreateShortcut('D:\Documents.lnk'); $sc.TargetPath = 'D:\.hidden\payload.exe'; $sc.IconLocation = '%SystemRoot%\System32\shell32.dll,3'; $sc.WindowStyle = 7; $sc.Save()" Cleanup
del /F D:\Documents.lnk 2>nul Expected Telemetry
Sysmon Event ID 11 (File Create): TargetFilename=D:\Documents.lnk, Image=powershell.exe. DeviceFileEvents in MDE: FileName=Documents.lnk, FolderPath=D:\, ActionType=FileCreated, InitiatingProcessFileName=powershell.exe. WindowStyle=7 (minimized/hidden window) indicates deliberate concealment.
Expected Detection
KQL ExecAtDriveRootSignal fires (LNK in SuspiciousExtensions): Signal=ExecutableAtDriveRoot, RiskScore=85. SPL: signal=ExecutableAtDriveRoot, is_executable=1 (LNK matches extension filter), is_root_level=1. The initiating process being powershell.exe rather than explorer.exe or a known installer further elevates suspicion.
Launches an executable whose image path resides on a non-system drive, simulating the Raspberry Robin and Aoqin Dragon pattern of immediately executing the malware payload directly from USB before (or instead of) copying to the host system. This is a high-confidence indicator as legitimate software virtually never executes its main binary directly from a USB drive letter path in enterprise environments.
Command
copy C:\Windows\System32\cmd.exe D:\usb_payload.exe && D:\usb_payload.exe /C whoami > %TEMP%\usb_test_output.txt Cleanup
del /F D:\usb_payload.exe %TEMP%\usb_test_output.txt 2>nul Expected Telemetry
Sysmon Event ID 1 (Process Create): Image=D:\usb_payload.exe, CommandLine=D:\usb_payload.exe /C whoami, ParentImage=cmd.exe. DeviceProcessEvents in MDE: FileName=usb_payload.exe, FolderPath=D:\, ProcessCommandLine contains 'whoami'. Preceded by Sysmon Event ID 11 for the file copy.
Expected Detection
KQL ProcFromRemovableSignal fires with RiskScore=88, Signal=ProcessLaunchedFromRemovableMedia. SPL: signal=ProcessFromRemovableMedia, EventCode=1, risk_score=88. This is the most operationally significant signal — actual code execution from removable media demands immediate investigation regardless of payload content.
Uses WMI Win32_LogicalDisk to enumerate all connected drives filtered by DriveType=2 (Removable), simulating the periodic drive-polling behavior of HIUPAN and other USB worms that continuously scan for newly inserted removable media to propagate to. This reconnaissance step precedes the file copy operations in automated worm behavior — detecting it can provide early warning before actual propagation occurs.
Command
powershell.exe -NoProfile -Command "Get-WmiObject Win32_LogicalDisk | Where-Object { $_.DriveType -eq 2 } | Select-Object DeviceID, VolumeName, Size, FreeSpace | Format-Table -AutoSize" Expected Telemetry
Sysmon Event ID 1 (Process Create): Image=powershell.exe, CommandLine contains 'Win32_LogicalDisk' and 'DriveType'. DeviceProcessEvents in MDE: FileName=powershell.exe, ProcessCommandLine contains WMI query. WMI Activity log (Microsoft-Windows-WMI-Activity/Operational Event ID 5857/5858) may record the Win32_LogicalDisk query.
Expected Detection
Not directly caught by the primary T1091 file/process signals (no file write or execution from USB occurs). However, this pattern is captured by T1082 (System Information Discovery) detection rules monitoring WMI-based drive enumeration. Correlate with subsequent T1091 file creation events to identify the full worm workflow: enumerate drives → copy payload → create autorun.inf.