Helping to stop DDOS - Detecting DNS Recursion Configuration Issues
Recently, Tenable was asked about detecting DNS servers that were configured to respond to DNS "recursion" queries. The issue is that a remote attacker could spoof a recursive DNS query with a source address of a network they wish to cause a denial of service for. The attacker spoofs a query with a small payload and causes the DNS server to reply with much more data. This floods the target network with answers to questions it never asked for.
In 2005, the US CERT organization put out a note titled "The Continuing Denial of Service Threat Posed by DNS Recursion" which detailed the attack technique and methods to secure various commercial and open source DNS servers. This vulnerability has been around for several years but according to CERT, is still actively used for DDOS attacks. Tenable has two methods to detect these vulnerabilities.
First is Nessus plugin #10539. This plugin detects DNS recursion in general. If you run Nessus from inside your network, then being able to perform such a query isn't necessarily an issue. However, if you have placed your Nessus scanner outside of your network, or are auditing a remote DNS server, being able to perform a recursive query is likely a problem.
Second, Tenable's Passive Vulnerability Scanner has a rule to detect DNS servers which have responded to recursive DNS queries. The screen shots below show a view of DNS issues passively discovered under the Security Center.
The first screen shot lists all "port 53" vulnerabilities passively found. Vulnerability #03703 is the one identifying a recursive DNS server. Other information includes a list of machines with UDP port 53 open, and machines which "browse" on port 53. The second screen shot is the actual description which is worded as if the PVS was deployed internally.
Being able to passively monitor for such issues 24x7 without scanning is very useful, especially if a new DNS server is added or an undocumented change is made to a DNS serve before the next active scan. If the PVS is placed outside your network, or in a spot where it can see external DNS queries, then it will also see successful external recursive DNS queries.
Regardless if you are a large or small network, if you have DNS servers that do respond to recursive DNS queries from external sources, you may be contributing to someone else's DDOS attack and not even know it. The CERT note mentioned in their testing, 80% of all DNS servers were subject to this problem. Because there are so many DNS servers to use, attackers can launch their attacks using multiple DNS servers. Each site participating in the attack may only contribute a small percentage of the overall bandwidth, but the target network gets flooded.