T1071.004 IBM QRadar · QRadar

Detect DNS in IBM QRadar

Adversaries may communicate using the Domain Name System (DNS) application layer protocol to avoid detection/network filtering by blending in with existing traffic. Commands to the remote system, and often the results of those commands, will be embedded within the protocol traffic between the client and server. The DNS protocol serves an administrative function in computer networking and thus may be very common in environments. DNS traffic may also be allowed even before network authentication is completed. Often known as DNS tunneling, adversaries may abuse DNS to communicate with systems under their control within a victim network while also mimicking normal, expected traffic. DNS beaconing may be used to send commands to remote systems via DNS queries. The commands may be embedded into different DNS records, for example, TXT or A records.

MITRE ATT&CK

Tactic
Command and Control
Technique
T1071 Application Layer Protocol
Sub-technique
T1071.004 DNS
Canonical reference
https://attack.mitre.org/techniques/T1071/004/

QRadar Detection Query

IBM QRadar (QRadar)
sql
SELECT
  sourceip AS ClientIP,
  COUNT(*) AS QueryCount,
  COUNT(DISTINCT "DNS Query Name") AS UniqueSubdomains,
  AVG(LONG(STRLEN("DNS Query Name"))) AS AvgDomainLength,
  MAX(LONG(STRLEN("DNS Query Name"))) AS MaxDomainLength,
  DATEFORMAT(MIN(starttime), 'yyyy-MM-dd HH:mm:ss') AS FirstSeen,
  DATEFORMAT(MAX(starttime), 'yyyy-MM-dd HH:mm:ss') AS LastSeen
FROM events
WHERE LOGSOURCETYPENAME(logsourceid) ILIKE '%DNS%'
  AND (
    "DNS Record Type" IN ('TXT', 'NULL', 'CNAME', 'MX', 'A', 'AAAA')
    OR "DNS Record Type" IS NULL
  )
  AND STRLEN("DNS Query Name") > 0
  AND (
    LONG(STRLEN("DNS Query Name")) > 50
    OR (
      LONG(STRLEN("DNS Query Name"))
      - LONG(STRLEN(REPLACE("DNS Query Name", '.', '')))
    ) > 5
  )
  AND starttime > (NOW() - 86400000)
GROUP BY sourceip
HAVING COUNT(*) > 20
  AND COUNT(DISTINCT "DNS Query Name") > 10
  AND AVG(LONG(STRLEN("DNS Query Name"))) > 40
ORDER BY QueryCount DESC
high severity medium confidence

Detects DNS tunneling (T1071.004) in IBM QRadar SIEM by aggregating DNS query events from DNS log sources over the past 24 hours. Uses the custom event properties 'DNS Query Name' and 'DNS Record Type' — which must be configured via a DNS DSM or manual Custom Event Property mapping — to identify source IPs issuing high volumes of distinct long subdomain queries. The subdomain count heuristic uses string-length difference of the FQDN before and after dot removal to avoid regex overhead in AQL.

Data Sources

Infoblox NIOS syslog (QRadar DSM)ISC BIND query logsMicrosoft Windows DNS Server debug logsCisco Umbrella logsPi-hole FTLDNS logs

Required Tables

events (QRadar SIEM event store with DNS Custom Event Properties configured)

False Positives & Tuning

  • Akamai and other CDN networks use long encoded hostnames for geographic load balancing — queries to *.akamaiedge.net or *.cloudfront.net exceed 50 characters and appear in high volume from corporate egress NAT addresses
  • Security operations platforms performing bulk passive DNS replication or threat intelligence enrichment from internal sensor appliances generate high query volumes with varied subdomains against external resolvers
  • Enterprise backup solutions and DLP agents using DNS-based license validation or cloud telemetry beaconing may exhibit long-domain query patterns from backup server IP addresses during scheduled jobs
Download portable Sigma rule (.yml)

Other platforms for T1071.004


Testing Methodology

Validate this detection against 3 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 1DNS TXT Record Tunneling Simulation

    Expected signal: DNS query logs showing 20 TXT record queries to unique subdomains under c2test.localhost with base32-encoded subdomain prefixes. Sysmon Event ID 22 (if available) showing dig process making DNS queries.

  2. Test 2DNS Beaconing via nslookup

    Expected signal: Sysmon Event ID 22: DNS Query for each nslookup execution with QueryName containing COMPUTERNAME and random values under beacon.localhost. Sysmon Event ID 1: nslookup.exe process creation. 10 queries at 5-second intervals.

  3. Test 3High-Volume DNS Query Burst

    Expected signal: DNS query logs showing 100 A record queries to unique 30-character random subdomains under exfil.localhost in rapid succession. Total estimated data capacity: ~3KB encoded in subdomain labels.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections