Detect Automated Exfiltration in IBM QRadar
Adversaries may exfiltrate data through the use of automated processing after being gathered during collection. Automated exfiltration commonly involves scripted or programmatic transfer of collected files to attacker-controlled infrastructure on a schedule or triggered basis. This technique is frequently combined with T1041 (Exfiltration Over C2 Channel) or T1048 (Exfiltration Over Alternative Protocol) to move data out of the network. Real-world examples include StrongPity automatically uploading collected documents, Rover scanning local drives on a 60-minute cycle, Raccoon Stealer acting on received configuration files, and Ke3chang performing frequent scheduled exfiltration from compromised networks.
MITRE ATT&CK
- Tactic
- Exfiltration
- Technique
- T1020 Automated Exfiltration
- Canonical reference
- https://attack.mitre.org/techniques/T1020/
QRadar Detection Query
/* Branch 1: Scripting engines with exfil-relevant command patterns */
SELECT
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS event_time,
logsourcename(logsourceid) AS log_source,
sourceip,
username,
"Process Name" AS process_name,
"Command" AS command_line,
"Parent Process Name" AS parent_process,
CASE
WHEN LOWER("Command") ILIKE '%uploadfile%' OR LOWER("Command") ILIKE '%uploaddata%' OR LOWER("Command") ILIKE '%start-bitstransfer%' THEN 1
ELSE 0
END AS has_upload,
CASE
WHEN LOWER("Command") ILIKE '%get-childitem%' OR LOWER("Command") ILIKE '%compress-archive%' OR LOWER("Command") ILIKE '%dir /s%' THEN 1
ELSE 0
END AS has_collection,
CASE
WHEN LOWER("Command") ILIKE '%curl %' OR LOWER("Command") ILIKE '%wget %' OR LOWER("Command") ILIKE '%ftp -%' THEN 1
ELSE 0
END AS has_transfer_tool
FROM events
WHERE
LOGSOURCETYPEID(logsourceid) IN (12, 13, 260, 352)
AND (QIDNAME(qid) = 'Process Launch' OR "EventID" IN ('1', '4688'))
AND (
LOWER("Process Name") ILIKE '%powershell.exe%'
OR LOWER("Process Name") ILIKE '%pwsh.exe%'
OR LOWER("Process Name") ILIKE '%python.exe%'
OR LOWER("Process Name") ILIKE '%wscript.exe%'
OR LOWER("Process Name") ILIKE '%cscript.exe%'
OR LOWER("Process Name") ILIKE '%cmd.exe%'
)
AND (
(
LOWER("Command") ILIKE '%uploadfile%'
OR LOWER("Command") ILIKE '%uploaddata%'
OR LOWER("Command") ILIKE '%start-bitstransfer%'
OR LOWER("Command") ILIKE '%net.ftpwebrequest%'
)
OR (
(
LOWER("Command") ILIKE '%get-childitem%'
OR LOWER("Command") ILIKE '%compress-archive%'
OR LOWER("Command") ILIKE '%dir /s%'
)
AND (
LOWER("Command") ILIKE '%curl %'
OR LOWER("Command") ILIKE '%wget %'
OR LOWER("Command") ILIKE '%ftp -%'
)
)
)
AND STARTTIME > NOW() - 86400000
UNION ALL
/* Branch 2: Transfer tools uploading to external destinations */
SELECT
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS event_time,
logsourcename(logsourceid) AS log_source,
sourceip,
username,
"Process Name" AS process_name,
"Command" AS command_line,
"Parent Process Name" AS parent_process,
0 AS has_upload,
0 AS has_collection,
1 AS has_transfer_tool
FROM events
WHERE
LOGSOURCETYPEID(logsourceid) IN (12, 13, 260, 352)
AND (QIDNAME(qid) = 'Process Launch' OR "EventID" IN ('1', '4688'))
AND (
LOWER("Process Name") ILIKE '%curl.exe%'
OR LOWER("Process Name") ILIKE '%wget.exe%'
OR LOWER("Process Name") ILIKE '%certutil.exe%'
OR LOWER("Process Name") ILIKE '%bitsadmin.exe%'
OR LOWER("Process Name") ILIKE '%ftp.exe%'
OR LOWER("Process Name") ILIKE '%scp.exe%'
OR LOWER("Process Name") ILIKE '%sftp.exe%'
)
AND (
LOWER("Command") ILIKE '%-t %'
OR LOWER("Command") ILIKE '%--upload-file%'
OR LOWER("Command") ILIKE '%-d @%'
OR LOWER("Command") ILIKE '%/upload%'
OR LOWER("Command") ILIKE '%ftp://%'
OR LOWER("Command") ILIKE '%sftp://%'
)
AND STARTTIME > NOW() - 86400000
ORDER BY event_time DESC AQL detection across two branches: scripting engines invoking file upload or recursive collection combined with transfer tools, and known transfer binaries executing upload-style commands to external destinations. Sources Windows Security Event 4688 and Sysmon Event 1 via QRadar Windows log sources.
Data Sources
Required Tables
False Positives & Tuning
- Automated patch management systems (WSUS, SCCM) that use BitsAdmin to download and upload update packages
- Security tools like Carbon Black or CrowdStrike that use PowerShell cmdlets internally for telemetry uploads
- Legitimate DevOps workflows where Jenkins or TeamCity pipelines invoke curl or scp to deploy artifacts to remote servers
Other platforms for T1020
Testing Methodology
Validate this detection against 4 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 1PowerShell Automated File Upload via Net.WebClient
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-ChildItem', '-Recurse', 'Net.WebClient', 'UploadFile'. Sysmon Event ID 3: Network Connection attempts to 127.0.0.1:8443. PowerShell ScriptBlock Log Event ID 4104 with full script including file collection loop.
- Test 2Scheduled Automated Exfiltration via BitsAdmin Upload
Expected signal: Windows Security Event ID 4698 (A scheduled task was created) with task name 'WindowsTelemetryCollect' and action 'bitsadmin /transfer exfil /upload'. Sysmon Event ID 1 for schtasks.exe process creation. Microsoft-Windows-TaskScheduler/Operational Event ID 106 (task registered). When task fires: Sysmon Event ID 1 for bitsadmin.exe with /upload flag in CommandLine.
- Test 3Python Script Recursive Collection and Staged Archive Upload
Expected signal: Sysmon Event ID 1: Process Create with Image=python.exe, CommandLine containing 'zipfile', 'os.walk', 'Documents', 'urllib.request', 'POST'. Sysmon Event ID 11: File Create for collect_df00tech.zip in %TEMP% directory. Sysmon Event ID 3: Network Connection attempt to 127.0.0.1:8080. DeviceFileEvents (MDE) will show the archive creation.
- Test 4Curl-Based Automated File Exfiltration Loop (Linux/macOS)
Expected signal: Linux auditd: execve syscall events for bash and curl with full argument arrays. Syslog: process execution records. If Sysmon for Linux deployed: Event ID 1 (Process Create) with CommandLine containing 'find', '-name', 'curl', '-X POST', '-F file=@'. Network: connection attempts from curl to 127.0.0.1:9090. File access events for each file POSTed.
References (10)
- https://attack.mitre.org/techniques/T1020/
- https://www.welivesecurity.com/2020/06/11/gamaredon-group-grows-its-game/
- https://blog.talosintelligence.com/2020/06/promethium-extends-with-strongpity3.html
- https://www.bitdefender.com/files/News/CaseStudies/study/353/Bitdefender-Whitepaper-StrongPity-APT.pdf
- https://www.welivesecurity.com/2019/05/07/turla-lightneuron-email-too-far/
- https://attack.mitre.org/software/S0409/
- https://unit42.paloaltonetworks.com/ukraine-targeted-outsteel-saintbot/
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicefileevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1020/T1020.md
Unlock Pro Content
Get the full detection package for T1020 including response playbook, investigation guide, and atomic red team tests.