三个层级都被称作“DNS 服务器”
存根解析器
您自己的设备
递归解析器
运营商、路由器或 1.1.1.1
权威服务器
域名自己的 DNS
DNS Amplification Attacks: How Open Resolvers Are Abused
A direct flood needs the attacker to own the bandwidth it delivers. A reflection attack does not. The attacker sends a modest stream of small requests to many third-party servers, and those servers send the large replies to the victim. DNS has been a favorite for this for years, because DNS servers answer anyone and answers can be much larger than questions. This article explains the mechanism, shows how much amplification researchers measured, and covers the defences the IETF documents.
The mechanism in three steps
Forge the source address
The attacker sends a small DNS query over UDP and writes the victim's address as the sender. UDP has no handshake, so nothing along the way checks that claim.
Ask for something large
A query for type
ANYwith EDNS(0) can return every record a name holds, up to 4,096 bytes over UDP. Rossow (2014) notes that an attacker can even configure a domain they control so that its authoritative server returns exactly 4,096-byte answers. Resolvers cache these for the TTL, so the attacker's own server barely notices the load.Let the resolver do the sending
Each resolver answers the forged address. Thousands of resolvers together flood the victim with valid-looking DNS responses from legitimate servers, and the real attacker stays hidden.
How much amplification?
Rossow defines the bandwidth amplification factor (BAF) as the UDP payload bytes an amplifier sends to the victim divided by the UDP payload bytes the attacker sent to it, with Ethernet, IP and UDP headers left out. Ordinary lookups for A or MX records amplify little. The figures below are for the ANY-based abuse of DNS, next to three other protocols measured in the same 2014 study. “Top 10%” is the average over the tenth of amplifiers that respond with the largest answers.
| Protocol and request | Average BAF | Top 10% of amplifiers |
|---|---|---|
DNS, ANY via open resolvers | 28.7 | 64.1 |
DNS, ANY via authoritative servers that deploy DNSSEC | 54.6 | 98.3 |
| NTP, client statistics request | 556.9 | 4,670.0 |
| SSDP, search request | 30.8 | 75.9 |
| SNMP v2, bulk request | 6.3 | 11.3 |
DNS is neither the largest amplifier nor the only one, but it is the best known. Rossow estimated about 7.8 million open resolvers by extrapolating from a scan of a random sample of one million IPv4 addresses, and he identified at least 255,819 authoritative servers, a lower bound, so the pool of potential reflectors was enormous. The authoritative figure in the table was measured on the 1,404 of those servers that deploy DNSSEC for at least one domain, and he measured the open-resolver figure with a domain he controlled. His own analysis covered more than 130 real-world attacks, and he cites three large incidents: 167 Gb/s in May 2012, 300 Gb/s against Spamhaus in March 2013 and 100 Gb/s in August 2013. In each, attackers abused open DNS resolvers with ANY requests. These are measurements from 2013 and 2014; the numbers move, the mechanism does not.
The arithmetic of leverage
Because the factor divides what the victim receives by what the attacker sends, the bandwidth an attacker needs is the target divided by the factor. At the average of 28.7 for open resolvers, a flood of 1 Gb/s needs roughly 35 Mb/s of spoofed queries. At the 98.3 figure for the top tenth of authoritative servers, it needs about 10 Mb/s. For NTP's top figure of 4,670, Rossow's abstract puts it at 0.02 percent of the bandwidth the attacker wants the victim to receive. The factor ignores packet headers, so real traffic differs somewhat, but the leverage is the point: a modest uplink becomes a flood.
Why the root cause is spoofing
A reflection attack only works if forged packets can leave the attacker's network. Kührer and colleagues (2014) studied this directly. Their remote test revealed up to 2,692 autonomous systems that lack egress filtering, and Rossow cites the Spoofer Project's finding that 25 percent of autonomous systems allowed address spoofing as of July 2013. The same study reports that, during a notification campaign run with the security community, the number of NTP servers vulnerable to monlist amplification fell by more than 92 percent, although the authors say they cannot prove the campaign was the cause.
Three layers of defence
- Stop forged packets leaving the network. BCP 38 (RFC 2827) describes ingress filtering to defeat denial-of-service attacks that use forged source addresses, and BCP 84 (RFC 3704) extends it to multihomed networks. This is the fix that removes the cause.
- Do not run an open resolver. BCP 140 (RFC 5358) recommends serving recursion only to the intended clients, using an access list by source address, the incoming interface, or signed queries (TSIG or SIG(0)). RFC 5358 notes that choosing clients by incoming interface suits small-office and home routers with embedded recursive resolvers, which should not answer the whole internet.
- Make the answers less useful. RFC 8482 gives guidance for answering
ANYqueries with minimal responses instead of everything the server holds. DNS Cookies (RFC 7873) give servers a lightweight way to verify clients and limit abuse by off-path attackers. RFC 7766 notes that the TCP handshake generally prevents address spoofing, which makes TCP useful against reflection and amplification, and that TCP is now widely used in response rate limiting. Rossow cautions that carefully crafted attacks can evade poorly designed rate limiting, so it complements filtering of spoofed traffic and does not replace it.
Checking whether your resolver is open
Test from a network that is not the resolver's own, by asking it to resolve a name it does not serve. If you get an answer, it serves outsiders. An authoritative-only server will typically refuse recursive queries about other zones with REFUSED (the response codes are in Inside a DNS message).
dig @192.0.2.53 www.example.com A核心要点
Amplification needs two things: a server that answers anyone with a bigger message than it received, and a network that lets forged source addresses out. Closing open resolvers protects others; ingress filtering stops the attack at its source.
Sources and further reading
- Christian Rossow, Amplification Hell: Revisiting Network Protocols for DDoS Abuse, NDSS Symposium, 2014
- Marc Kührer, Thomas Hupperich, Christian Rossow and Thorsten Holz, Exit from Hell? Reducing the Impact of Amplification DDoS Attacks, 23rd USENIX Security Symposium, 2014, pp. 111-125
- RFC 2827: Network Ingress Filtering: Defeating Denial of Service Attacks which employ IP Source Address Spoofing (Ferguson and Senie, 2000)
- RFC 3704: Ingress Filtering for Multihomed Networks (Baker and Savola, 2004)
- RFC 5358: Preventing Use of Recursive Nameservers in Reflector Attacks (Damas and Neves, 2008)
- RFC 7766: DNS Transport over TCP - Implementation Requirements (Dickinson et al., 2016)
- RFC 7873: Domain Name System (DNS) Cookies (Eastlake and Andrews, 2016)
- RFC 8482: Providing Minimal-Sized Responses to DNS Queries That Have QTYPE=ANY (Abley et al., 2019)
需要查看某个域名的公网 DNS 地址?使用 Domain IP Lookup 工具。
常见问题
相关阅读
用伪造应答赢得竞速
攻击者
与真实响应抢先
伪造的应答
率先到达
解析器缓存
共用该缓存的所有人都被投毒
DNS 欺骗与缓存投毒:实用概览
伪造 DNS 响应来重定向流量,是网络领域最古老的手法之一,也是 DNSSEC 与现代解析器防御机制存在的原因。了解其原理与应对方式。
三个层级都被称作“DNS 服务器”
存根解析器
您自己的设备
递归解析器
运营商、路由器或 1.1.1.1
权威服务器
域名自己的 DNS
递归解析器与权威解析器详解
“DNS 服务器”一词其实指两种截然不同的角色:负责发问的递归解析器,和握有答案的权威服务器。本文帮您分清二者。
一次递归 DNS 查询,逐跳详解
浏览器
想访问 example.com
解析器
运营商 / 1.1.1.1
根 + TLD
谁负责 .com?
权威服务器
真正的答案
这条链路上的每一跳本身都是一次 DNS 查询,之后都会被缓存
DNSSEC 详解:DNS 应答如何被认证
了解 DNSSEC 签名、DS 与 DNSKEY 记录的作用,验证流程如何运作,以及配置失误为何会导致 SERVFAIL 响应。