T1074.002

Remote Data Staging

Adversaries may stage data collected from multiple systems in a central location or directory on one system prior to Exfiltration. Data may be kept in separate files or combined into one file through techniques such as Archive Collected Data. Interactive command shells may be used, and common functionality within cmd and bash may be used to copy data into a staging location. By staging data on one system prior to Exfiltration, adversaries can minimize the number of connections made to their C2 server and better evade detection.

Microsoft Sentinel / Defender
kusto
let StagingPaths = dynamic([
  "\\Temp\\", "\\tmp\\", "\\Public\\", "\\ProgramData\\",
  "\\Windows\\Temp\\", "\\AppData\\Local\\Temp\\",
  "\\inetpub\\wwwroot\\", "\\wwwroot\\",
  "\\Users\\Public\\", "\\Recycle", "\\$Recycle"
]);
let StagingTools = dynamic([
  "xcopy", "robocopy", "copy", "move", "compress-archive",
  "zip", "7z", "rar", "tar", "compact"
]);
let LargeFileExtensions = dynamic([
  ".zip", ".rar", ".7z", ".tar", ".gz", ".bz2",
  ".cab", ".iso", ".lzh", ".arj"
]);
// Detection 1: Large archive files created in staging-like directories
let ArchiveInStagingDir = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType == "FileCreated"
| where FolderPath has_any (StagingPaths)
| where FileName has_any (LargeFileExtensions)
| project Timestamp, DeviceName, AccountName, FolderPath, FileName,
          FileSize, InitiatingProcessFileName, InitiatingProcessCommandLine,
          InitiatingProcessAccountName, DetectionType = "ArchiveInStagingDir";
// Detection 2: xcopy/robocopy copying to remote UNC paths
let RemoteCopyTool = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("xcopy.exe", "robocopy.exe", "copy") or
        ProcessCommandLine has_any ("xcopy", "robocopy")
| where ProcessCommandLine has "\\\\"
| where ProcessCommandLine matches regex @"\\\\\\.+\\"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          DetectionType = "RemoteCopyToUNCPath";
// Detection 3: PowerShell/cmd copying to remote shares
let PSRemoteCopy = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe", "cmd.exe")
| where ProcessCommandLine has_any ("copy", "xcopy", "robocopy", "Move-Item", "Copy-Item")
| where ProcessCommandLine has "\\\\"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          DetectionType = "PSCmdRemoteCopy";
// Union all detections
ArchiveInStagingDir
| union RemoteCopyTool
| union PSRemoteCopy
| sort by Timestamp desc
high severity medium confidence

Data Sources

File: File Creation Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceFileEvents DeviceProcessEvents

False Positives

  • IT backup solutions (Veeam, Backup Exec, Windows Server Backup) legitimately copy large volumes of files to remote UNC shares on a scheduled basis
  • Software deployment tools (SCCM, Intune, PDQ Deploy) using robocopy or xcopy to distribute installers to staging directories across the environment
  • Developers or build systems copying compiled artifacts to shared network paths (CI/CD pipelines using MSBuild, Jenkins agents)
  • System administrators running manual robocopy/xcopy migration jobs during server decommissions or data migrations
  • Antivirus or DLP solutions quarantining files to a centralized staging directory

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections