T1584.002

DNS Server

Adversaries may compromise third-party DNS servers to support operations. By gaining control over DNS infrastructure, adversaries can alter DNS records to redirect organizational traffic, facilitate credential harvesting, or redirect users to adversary-controlled infrastructure mimicking legitimate services. This technique is used by threat actors including Sea Turtle and LAPSUS$, who modified NS records and DNS configurations to intercept traffic at scale. Unlike acquiring new DNS infrastructure (T1583.002), this involves compromising existing, trusted DNS servers — making detection harder due to the perceived legitimacy of the infrastructure.

Microsoft Sentinel / Defender
kusto
// Part 1: Detect endpoints querying non-authorized DNS servers (port 53 to unexpected destinations)
let AuthorizedDNSServers = dynamic(["8.8.8.8", "8.8.4.4", "1.1.1.1", "1.0.0.1", "9.9.9.9"]); // Customize with your org's DNS IPs
let InternalRanges = dynamic(["10.", "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.", "192.168."]);
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemotePort == 53
| where RemoteIPType == "Public"
| where not(RemoteIP has_any (AuthorizedDNSServers))
| where not(LocalIP has_any (InternalRanges))
| project Timestamp, DeviceName, LocalIP, RemoteIP, RemotePort, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName
| extend Indicator = "Rogue DNS Server Query"
| union (
// Part 2: Detect DNS configuration changes via registry (changing DNS server settings)
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has_all ("SYSTEM", "CurrentControlSet", "Services", "Tcpip", "Parameters", "Interfaces")
| where RegistryValueName in~ ("NameServer", "DhcpNameServer", "SearchList", "DhcpDomain")
| where ActionType in~ ("RegistryValueSet", "RegistryKeyCreated")
| project Timestamp, DeviceName=DeviceName, LocalIP="", RemoteIP=RegistryCurrentValueData, RemotePort=53, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName
| extend Indicator = "DNS Configuration Changed"
)
| sort by Timestamp desc
high severity medium confidence

Data Sources

Network Traffic: Network Connection Creation Windows Registry: Windows Registry Key Modification Microsoft Defender for Endpoint

Required Tables

DeviceNetworkEvents DeviceRegistryEvents

False Positives

  • Developers or researchers intentionally using alternative public DNS resolvers (1.1.1.1, 9.9.9.9, 8.8.8.8) for testing — common on developer workstations if these are not in the authorized list
  • VPN clients that change DNS server assignments upon connecting, particularly split-tunnel configurations that use provider DNS
  • DHCP lease renewals that legitimately update DhcpNameServer registry values as part of normal network operations
  • Containerization platforms (Docker Desktop, WSL2) that configure their own virtual DNS resolvers pointing to non-standard IPs
  • Mobile hotspot tethering or public WiFi usage where the DHCP-assigned DNS differs from corporate infrastructure

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections