DNS in Danger: New 'MaginotDNS' Attack Threatens the Entire Internet

Carding

Professional
Messages
2,829
Reputation
17
Reaction score
2,087
Points
113
Researchers have discovered an effective way to compromise top-level domains.

A team of researchers from the University of California, Irvine and Tsinghua University has developed a powerful new cache poisoning attack called "MaginotDNS" that targets conditional DNS (CDNS) resolvers and can compromise entire TLD top-level domains.

The attack was made possible by inconsistencies in the implementation of security checks in various DNS software and server modes, which leaves about a third of all CDNS servers vulnerable.

The researchers presented their work at the recent Black Hat 2023 conference, saying that the identified problems have already been fixed at the software level.

DNS (Domain Name System) is a hierarchical and distributed naming system for Internet resources and networks that helps convert human-readable domain names into numeric IP addresses to establish a network connection.

DNS resolvers (DNS resolvers) use UDP, TCP, and DNSSEC to make queries and receive responses. Resolvers can be iterative and recursive, involving multiple exchange steps with root servers, TLD servers, authoritative servers.

The concept of DNS cache poisoning is to inject fake responses into the resolver's cache, causing the server to direct users entering a legitimate domain to the wrong IP addresses, leading them to malicious websites without their knowledge.

CDNS resolvers support both recursive and redirect mode used by ISPs and corporate networks to reduce costs and improve access control. And it is the redirect mode that is most vulnerable.

Researchers have identified benchmarking inconsistencies in known DNS software, including BIND9 ( CVE-2021-25220 ), Knot Resolver ( CVE-2022-32983 ), Microsoft DNS, and Technitium ( CVE-2021-43105 ).

In some cases, experts have noted such configurations in which all records are treated as if they were in the root domain, which is a very vulnerable configuration.

The examples presented by the researchers during the BlackHat presentation include both on-path/inline and out-of-path (Out-path/Out-of-path) attacks. The latter are more complex, but also much more valuable to attackers.

For these attacks, hackers need to predict the source port and transaction ID used by the target's recursive DNS servers when making a request, and then use a malicious DNS server to send fake responses with the correct parameters.

Source port inference and transaction ID guessing can be done with brute force or with SADDNS.

The researchers scanned the Internet and found 1,200,000 DNS resolvers, of which 154,955 are CDNS servers. Then, using programmatic identification of vulnerable versions, they found 54,949 vulnerable CDNS servers, all of which are susceptible to in-path attacks and 88.3% are susceptible to out-of-path attacks.

The vulnerability identified by the researchers poses a serious threat to the stable functioning of the Internet for several reasons:
  • First, it affects a critical infrastructure - the DNS domain name system, which plays a key role in the operation of the entire global network. Its failure or compromise can lead to large-scale interruptions in the functioning of the Internet.
  • Secondly, the scale of vulnerable servers is very large - we are talking about hundreds of thousands of devices around the world. This opens up a wide range of attack opportunities for hackers.
  • Thirdly, the attack mechanism itself is quite sophisticated and allows you to bypass many existing protection measures, leaving DNS servers virtually defenseless.

All affected software vendors have confirmed the vulnerability and have fixed it. And Microsoft even gave an award to the researchers for their report.

However, for the issues to be fully resolved, CDNS administrators must apply fixes and follow the configuration recommendations provided by the vendors.
 

Carding

Professional
Messages
2,829
Reputation
17
Reaction score
2,087
Points
113
MaginotDNS attack to spoof data in the DNS cache

A group of Chinese researchers at the Black Hat USA 2023 conference revealed the details of the MaginotDNS attack, which allows for the substitution of incorrect NS records in the cache of DNS servers (cache poisoning), which are used simultaneously for redirecting requests (forwarder) and recursive name resolution (resolver). A successful attack can lead to access to incorrect DNS servers that give false information about the target domain, and the attacker can replace entire DNS zones, including those for top-level domains (.com, .net, .ru, etc.) .

The possibility of spoofing NS records for another domain is caused by an error in the Bailiwick validation algorithm used in DNS servers, which does not allow the acceptance of name servers that are not directly associated with the requested domain. In a situation where the DNS server can operate in both resolver and forwarder modes at the same time, Bailiwick check is performed only in resolver mode, but is not used in forwarder mode. Since both modes use a common DNS server cache, this feature can be used to replace records for requests in resolver mode through cache poisoning when manipulating requests and responses in forwarder mode.

Two variants of the attack are proposed: "off-path" - when the attacker cannot intercept traffic between the attacked DNS server and the upstream DNS server used as a forwarder; "on-path" - when an attacker can intercept DNS requests between the attacked DNS server and the forwarder. In the "on-path" mode, when the attacker received information about the network port number of the outgoing DNS request during traffic analysis, the attack performed a request for the "attacker.com" domain controlled by the attacker, which leads to a call to the attackers' DNS server, and at the same time, dummy responses are sent with data about NS records for the ".com" domain, which are cached. The demonstration of an off-path attack on the BIND DNS server additionally uses the SAD DNS attack technique to brute force the port number and 16-bit transaction ID of an outgoing DNS request, which in a test run required 1642 brute force attempts within 32 minutes.

The attack has been confirmed for BIND, Knot, Technitium and Microsoft DNS DNS servers. The Unbound, MaraDNS and PowerDNS DNS servers are not affected by the attack. In BIND (CVE-2021-25220) and Knot (CVE-2022-32983), attack vulnerabilities were fixed in early 2022 with Knot 5.5.1 and BIND 9.11.37, 9.16.27, and 9.18.1 releases.

In March 2022, researchers conducted a global network scan that identified 154,955 potentially attackable publicly accessible DNS servers operating simultaneously in redirect and resolve mode. Of these, 54949 DNS servers (35.5%) used vulnerable software. All vulnerable DNS servers were subjected to an "on-path" attack, carried out when traffic between the DNS server and the forwarder could be intercepted. The "off-path" attack variant, in which the attacker did not control the traffic, affected 88.3% of vulnerable servers.


 
Top