Detect Data Staged in Elastic Security
Adversaries may stage collected data in a central location or directory prior to exfiltration. Data may be kept in separate files or combined into one file through archiving techniques. Adversaries choose staging to minimize the number of connections made to their C2 server and better evade detection. Staging locations are commonly temp directories, user profile folders, or hidden directories. In cloud environments, adversaries may stage data within a particular instance before exfiltration.
MITRE ATT&CK
- Tactic
- Collection
- Technique
- T1074 Data Staged
- Canonical reference
- https://attack.mitre.org/techniques/T1074/
Elastic Detection Query
sequence by host.name, user.name with maxspan=10m
[file where event.action in ("creation", "overwrite") and
file.path : ("*\\Temp\\*", "*\\tmp\\*", "*\\AppData\\Local\\Temp\\*", "*\\AppData\\Roaming\\*", "*\\ProgramData\\*", "*\\Users\\Public\\*", "*\\Windows\\Temp\\*") and
not process.name in ("MsMpEng.exe", "SenseIR.exe", "WindowsDefender.exe", "svchost.exe")
] with runs=10
OR
any where
(event.category == "file" and event.action in ("creation", "overwrite") and
file.path : ("*\\Temp\\*", "*\\tmp\\*", "*\\AppData\\Local\\Temp\\*", "*\\Users\\Public\\*", "*\\ProgramData\\*", "*\\Windows\\Temp\\*") and
file.extension in ("zip", "7z", "rar", "tar", "gz", "cab", "iso"))
OR
(event.category == "process" and event.type == "start" and
process.name in ("robocopy.exe", "xcopy.exe", "cmd.exe", "powershell.exe") and
process.args : ("*robocopy*", "*xcopy*", "*copy /*", "*Copy-Item*") and
process.command_line : ("*\\Temp\\*", "*\\tmp\\*", "*\\Public\\*", "*\\ProgramData\\*")) Detects data staging behavior consistent with T1074 by identifying bulk file creation in common staging directories, archive file creation in staging paths, and bulk copy commands targeting staging locations. Uses ECS fields from Elastic endpoint and Sysmon integrations.
Data Sources
Required Tables
False Positives & Tuning
- Software installation or update processes that stage files in Temp directories (e.g., Windows Update, MSI installers, package managers like Chocolatey)
- Backup software (e.g., Veeam, Acronis, Windows Backup) creating archive files in ProgramData or Temp directories as part of legitimate backup jobs
- Developer tooling such as build systems (MSBuild, CMake), CI/CD agents (Jenkins, GitLab Runner), or Docker image layers staging files during compilation or container builds
Other platforms for T1074
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 1Stage Sensitive Files to Temp Directory Using Robocopy
Expected signal: Sysmon Event ID 1: Process Create with Image=robocopy.exe, CommandLine containing source and destination temp paths with /E /COPYALL flags. Sysmon Event ID 11: Multiple FileCreate events in %TEMP%\df00tech-stage\ for each copied file. Security Event ID 4688 (if command line auditing enabled) for robocopy.exe execution. DeviceProcessEvents and DeviceFileEvents will capture this in MDE environments.
- Test 2Stage and Compress Data Using 7-Zip from Command Line
Expected signal: Sysmon Event ID 1: Process Create for cmd.exe with copy command, then 7z.exe with -p flag (password) targeting staging directory. Sysmon Event ID 11: FileCreate events for each copied file in df00tech-collection\, then FileCreate for df00tech-exfil.zip. The -p flag in 7z.exe command line indicates password protection — a high-fidelity indicator of malicious intent.
- Test 3Stage Data Using PowerShell Copy-Item to ProgramData
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with Copy-Item in CommandLine targeting C:\ProgramData\MicrosoftUpdates. Sysmon Event ID 11: Multiple FileCreate events in C:\ProgramData\MicrosoftUpdates\. Sysmon Event ID 12/13: Registry or attribute change if attrib command is monitored. The directory name 'MicrosoftUpdates' is a common masquerading technique — look for this in DeviceFileEvents FolderPath.
- Test 4Linux Data Staging Using cp and tar
Expected signal: Linux auditd syscall events (if configured): open/creat syscalls for files in /tmp/.df00tech_stage/, execve for cp, find, tar commands. Syslog entries if auditd rules cover /tmp/ writes. If Sysmon for Linux is deployed: Sysmon Event ID 11 for file creations, Event ID 1 for process creation with tar czf command. The hidden directory name (.df00tech_stage with leading dot) indicates deliberate concealment.
- Test 5Remote Data Staging via Network Share Copy
Expected signal: Sysmon Event ID 1: Process Create for net.exe (net use) with UNC path and xcopy.exe with /E /H /Y flags. Sysmon Event ID 3: Network Connection to target host on port 445 (SMB). Sysmon Event ID 11: FileCreate events in staging directory. Security Event ID 4648 (explicit credential logon) if credentials were provided to net use. Security Event ID 5140/5145 (network share access) on the target host if SMB auditing is enabled.
References (12)
- https://attack.mitre.org/techniques/T1074/
- https://attack.mitre.org/techniques/T1074/001/
- https://attack.mitre.org/techniques/T1074/002/
- https://www.microsoft.com/en-us/security/blog/2023/05/24/volt-typhoon-targets-us-critical-infrastructure-with-living-off-the-land-techniques/
- https://www.crowdstrike.com/blog/wizard-spider-adversary-update/
- https://www.huntress.com/blog/inc-ransom-group
- https://www.welivesecurity.com/2021/01/26/operation-spalax-targeted-malware-attacks-colombia/
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicefileevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1074.001/T1074.001.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/file
- https://web.archive.org/web/20220224041316/https://www.pwc.co.uk/cyber-security/pdf/cloud-hopper-report-final-v4.pdf
Unlock Pro Content
Get the full detection package for T1074 including response playbook, investigation guide, and atomic red team tests.