T1020 Google Chronicle · YARA-L

Detect Automated Exfiltration in Google Chronicle

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/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule T1020_AutomatedExfiltration_ScriptingEngine {
  meta:
    author = "Detection Engineering"
    description = "Detects scripting engines performing automated file collection and exfiltration via upload APIs or transfer tools"
    mitre_attack_tactic = "Exfiltration"
    mitre_attack_technique = "T1020"
    severity = "HIGH"
    confidence = "HIGH"
    version = "1.0"

  events:
    $e.metadata.event_type = "PROCESS_LAUNCH"
    $e.principal.process.file.full_path = /(?i)(powershell\.exe|pwsh\.exe|python\.exe|python3\.exe|wscript\.exe|cscript\.exe|cmd\.exe)$/
    (
      re.regex($e.target.process.command_line, `(?i)(UploadFile|UploadData|UploadString|Start-BitsTransfer|Net\.FtpWebRequest|Invoke-WebRequest)`) or
      (
        re.regex($e.target.process.command_line, `(?i)(Get-ChildItem|Compress-Archive|dir\s/s|\[IO\.File\]::)`) and
        re.regex($e.target.process.command_line, `(?i)(curl\s|wget\s|ftp\s-|\ssftp\s)`)
      ) or
      (
        re.regex($e.target.process.command_line, `(?i)(Get-ChildItem|Compress-Archive|dir\s/s)`) and
        re.regex($e.target.process.command_line, `(?i)(\\Documents\\|\\Desktop\\|\\AppData\\|\\ProgramData\\)`)
      )
    )

  condition:
    $e
}

rule T1020_AutomatedExfiltration_TransferTool {
  meta:
    author = "Detection Engineering"
    description = "Detects known transfer utilities executing upload commands to external destinations — automated exfiltration indicator"
    mitre_attack_tactic = "Exfiltration"
    mitre_attack_technique = "T1020"
    severity = "HIGH"
    confidence = "HIGH"
    version = "1.0"

  events:
    $e.metadata.event_type = "PROCESS_LAUNCH"
    $e.target.process.file.full_path = /(?i)(curl\.exe|wget\.exe|certutil\.exe|bitsadmin\.exe|ftp\.exe|sftp\.exe|scp\.exe)$/
    re.regex($e.target.process.command_line, `(?i)(-T\s|--upload-file|-d\s@|--data-binary\s@|/upload|/transfer|ftp://|sftp://|ftps://)`)
    not re.regex($e.target.process.command_line, `(10\.|192\.168\.|172\.(1[6-9]|2[0-9]|3[01])\.|127\.)`)

  condition:
    $e
}

rule T1020_AutomatedExfiltration_ArchiveThenNetwork {
  meta:
    author = "Detection Engineering"
    description = "Detects archive creation from sensitive paths followed within 5 minutes by external network connection from same host"
    mitre_attack_tactic = "Exfiltration"
    mitre_attack_technique = "T1020"
    severity = "CRITICAL"
    confidence = "MEDIUM"
    version = "1.0"

  events:
    $archive.metadata.event_type = "PROCESS_LAUNCH"
    $archive.target.process.file.full_path = /(?i)(7z\.exe|7za\.exe|winrar\.exe|rar\.exe|zip\.exe|tar\.exe)$/
    re.regex($archive.target.process.command_line, `(?i)(\\Documents|\\Desktop|\\Users|\\AppData|\\ProgramData|\\temp)`)
    $archive.principal.hostname = $host

    $net.metadata.event_type = "NETWORK_CONNECTION"
    $net.principal.hostname = $host
    not re.regex($net.target.ip, `^(10\.|192\.168\.|172\.(1[6-9]|2[0-9]|3[01])\.|127\.)`)
    $net.metadata.event_timestamp.seconds > $archive.metadata.event_timestamp.seconds
    $net.metadata.event_timestamp.seconds < ($archive.metadata.event_timestamp.seconds + 300)

  condition:
    $archive and $net
}
high severity high confidence

Three Chronicle YARA-L 2.0 rules covering automated exfiltration: scripting engines with upload APIs or collection+transfer patterns, transfer utilities uploading to external hosts, and archive tool activity on sensitive paths correlated with outbound network connections within 5 minutes on the same host.

Data Sources

Chronicle UDM events from Windows endpoints (Sysmon, MDE, Carbon Black)Chronicle network telemetry (NDR, firewall, proxy feeds)

Required Tables

UDM PROCESS_LAUNCH eventsUDM NETWORK_CONNECTION events

False Positives & Tuning

  • Enterprise backup agents (Commvault, Veeam) that regularly compress user data directories and transmit to backup servers via FTP or SFTP
  • Software development workflows where automated test frameworks collect diagnostic archives from test machines and upload results to build servers
  • Log aggregation pipelines that use Python or PowerShell to bundle and ship log archives to external SIEM or analytics platforms
Download portable Sigma rule (.yml)

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections