DNS Authoritative Server, disabled recursive lookups and analyzed the logs
We operate a number of DNS servers, one of which we left open for recursive lookups for clients to see their sites before they’ve moved the DNS. While we normally handle that through a proxy server we maintain, DNS was a secondary method for doing this which was sometimes easier than having a client use a proxy server.
Today, after 60 days notice, we shut off external recursive lookups at 6pm EST. In the last two hours, we’ve received a number of ‘lookups’ from a few ‘high volume’ IP Addresses. The list is surprising.
Output from (annotated with whois info):
grep -E 'denied$' /var/log/syslog|cut -f 8 -d ' '|cut -f 1 -d '#'|sort|uniq -c|sort -nr|head -n 30
506452 22.214.171.124 (GTS Telecom Romania Operations) 38444 126.96.36.199 (Cloudflare EU) 10490 188.8.131.52 (Cloudflare EU) 10236 184.108.40.206 (Softlayer) 4784 220.127.116.11 (OneandOne AG) 1277 18.104.22.168 (Godaddy) 673 22.214.171.124 620 126.96.36.199 617 2001:2060:ffff:a01::53 (Sonera, Finland) 528 188.8.131.52 (Cyber Technology BVBA) 528 184.108.40.206 (Cyber Technology BVBA) 528 220.127.116.11 464 18.104.22.168 323 22.214.171.124 306 126.96.36.199 294 188.8.131.52 270 184.108.40.206 230 220.127.116.11 213 18.104.22.168 207 22.214.171.124 202 126.96.36.199 192 188.8.131.52 190 184.108.40.206 190 220.127.116.11 190 18.104.22.168 180 22.214.171.124 168 126.96.36.199 160 188.8.131.52 153 184.108.40.206 152 220.127.116.11
What are we seeing?
GTS Telecom Romania Operations: # grep 18.104.22.168 /var/log/syslog|cut -f 2 -d "'"|sort|uniq -c|sort -nr|more 539590 isc.org/ANY/IN CloudFlare EU: # grep 22.214.171.124 /var/log/syslog|cut -f 2 -d "'"|sort|uniq -c|sort -nr|more 41660 ripe.net/ANY/IN # grep 126.96.36.199 /var/log/syslog|cut -f 2 -d "'"|sort|uniq -c|sort -nr|more 10490 ripe.net/ANY/IN SoftLayer: # grep 188.8.131.52 /var/log/syslog|cut -f 2 -d "'"|sort|uniq -c|sort -nr|more 10924 ripe.net/ANY/IN 1 pdkamoaaaaekt0000dkaaabaaafbadli.ripe.net/ANY/IN 1 oobdjlaaaaekt0000dkaaabaaafbadli.ripe.net/ANY/IN 1 onigfiaaaaekt0000dkaaabaaafbadli.ripe.net/ANY/IN 1 ojfhfgaaaaekt0000dkaaabaaafbadli.ripe.net/ANY/IN 1 nphhdiaaaaekt0000dkaaabaaafbadli.ripe.net/ANY/IN 1 ngffklaaaaekt0000dkaaabaaafbadli.ripe.net/ANY/IN OneandOne AG: # grep 184.108.40.206 /var/log/syslog|cut -f 2 -d "'"|sort|uniq -c|sort -nr|more 5196 isc.org/ANY/IN Godaddy: # grep 220.127.116.11 /var/log/syslog|cut -f 2 -d "'"|sort|uniq -c|sort -nr|more 3031 ripe.net/ANY/IN
Lumped into that was an IPv6 resolver that actually pointed out an interesting issue. The domains 2001:2060:ffff:a01::53 is looking for should be hitting our server for an authoritative lookup, but, appears to be doing recursive lookups. I’ve made a minor change to our configs to see if I can log a bit more data as it isn’t a continuous stream.
It is interesting to see the number of hits that occurred in a two hour period which explains why the network PPS rate on that server has been higher than normal.
This traffic is part of a DNS reflection DDOS attack using spoofed UDP packets with the ‘source address’ set to the above targets. Why they’ve chosen isc.org or ripe.net as their typical entry, I don’t know. Since UDP is a connectionless protocol, there is no Syn/Ack, making DNS susceptible to spoofed packets. Our DNS resolver, which was previously publicly available, was responding based on the source IP in the UDP payload. The hackers chose a particular group of servers to send those responses to.
Oddly, I did see some TCP traffic from one of Cloudflare’s EU servers which should have been impossible as they are using anycast. Shortly after disabling recursive lookups, the attack stopped. This means that the hackers are watching the servers involved in the attack and when they saw that it was no longer affected, they stopped sending that spoofed traffic.
We are in the process of upgrading our DNS servers and swapping things around and this was the first step in redesigning our DNS infrastructure. It was only by chance we noticed that our resolver was being used in the DNS reflection attack as it was only sending out a few mb/sec more traffic than it should have been.
My apologies to the servers that were receiving DDOS traffic from our resolvers.