T1590.002

DNS

Adversaries may gather information about the victim's DNS infrastructure to support targeting. DNS reconnaissance reveals registered name servers, subdomains, mail servers, and host addressing. DNS record types including MX, TXT, SPF, DMARC, and DKIM records expose third-party cloud and SaaS provider usage (Office 365, Google Workspace, Salesforce, Zendesk). Adversaries may perform full DNS zone transfers (AXFR queries) against misconfigured authoritative servers, query passive DNS databases (Circl, SecurityTrails, Shodan), or run OSINT tools such as dnsrecon, subfinder, amass, and fierce. The collected intelligence maps the organization's external attack surface and informs infrastructure acquisition, phishing infrastructure setup, and initial access planning.

Microsoft Sentinel / Defender
kusto
let DNSOSINTTools = dynamic([
  "dnsrecon", "dnsrecon.py", "dnsx", "subfinder", "amass", "fierce",
  "fierce.py", "dnsmap", "dnsenum", "dnsenum.pl", "sublist3r",
  "gobuster", "dnstwist", "dnswalk", "masscan", "shuffledns",
  "puredns", "altdns", "knockpy"
]);
let PrivateRanges = dynamic(["10.", "192.168.", "172.16.", "172.17.", "172.18.", "172.19.",
  "172.20.", "172.21.", "172.22.", "172.23.", "172.24.", "172.25.",
  "172.26.", "172.27.", "172.28.", "172.29.", "172.30.", "172.31.",
  "127.", "169.254."]);
// Branch 1: DNS Zone Transfer Attempts (AXFR/IXFR) against internal DNS servers
let ZoneTransferAlerts = DnsEvents
| where TimeGenerated > ago(24h)
| where QueryType in ("AXFR", "IXFR") or QueryType == "255"
| where not(ClientIP has_any (PrivateRanges))
| extend AlertType = "External DNS Zone Transfer Attempt"
| extend RiskScore = 90
| project TimeGenerated, Computer, ClientIP, Name, QueryType, ResultCode,
         AlertType, RiskScore;
// Branch 2: Bulk ANY/NS/MX/TXT record enumeration from single external IP
let BulkEnumAlerts = DnsEvents
| where TimeGenerated > ago(1h)
| where QueryType in ("NS", "MX", "TXT", "SOA", "255", "AXFR")
| where not(ClientIP has_any (PrivateRanges))
| summarize QueryCount = count(), UniqueNames = dcount(Name),
           QueryTypes = make_set(QueryType), Earliest = min(TimeGenerated),
           Latest = max(TimeGenerated)
  by ClientIP, Computer, bin(TimeGenerated, 10m)
| where QueryCount > 30 or UniqueNames > 20
| extend AlertType = "Bulk External DNS Enumeration"
| extend RiskScore = 70
| project TimeGenerated = Earliest, Computer, ClientIP, QueryCount, UniqueNames,
         QueryTypes, AlertType, RiskScore;
// Branch 3: OSINT reconnaissance tools executed on managed endpoints
let OSINTToolAlerts = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName has_any (DNSOSINTTools)
    or (FileName in~ ("python.exe", "python3", "python3.exe", "python")
        and ProcessCommandLine has_any ("dnsrecon", "dnsenum", "fierce", "sublist3r", "dnstwist"))
    or (FileName in~ ("nslookup.exe", "nslookup") and ProcessCommandLine has_any ("ls -d", "ls -t", "-type=axfr", "-querytype=axfr", "-q=axfr", "-type=any", "-type=ns", "-type=mx", "-type=txt"))
    or (FileName =~ "dig" and ProcessCommandLine has_any ("axfr", "AXFR", "+short", "ANY", "TXT", "MX", "NS", "DKIM", "_dmarc"))
| extend AlertType = "DNS Enumeration Tool Execution on Endpoint"
| extend RiskScore = 60
| project TimeGenerated = Timestamp, DeviceName, AccountName, FileName,
         ProcessCommandLine, InitiatingProcessFileName,
         InitiatingProcessCommandLine, AlertType, RiskScore;
// Union all branches
union ZoneTransferAlerts, BulkEnumAlerts, OSINTToolAlerts
| sort by TimeGenerated desc
low severity medium confidence

Data Sources

Network Traffic: Network Traffic Content Process: Process Creation Command: Command Execution Windows DNS Server Logs (DnsEvents via Azure Monitor Agent)

Required Tables

DnsEvents DeviceProcessEvents

False Positives

  • Authorized DNS zone transfers between primary and secondary name servers — legitimate AXFR from secondary NS IP addresses configured for zone replication
  • Internal IT and security teams running DNS enumeration tools during authorized penetration tests, asset discovery, or DNS hygiene audits
  • Monitoring and asset management platforms (Qualys, Tenable, Rapid7) that perform DNS enumeration as part of scheduled scans against owned infrastructure
  • Developers and DevOps engineers using dig or nslookup with ANY/MX/TXT flags to troubleshoot mail delivery, SPF validation, or SSL certificate issues

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections