Detect Automated Exfiltration in CrowdStrike LogScale
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/
LogScale Detection Query
// Branch 1: Scripting engines with upload or collection+transfer command patterns
#event_simpleName=ProcessRollup2
| ImageFileName = /(?i)(powershell\.exe|pwsh\.exe|python\.exe|python3\.exe|wscript\.exe|cscript\.exe|cmd\.exe)$/
| CommandLine = /(?i)(UploadFile|UploadData|UploadString|Start-BitsTransfer|Net\.FtpWebRequest|Invoke-WebRequest|Invoke-RestMethod)/
OR (CommandLine = /(?i)(Get-ChildItem|Compress-Archive|dir\s\/s|\[IO\.File\]::)/ AND CommandLine = /(?i)(curl\s|wget\s|ftp\s-|\ssftp\s)/)
OR (CommandLine = /(?i)(Get-ChildItem|Compress-Archive)/ AND CommandLine = /(?i)(\\Documents\\|\\Desktop\\|\\AppData\\|\\ProgramData\\|\\temp\\)/)
| eval HasUpload = if(CommandLine = /(?i)(UploadFile|UploadData|Start-BitsTransfer|Net\.FtpWebRequest)/, "true", "false")
| eval HasCollection = if(CommandLine = /(?i)(Get-ChildItem|Compress-Archive|dir\s\/s)/, "true", "false")
| eval HasTransferTool = if(CommandLine = /(?i)(curl\s|wget\s|ftp\s-)/, "true", "false")
| eval SensitivePath = if(CommandLine = /(?i)(\\Documents|\\Desktop|\\AppData|\\ProgramData|\\temp)/, "true", "false")
| table([timestamp, ComputerName, UserName, ImageFileName, CommandLine, ParentImageFileName, ParentCommandLine, HasUpload, HasCollection, HasTransferTool, SensitivePath])
| sort(timestamp, order=desc)
// Branch 2: Transfer utilities executing upload commands to external targets
| union {
#event_simpleName=ProcessRollup2
| ImageFileName = /(?i)(curl\.exe|wget\.exe|certutil\.exe|bitsadmin\.exe|ftp\.exe|sftp\.exe|scp\.exe)$/
| CommandLine = /(?i)(-T\s|--upload-file|-d\s@|--data-binary\s@|\/upload|\/transfer|ftp:\/\/|sftp:\/\/|ftps:\/\/)/
| CommandLine != /(?i)(10\.|192\.168\.|172\.(1[6-9]|2[0-9]|3[01])\.|127\.)/
| eval IsExternal = "true"
| table([timestamp, ComputerName, UserName, ImageFileName, CommandLine, ParentImageFileName, IsExternal])
| sort(timestamp, order=desc)
}
// Branch 3: Archive tools on sensitive paths correlated with external network connections
| union {
#event_simpleName=ProcessRollup2
| ImageFileName = /(?i)(7z\.exe|7za\.exe|winrar\.exe|rar\.exe|zip\.exe|tar\.exe)$/
| CommandLine = /(?i)(\\Documents|\\Desktop|\\Users|\\AppData|\\ProgramData)/
| ArchiveComputerName := ComputerName
| ArchiveTime := timestamp
| join({
#event_simpleName=NetworkConnectIP4
| RemoteAddressPrefix != /^(10\.|192\.168\.|172\.(1[6-9]|2[0-9]|3[01])\.|127\.)/
| NetComputerName := ComputerName
| NetTime := timestamp
}, field=[ArchiveComputerName, NetComputerName], mode=inner)
| TimeDelta := NetTime - ArchiveTime
| TimeDelta >= 0
| TimeDelta <= 300000
| table([ArchiveTime, ComputerName, UserName, ImageFileName, CommandLine, RemoteAddress, RemotePort, TimeDelta])
| sort(ArchiveTime, order=desc)
} Three-branch CrowdStrike LogScale detection using Falcon ProcessRollup2 and NetworkConnectIP4 events: scripting engines with file upload or recursive collection patterns, transfer utilities sending data to external destinations, and archive tool activity on sensitive paths joined with outbound external network connections within 300 seconds on the same host.
Data Sources
Required Tables
False Positives & Tuning
- Managed endpoint backup clients that periodically archive user profile directories (Documents, AppData) and transmit compressed archives to cloud backup infrastructure
- Software deployment pipelines where Python or PowerShell automation packages application builds from staging directories and uploads them via curl or SFTP to artifact repositories
- IT monitoring agents that collect diagnostic bundles using certutil or PowerShell and upload them to vendor support portals on a scheduled basis
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.