T1041 IBM QRadar · QRadar

Detect Exfiltration Over C2 Channel in IBM QRadar

Adversaries may steal data by exfiltrating it over an existing command and control channel. Stolen data is encoded into the normal communications channel using the same protocol as command and control communications. This technique is particularly challenging to detect because exfiltration traffic is indistinguishable from regular C2 beaconing — adversaries embed collected data inside HTTP POST bodies, DNS query labels, custom binary protocol frames, or other C2 protocol fields. Detection requires correlating large outbound data volumes, repeated connection patterns, and sensitive file access rather than inspecting payload content. Real-world actors observed using this technique include Scattered Spider (VMware vCenter via Teleport), OilRig/APT34 (OneDrive-based C2), and malware families PoetRAT, Machete, Shark, StrelaStealer, BeaverTail, SLOTHFULMEDIA, Sagerunex, and Bandook. The technique spans Windows, Linux, macOS, and ESXi platforms and commonly exploits encrypted C2 channels (HTTPS, DNS-over-HTTPS) to blend with legitimate traffic.

MITRE ATT&CK

Tactic
Exfiltration
Technique
T1041 Exfiltration Over C2 Channel
Canonical reference
https://attack.mitre.org/techniques/T1041/

QRadar Detection Query

IBM QRadar (QRadar)
sql
SELECT
    DATEFORMAT(MIN(devicetime), 'YYYY-MM-dd HH:mm:ss') AS FirstSeen,
    DATEFORMAT(MAX(devicetime), 'YYYY-MM-dd HH:mm:ss') AS LastSeen,
    sourceip AS DeviceIP,
    username AS AccountName,
    "Image" AS ProcessName,
    "CommandLine" AS ProcessCommandLine,
    COUNT(*) AS ConnectionCount,
    COUNT(DISTINCT destinationip) AS UniqueRemoteIPs,
    MIN(destinationip) AS SampleRemoteIP,
    MIN(destinationport) AS SampleRemotePort
FROM events
WHERE
    devicetime > NOW() - 86400000
    AND LOGSOURCETYPENAME(devicetype) LIKE '%Sysmon%'
    AND QIDNAME(qid) LIKE '%Network Connection%'
    AND (
        "Image" ILIKE '%\\powershell.exe'
        OR "Image" ILIKE '%\\pwsh.exe'
        OR "Image" ILIKE '%\\cmd.exe'
        OR "Image" ILIKE '%\\wscript.exe'
        OR "Image" ILIKE '%\\cscript.exe'
        OR "Image" ILIKE '%\\mshta.exe'
        OR "Image" ILIKE '%\\rundll32.exe'
        OR "Image" ILIKE '%\\regsvr32.exe'
        OR "Image" ILIKE '%\\certutil.exe'
        OR "Image" ILIKE '%\\python.exe'
        OR "Image" ILIKE '%\\python3.exe'
        OR "Image" ILIKE '%\\curl.exe'
        OR "Image" ILIKE '%\\wget.exe'
        OR "Image" ILIKE '%\\bitsadmin.exe'
        OR "Image" ILIKE '%\\nc.exe'
        OR "Image" ILIKE '%\\ncat.exe'
    )
    AND NOT INCIDR('10.0.0.0/8', destinationip)
    AND NOT INCIDR('172.16.0.0/12', destinationip)
    AND NOT INCIDR('192.168.0.0/16', destinationip)
    AND NOT INCIDR('127.0.0.0/8', destinationip)
    AND NOT INCIDR('169.254.0.0/16', destinationip)
GROUP BY sourceip, username, "Image", "CommandLine"
HAVING ConnectionCount > 10 OR COUNT(DISTINCT destinationip) = 1
ORDER BY ConnectionCount DESC
high severity medium confidence

Aggregates Sysmon EventCode 3 (Network Connection) records from high-risk interpreter and transfer-utility processes making outbound connections to public IPs over the past 24 hours. Flags host+process tuples with either more than 10 connections (C2 beacon pattern) or exclusive single-destination routing (infrastructure lock-in typical of dedicated C2 implants). Correlate with Sysmon file events (EventCode 11) in a separate rule-to-rule offense for the collect-then-exfil pattern.

Data Sources

QRadar DSM for Microsoft Windows (Sysmon Operational log)QRadar Network Activity (flow data for byte-volume correlation)Endpoint Detection and Response integration via QRadar SOAR

Required Tables

events

False Positives & Tuning

  • PowerShell-based deployment tooling such as SCCM client actions or Azure Arc agent callbacks making frequent connections to a single management endpoint — whitelist the management server IP in the INCIDR exclusion list
  • certutil.exe used in software packaging scripts to download installers or verify certificate chains from a CDN — filter by CommandLine containing '-urlcache' combined with known software distribution domains
  • Python-based monitoring or ETL scripts polling a single cloud API endpoint at regular intervals — identify and exclude known scheduled task service accounts from the username filter
Download portable Sigma rule (.yml)

Other platforms for T1041


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 HTTP POST Exfiltration Over Simulated C2 Channel

    Expected signal: Sysmon Event ID 1: Process Create — powershell.exe with CommandLine containing Invoke-WebRequest, -Method POST, and http://127.0.0.1:8080/beacon. Sysmon Event ID 3: Network Connection — powershell.exe connecting to 127.0.0.1:8080. PowerShell ScriptBlock Log Event ID 4104 capturing the full script including the base64-encoded data construction. DeviceNetworkEvents in MDE: ConnectionSuccess or ConnectionFailed (depending on listener) with InitiatingProcessFileName=powershell.exe, RemoteIP=127.0.0.1, RemotePort=8080.

  2. Test 2curl Multi-Connection Data Exfiltration Beaconing Pattern

    Expected signal: 25x Sysmon Event ID 3: Network Connection events with Image=curl.exe (or full path), DestinationIp=127.0.0.1, DestinationPort=8080, Initiated=true. DeviceNetworkEvents: 25 ConnectionSuccess/ConnectionFailed records for curl.exe to 127.0.0.1:8080. The aggregate ConnectionCount of 25 crosses the MinConnectionCount=20 threshold in the KQL detection query. SPL ExfilScore increases as IsHighFrequency becomes 1 once count exceeds 20.

  3. Test 3DNS Data Exfiltration via Encoded Subdomain Labels

    Expected signal: Sysmon Event ID 22 (DNS Query): 10 DNS query events with QueryName containing 40-55 character first labels encoding the Base64 data, initiated by nslookup.exe. The DNS hunting query triggers on LongestLabel > 40 and QueryCount > 5 from the same process. Windows DNS Client Event Log may also record the queries. The queries will fail to resolve (no listener on 127.0.0.1:53) but the Sysmon Event ID 22 fires on the query attempt regardless.

  4. Test 4Linux curl Data Exfiltration via HTTP POST

    Expected signal: auditd: SYSCALL records for execve (curl), connect() calls to 127.0.0.1:8080, and read() on /etc/hostname and /proc. Sysmon for Linux Event ID 3: Network Connection events for curl process. Linux audit log (if auditd configured with network rules): socket()/connect() syscalls from curl with destination 127.0.0.1:8080. CommonSecurityLog or Syslog in Sentinel if auditd logs are forwarded: 15 connection records with consistent user-agent string indicating automated beaconing. The deceptive Windows user-agent string on a Linux process is itself anomalous.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections