Detect Data from Removable Media in Splunk
Adversaries may search connected removable media on computers they have compromised to find files of interest. Sensitive data can be collected from any removable media (optical disk drive, USB memory, etc.) connected to the compromised system prior to exfiltration. Threat actors including APT28, Gamaredon Group, and OilRig have leveraged this technique. Malware families such as USBStealer, GravityRAT, Rover, Crimson, Crutch, and BADNEWS implement automated USB harvesting — copying files matching predefined extension lists (documents, credentials, archives) to staging directories for later exfiltration.
MITRE ATT&CK
- Tactic
- Collection
- Technique
- T1025 Data from Removable Media
- Canonical reference
- https://attack.mitre.org/techniques/T1025/
SPL Detection Query
index=wineventlog earliest=-1h
(
(sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11)
OR
(sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1)
)
| eval DriveLetter=upper(substr(coalesce(TargetFilename, CommandLine), 1, 2))
| eval IsRemovablePath=if(match(coalesce(TargetFilename, CommandLine), "(?i)^[D-Z]:\\\\"), 1, 0)
| where IsRemovablePath=1
| eval FileExt=lower(replace(coalesce(TargetFilename,""), ".*\.([^.]+)$", ".\1"))
| eval IsSensitiveExt=if(match(FileExt, "\.(doc|docx|xls|xlsx|pdf|ppt|pptx|txt|csv|kdbx|pfx|pem|key|p12|zip|rar|7z|bak|sql|db|sqlite|conf|config|xml|json)$"), 1, 0)
| eval IsSuspiciousProcess=if(match(lower(coalesce(Image, ParentImage, "")), "(powershell|pwsh|cmd|wscript|cscript|mshta|rundll32|python|xcopy|robocopy|forfiles)"), 1, 0)
| eval EventType=case(EventCode="11" AND IsSensitiveExt=1, "SensitiveFileOnRemovableMedia",
EventCode="1" AND IsSuspiciousProcess=1, "SuspiciousProcessAccessingRemovableMedia",
true(), "RemovableMediaAccess")
| stats
count as EventCount,
dc(TargetFilename) as UniqueFiles,
values(FileExt) as Extensions,
values(Image) as Processes,
earliest(_time) as FirstSeen,
latest(_time) as LastSeen
by host, User, DriveLetter, EventType, ProcessGuid
| eval BulkAccess=if(UniqueFiles >= 20, 1, 0)
| eval SuspiciousScore=BulkAccess + IsSuspiciousProcess
| where UniqueFiles >= 5 OR EventType="SuspiciousProcessAccessingRemovableMedia"
| eval Severity=case(UniqueFiles >= 100, "Critical", UniqueFiles >= 50, "High", UniqueFiles >= 20, "Medium", true(), "Low")
| table FirstSeen, host, User, DriveLetter, EventType, Processes, UniqueFiles, Extensions, Severity
| sort - UniqueFiles Detects removable media data collection using Sysmon Event ID 11 (File Create) and Event ID 1 (Process Create). Identifies file access on non-C: drive paths, filters for sensitive file extensions (documents, credentials, archives), and flags both bulk file enumeration (20+ unique files) and suspicious process involvement (scripting engines, copy utilities). Aggregates by host, user, and drive letter to surface campaigns rather than individual file events. Severity tiers based on file volume.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Backup agents scanning external USB drives as part of scheduled backup jobs
- IT staff copying files from USB drives during provisioning, software installation, or data migration
- Secondary internal drive volumes assigned non-C: letters accessed during normal file operations
- Optical drive media installations (D:) triggering on software EXE/MSI file reads during installs
- DLP or endpoint security agents performing file scanning on newly inserted removable media
Other platforms for T1025
Testing Methodology
Validate this detection against 4 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 1Bulk File Collection from USB Drive via PowerShell Copy-Item
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'Get-ChildItem', 'Copy-Item', and the fake USB path. Sysmon Event ID 11: File Create events for each copied file in the staging directory. DeviceFileEvents: multiple FileRead and FileCreated entries for the extension sweep. DeviceProcessEvents: PowerShell process with copy pipeline command line.
- Test 2Removable Media Enumeration via CMD dir and xcopy
Expected signal: Sysmon Event ID 1: Process Create for cmd.exe and xcopy.exe with command lines showing the target path. Sysmon Event ID 11: File Create events for each file copied to usb_collect. Security Event ID 4688 (with command line auditing enabled) for cmd.exe and xcopy.exe. DeviceFileEvents: xcopy.exe performing FileRead on source and FileCreated on destination.
- Test 3Credential File Targeted Collection from Removable Media
Expected signal: Sysmon Event ID 1: PowerShell process with Get-ChildItem filtering .kdbx/.pfx/.key extensions and Copy-Item to staging. Sysmon Event ID 11: File Create events for .kdbx, .pfx, id_rsa, .key in the staging directory. DeviceFileEvents: FileRead on credential-extension files. The credential-targeted hunting query will match immediately on file extensions.
- Test 4Robocopy Mirroring of Removable Media to Network Share
Expected signal: Sysmon Event ID 1: Process Create for robocopy.exe with source path, destination path, /E /COPYALL flags. Sysmon Event ID 11: File Create events for all mirrored files in staging directory. Sysmon Event ID 11: Log file creation (%TEMP%\robocopy_collection.log). DeviceFileEvents: robocopy.exe FileRead from source and FileCreated at destination.
References (10)
- https://attack.mitre.org/techniques/T1025/
- https://www.welivesecurity.com/2014/11/21/win32-usbstealer-usb-based-espionage-tool/
- https://www.kaspersky.com/blog/kaspersky-security-bulletin-2014-apt-predictions/7105/
- https://www.welivesecurity.com/wp-content/uploads/2020/06/ESET_InvisiMole.pdf
- https://research.checkpoint.com/2020/naikon-apt-cyber-espionage-reborn/
- https://unit42.paloaltonetworks.com/unit-42-technical-analysis-shamoon-2/
- https://blog.talosintelligence.com/gravityrat-two-years-of-evolution/
- https://www.welivesecurity.com/2020/12/02/turla-crutch-keeping-back-door-open/
- https://securelist.com/project-sauron-remsec/75533/
- https://www.trendmicro.com/en_us/research/17/l/patchwork-continues-deliver-badnews-indian-subcontinent.html
Unlock Pro Content
Get the full detection package for T1025 including response playbook, investigation guide, and atomic red team tests.