Detect Data Staged in IBM QRadar
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/
QRadar Detection Query
SELECT
DATEFORMAT(devicetime, 'yyyy-MM-dd HH:mm:ss') AS EventTime,
logsourcename(logsourceid) AS LogSource,
sourceip AS HostIP,
QIDNAME(qid) AS EventName,
username AS Actor,
"TargetFilename" AS StagingPath,
"Image" AS InitiatingProcess,
"CommandLine" AS ProcessCommandLine,
CASE
WHEN LOWER("TargetFilename") MATCHES '.*\.(zip|7z|rar|tar|gz|cab|iso)$' THEN 'ArchiveCreated'
WHEN "CommandLine" IMATCHES '.*(robocopy|xcopy).*' THEN 'BulkCopyCommand'
WHEN "EventID" = '11' THEN 'FileCreatedInStagingPath'
ELSE 'StagedActivity'
END AS StagingType,
COUNT(*) AS EventCount
FROM events
WHERE
LOGSOURCETYPEID(logsourceid) IN (12, 13, 101, 143)
AND devicetime > NOW() - 86400000
AND (
(
"EventID" = '11'
AND (
"TargetFilename" IMATCHES '.*\\(Temp|tmp|AppData\\Local\\Temp|AppData\\Roaming|ProgramData|Users\\Public|Windows\\Temp)\\.*'
)
)
OR (
"EventID" = '1'
AND (
"CommandLine" IMATCHES '.*(robocopy|xcopy|copy /|Copy-Item|cp -r).*'
AND "CommandLine" IMATCHES '.*\\(Temp|tmp|Public|ProgramData)\\.*'
)
)
)
GROUP BY
DATEFORMAT(devicetime, 'yyyy-MM-dd HH:mm'),
logsourceid,
sourceip,
username,
"TargetFilename",
"Image",
"CommandLine",
"EventID"
HAVING EventCount >= 5
ORDER BY EventCount DESC QRadar AQL query detecting T1074 data staging by correlating Sysmon EventID 11 (file creation) in known staging directories and Sysmon EventID 1 (process create) for bulk copy utilities. Groups by host and actor to surface bulk staging activity exceeding threshold.
Data Sources
Required Tables
False Positives & Tuning
- Automated patch management tools (SCCM, Intune, WSUS) staging installation packages in ProgramData or Windows\Temp prior to deployment across endpoints
- Antivirus or EDR solutions quarantining or scanning files by copying them to temporary staging directories during threat investigation
- Legitimate archive creation by compression tools (7-Zip, WinRAR) used for routine file transfer or backup purposes, particularly by IT staff or file server processes
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.