DNS/Passive DNS
Adversaries may search DNS data for information about victims that can be used during targeting. DNS information may include registered name servers, records outlining addressing for subdomains, mail servers, and other hosts. Adversaries may directly query nameservers for a target organization, search centralized repositories of logged DNS query responses (passive DNS services such as CIRCL Passive DNS or SecurityTrails), or seek DNS misconfigurations and zone transfer vulnerabilities that reveal internal network structure. This reconnaissance phase generates no footprint in the victim's environment unless the adversary actively queries the organization's own authoritative DNS servers — making detection primarily possible through DNS server audit logs, high-volume query pattern analysis, and endpoint-based detection of DNS enumeration tools. Information gathered supports subsequent techniques including infrastructure acquisition, phishing campaigns, and external service exploitation.
// T1596.001 — DNS/Passive DNS Reconnaissance
// Three detection branches: zone transfer attempts, subdomain enumeration sweeps, and DNS recon tool execution
let DnsEnumTools = dynamic(["dnsrecon", "dnsx", "amass", "subfinder", "fierce", "dnsmap", "massdns", "dnscan", "dnsenum", "aiodnsbrute"]);
let DnsEnumArgs = dynamic(["--axfr", "-t axfr", "zone-transfer", "axfr ", "amass enum", "subfinder -d", "dnsrecon -d", "dnsenum --", "fierce --domain"]);
// Branch 1: DNS Zone Transfer Requests (AXFR/IXFR) hitting internal DNS servers
DnsEvents
| where TimeGenerated > ago(24h)
| where QueryType in ("AXFR", "IXFR")
| extend DetectionBranch = "ZoneTransferAttempt"
| extend RiskScore = 90
| project TimeGenerated, Computer, ClientIP, QueryType, Name, ResultCode, DetectionBranch, RiskScore
| union (
// Branch 2: High-volume subdomain enumeration — many unique labels queried per source IP per hour
DnsEvents
| where TimeGenerated > ago(24h)
| where QueryType in ("A", "AAAA", "MX", "NS", "TXT", "SOA", "CNAME", "SRV")
| extend RootDomain = extract(@"(?:[^.]+\.)?([^.]+\.[^.]+)$", 1, Name)
| where isnotempty(RootDomain)
| summarize
QueryCount = count(),
UniqueSubdomains = dcount(Name),
QueryTypes = make_set(QueryType, 6),
FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated)
by ClientIP, RootDomain, bin(TimeGenerated, 1h)
| where UniqueSubdomains > 100
| extend DetectionBranch = "SubdomainEnumerationSweep"
| extend RiskScore = 70
| extend Computer = "AuthoritativeDNS"
| project TimeGenerated = FirstSeen, Computer, ClientIP,
QueryType = "EnumerationSweep", Name = RootDomain,
ResultCode = strcat("UniqueSubdomains:", tostring(UniqueSubdomains), "/QueryCount:", tostring(QueryCount)),
DetectionBranch, RiskScore
)
| union (
// Branch 3: DNS enumeration tool execution on monitored endpoints
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any (DnsEnumTools)
or ProcessCommandLine has_any (DnsEnumTools)
or ProcessCommandLine has_any (DnsEnumArgs)
| extend DetectionBranch = "DnsEnumToolExecution"
| extend RiskScore = 80
| project TimeGenerated = Timestamp, Computer = DeviceName,
ClientIP = LocalIP, QueryType = "ProcessExecution",
Name = ProcessCommandLine, ResultCode = FileName,
DetectionBranch, RiskScore
)
| sort by RiskScore desc, TimeGenerated desc Data Sources
Required Tables
False Positives
- Authorized DNS zone transfers between primary and secondary nameservers (AXFR is a legitimate replication mechanism — query from known secondary NS IPs should be allowlisted)
- Internal DNS monitoring and auditing tools (e.g., Infoblox DDI health checks, SolarWinds IPAM, Microsoft DNS Manager) that perform bulk DNS queries for zone inventory
- Security posture assessments and penetration tests scheduled by the organization — these will generate exactly the patterns this rule detects
- Subdomain enumeration by legitimate SEO crawlers, web application security scanners (Qualys, Tenable), or cloud provider health probes querying public DNS records
- DNS enumeration tools executed by the red team, threat hunting team, or security researchers during authorized exercises
References (11)
- https://attack.mitre.org/techniques/T1596/001/
- https://www.circl.lu/services/passive-dns/
- https://dnsdumpster.com/
- https://learn.microsoft.com/en-us/azure/sentinel/connect-dns
- https://learn.microsoft.com/en-us/azure/sentinel/dns-normalization-schema
- https://github.com/darkoperator/dnsrecon
- https://github.com/projectdiscovery/subfinder
- https://github.com/owasp-amass/amass
- https://learn.microsoft.com/en-us/windows-server/networking/dns/troubleshoot/disable-dns-zone-transfer
- https://www.sans.org/blog/dns-zone-transfers-a-common-but-preventable-misconfiguration/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1596.001/T1596.001.md
Unlock Pro Content
Get the full detection package for T1596.001 including response playbook, investigation guide, and atomic red team tests.