T1052 Google Chronicle · YARA-L

Detect Exfiltration Over Physical Medium in Google Chronicle

Adversaries may attempt to exfiltrate data via a physical medium, such as a removable drive. In certain circumstances, such as an air-gapped network compromise, exfiltration could occur via a physical medium or device introduced by a user. Such media could be an external hard drive, USB drive, cellular phone, MP3 player, or other removable storage and processing device. The physical medium or device could be used as the final exfiltration point or to hop between otherwise disconnected systems.

MITRE ATT&CK

Tactic
Exfiltration
Technique
T1052 Exfiltration Over Physical Medium
Canonical reference
https://attack.mitre.org/techniques/T1052/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule t1052_exfiltration_over_physical_medium {
  meta:
    author = "df00tech"
    description = "Detects bulk or sensitive file writes to removable drive letters indicating potential exfiltration over physical medium (T1052)"
    severity = "HIGH"
    mitre_attack_tactic = "Exfiltration"
    mitre_attack_technique = "T1052"
    reference = "https://attack.mitre.org/techniques/T1052/"
    created = "2026-04-16"

  events:
    $e.metadata.event_type = "FILE_CREATION"
    $e.target.file.full_path = /^[D-Zd-z]:\\/
    $e.target.file.full_path = /\.(zip|rar|7z|tar|gz|docx?|xlsx?|pdf|pst|ost|db|sql|bak|key|pfx|p12|rdp|kdbx|csv|json|xml|eml|mdb|accdb)$/i
    $host = $e.principal.hostname
    $user = $e.principal.user.userid

  match:
    $host, $user over 1h

  outcome:
    $sensitive_file_count = count_distinct($e.target.file.full_path)
    $sample_files = array_distinct($e.target.file.full_path)
    $drive_letters = array_distinct(re.capture($e.target.file.full_path, "^([A-Za-z]:)"))

  condition:
    #e > 3
}
high severity high confidence

Chronicle YARA-L 2.0 rule detecting file creation events targeting removable drive letters D-Z with sensitive file extensions. Matches over a 1-hour window per host and user, triggering when more than 3 such writes occur. Captures drive letters and sample file paths for analyst triage.

Data Sources

Chronicle UDM via Google Security OperationsWindows Sysmon forwarded to ChronicleMicrosoft Defender for Endpoint via Chronicle ingestion

Required Tables

FILE_CREATION UDM events

False Positives & Tuning

  • Approved data transfer workflows where users regularly copy reports or CSVs to encrypted USB drives with documented business justification
  • Security tools performing file integrity backups to removable media as part of incident response toolkit deployment
  • Temporary worker onboarding where contractors receive project files on USB drives per standard provisioning process
Download portable Sigma rule (.yml)

Other platforms for T1052


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 1Windows - Copy sensitive documents to USB drive using xcopy

    Expected signal: Sysmon Event ID 11: FileCreate events with TargetFilename matching 'E:\staged_exfil\*' written by process 'xcopy.exe'. MDE DeviceFileEvents with ActionType=FileCreated and FolderPath starting with 'E:\staged_exfil'. Sysmon Event ID 1: Process Create for xcopy.exe with CommandLine containing '/S /Y'. Prefetch file created at C:\Windows\Prefetch\XCOPY.EXE-*.pf.

  2. Test 2Windows - Archive sensitive files and copy to USB using 7-Zip

    Expected signal: Sysmon Event ID 11: FileCreate for archive_exfil.zip in %TEMP% (staging) then another FileCreate for archive_exfil.zip on E: (exfil). Sysmon Event ID 1: Process Create for 7z.exe with command line showing source directories. MDE DeviceFileEvents with FileName=archive_exfil.zip and FolderPath=E:\. Prefetch for 7Z.EXE-*.pf created.

  3. Test 3Windows - Bulk robocopy transfer to USB with logging

    Expected signal: Sysmon Event ID 1: Process Create for robocopy.exe with full command line including source, destination, and flags. Sysmon Event ID 11: Multiple FileCreate events on E:\desktop_copy\ for each file transferred, plus FileCreate for robocopy_exfil.log in C:\Windows\Temp. MDE DeviceFileEvents showing bulk writes to E: drive. Prefetch file ROBOCOPY.EXE-*.pf with referenced volume for E:.

  4. Test 4Linux - Copy credentials and config files to mounted USB

    Expected signal: Linux auditd syscall events: openat/read on /etc/passwd, /etc/shadow, ~/.ssh/id_rsa; write syscalls to /media/*/exfil/ paths. Syslog entries showing USB mount event (kernel: usb, scsi: sd). auditd EVENT_TYPE=PATH records for each file accessed. If auditd WATCH rules are configured on /etc/shadow and ~/.ssh/id_rsa, dedicated alerts fire for those accesses.

  5. Test 5Windows - PowerShell recursive file copy to USB simulating data collection script

    Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing '-ExecutionPolicy Bypass', 'Get-ChildItem', 'Copy-Item', and target drive 'E:\'. PowerShell ScriptBlock Logging Event ID 4104 with full deobfuscated script content. Sysmon Event ID 11: Multiple FileCreate events on E:\ps_exfil\ for each copied file. MDE DeviceFileEvents with ActionType=FileCreated on DriveLetter=E:.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections