T1052

Exfiltration Over Physical Medium

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.

Microsoft Sentinel / Defender
kusto
let SensitiveExtensions = dynamic(["zip", "rar", "7z", "tar", "gz", "docx", "doc", "xlsx", "xls", "pdf", "pst", "ost", "db", "sql", "bak", "key", "pfx", "p12", "rdp", "kdbx", "csv", "json", "xml", "eml", "mdb", "accdb"]);
// Detect USB/removable media mount events in MDE
let UsbMountEvents = DeviceEvents
| where Timestamp > ago(24h)
| where ActionType == "UsbDriveMounted"
| extend DriveLetter = toupper(tostring(parse_json(AdditionalFields).DriveLetter))
| extend SerialNumber = tostring(parse_json(AdditionalFields).SerialNumber)
| project MountTime=Timestamp, DeviceName, AccountName, DriveLetter, SerialNumber;
// Detect file writes to removable drive letters following a USB mount
let RemovableFileWrites = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified")
| extend DriveLetter = toupper(substring(FolderPath, 0, 2))
| where DriveLetter matches regex @"^[D-Z]:$"
| extend FileExtension = tolower(tostring(split(FileName, ".")[-1]))
| summarize
    FileCount = count(),
    SensitiveFileCount = countif(FileExtension in (SensitiveExtensions)),
    TotalFileSizeMB = round(sum(FileSize) / 1048576.0, 2),
    UniqueExtensions = make_set(FileExtension, 20),
    SampleFiles = make_set(FileName, 5),
    FirstWrite = min(Timestamp),
    LastWrite = max(Timestamp)
  by DeviceName, AccountName, DriveLetter;
// Correlate USB mounts with subsequent file write activity on the same drive
UsbMountEvents
| join kind=inner RemovableFileWrites on DeviceName, DriveLetter
| where FirstWrite >= MountTime
| where FileCount > 5 or SensitiveFileCount > 0 or TotalFileSizeMB > 10
| extend ExfiltrationRisk = case(
    SensitiveFileCount > 10 or TotalFileSizeMB > 500, "Critical",
    SensitiveFileCount > 2 or TotalFileSizeMB > 50, "High",
    SensitiveFileCount > 0 or TotalFileSizeMB > 10, "Medium",
    FileCount > 50, "Low",
    "Low"
  )
| project MountTime, DeviceName, AccountName, DriveLetter, SerialNumber,
          FileCount, SensitiveFileCount, TotalFileSizeMB, UniqueExtensions,
          SampleFiles, FirstWrite, LastWrite, ExfiltrationRisk
| sort by TotalFileSizeMB desc
high severity medium confidence

Data Sources

Drive: Drive Creation File: File Access File: File Creation Microsoft Defender for Endpoint

Required Tables

DeviceEvents DeviceFileEvents

False Positives

  • IT administrators performing legitimate data backups to external drives as part of scheduled maintenance procedures
  • Employees transferring personal files to USB drives at the end of their workday for personal use (common without DLP policy enforcement)
  • Software developers deploying compiled builds or configuration files to USB drives for air-gapped test environments
  • Help desk technicians using bootable USB drives (Ventoy, Rufus) that trigger mount events and may include file operations during imaging workflows
  • Authorized data migration projects where large volumes of files are moved to external media under change management

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