Response playbooks, investigation guides, and Atomic Red Team tests are Pro-only. Upgrade to unlock the full detection package for THREAT-DNSTunnel-Exfil.
Upgrade to ProDetect DNS Tunneling for Covert Data Exfiltration in Google Chronicle
DNS tunneling encodes stolen data inside the query names (and occasionally TXT/NULL record responses) of DNS lookups, exploiting the fact that DNS is almost universally permitted outbound even in tightly filtered network environments. OilRig/APT34 has repeatedly built DNS-based communication into its custom malware families, using DNS resolution as both a C2 and exfiltration channel to survive proxy and firewall egress controls. FIN7 has used DNS tunneling against point-of-sale and retail environments where HTTP(S) egress was more tightly monitored than DNS. APT41 has deployed publicly available DNS tunneling frameworks such as dnscat2 during intrusions where direct HTTP(S) exfiltration was blocked. Commodity tooling in this space — iodine, dnscat2, DNSExfiltrator, and PacketWhisper — all share the same observable signature: large volumes of DNS queries for subdomains of an attacker-controlled domain, where the subdomain label itself is a base32/base64/hex-encoded chunk of stolen data, together with an abnormal skew toward TXT/NULL/CNAME query types and elevated NXDOMAIN rates (since many tunneling implementations use non-existent subdomains purely as a data-carrying vehicle). This detection deliberately focuses on DNS query-log analytics rather than endpoint process telemetry, since it catches tunneling traffic that a purely process-based detection would miss (e.g., DNS tunneling from a compromised network appliance, or malware that resolves names via direct socket calls rather than a monitored DNS client process) and is a good complement to the process-execution-based detections already covered on the parent T1048.003 page.
MITRE ATT&CK
- Tactic
- Exfiltration
YARA-L Detection Query
rule dns_tunneling_exfiltration {
meta:
author = "df00tech"
description = "Detects DNS tunneling exfiltration via long, high-cardinality subdomain queries"
severity = "HIGH"
mitre_attack_tactic = "Exfiltration"
mitre_attack_technique = "T1048.003"
threat_actors = "OilRig (APT34), FIN7, APT41"
reference = "https://attack.mitre.org/techniques/T1048/003/"
events:
$e.metadata.event_type = "NETWORK_DNS"
$e.network.dns.questions.type in %tunneling_query_types
$domain = $e.network.dns.questions.name
$hostname = $e.principal.hostname
match:
$domain over 5m
outcome:
$distinct_query_count = count_distinct($domain)
condition:
$e and $distinct_query_count > 50
} Chronicle YARA-L 2.0 rule matching NETWORK_DNS UDM events, grouping by queried domain over a 5-minute window and firing when the distinct-query count for a single session exceeds 50 with a query type favoured by DNS tunneling tools (TXT/NULL/CNAME, defined in the %tunneling_query_types reference list). Combine with a separate rule checking label length for higher precision.
Data Sources
Required Tables
False Positives & Tuning
- CDN/telemetry high-cardinality subdomain traffic — maintain a Chronicle reference list of known legitimate parent domains and add an exclusion
- Mail security gateway bulk TXT lookups for SPF/DKIM/DMARC validation
Other platforms for THREAT-DNSTunnel-Exfil
Testing Methodology
Validate this detection against 1 adversary technique 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 1Simulate DNS Tunneling Data Exfiltration via iodine
Expected signal: DNS query logs showing a burst of long, base32-encoded subdomain queries against tunnel.testdomain.example with a high proportion of NULL/TXT query types.
Unlock playbooks & atomic tests with Pro
Get the full detection package for THREAT-DNSTunnel-Exfil — response playbook and atomic red team tests, plus investigation guidance and hunting queries.
df00tech Pro — £29/user/month
Related Detections
Tactic Hub
Detection Variants (2)
Different telemetry and tradecraft for the same technique — pick the one that matches the data you collect.
- THREAT-DNSTunneling-ExfiltrationData Exfiltration via DNS Tunneling ToolsUse for endpoint DNS telemetry — Sysmon EID 22 / MDE DeviceDnsEvents; adds process attribution and tool fingerprints (iodine, dnscat2, DNSExfiltrator).
- THREAT-Exfiltration-ICMPTunnelData Exfiltration via ICMP TunnelingUse when the carrier is ICMP rather than DNS — pairs ping/tunneler process flags with firewall, NetFlow or Zeek ICMP records, which EDR network telemetry does not log.