Skip to content

DNS Cache Poisoning Bug

When a Name Server looks up a domain for the IP address, it stores the information into the cache so it doesn’t have to look it up every single time a request is made. For example, if someone looks for www.nishv.com the DNS server will look up the domain and stores the IP address 72.52.178.35 into the cache for a given time so it doesn’t have to look up that domain again for a given period of time.

DNS cache poisoning (also known as DNS cache pollution) is a maliciously created or unintended situation that provides data to a DNS Server that did not originate from authoritative DNS sources.

It happens when an attacker sends malicious data in response to a DNS query. For example, DNS query for www.nishv.com can be redirected to another website.

This method is taking the phishing scam to another level, you might be visiting your bank’s website but without you realising it, you will actually be putting in all the login information into some hackers servers which made it look exactly like the bank’s website. Yes, this is very serious!

How do you patch it?

On the client side (we are talking about Microsoft Windows here), your machines should have been patches automatically if you set the Auto-Update option. If not, I recommend you check the available updates and patch it as soon as possible.

If you use a DNS Server, my recommendation is to use the following command to figure out whether it has been patched or not. If it is not, STOP using it and have a look at this post on OpenDNS for more info.

Use the following DIG command on UNIX

dig +short @{name-server-ip} porttest.dns-oarc.net txt
dig +short @ns1.example.com porttest.dns-oarc.net txt
dig +short @208.67.222.222 porttest.dns-oarc.net txt

and you should get a result similar to this…

nishv@nishv.com [~]# dig +short @208.67.222.222 porttest.dns-oarc.net txt
porttest.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.
"208.67.217.8 is GREAT: 26 queries in 2.1 seconds from 26 ports with std dev 20119"

Or something like this…

nishv@nishv.com [~]# dig +short @4.2.2.2 porttest.dns-oarc.net txt
porttest.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.
"209.244.4.25 is GOOD: 26 queries in 1.9 seconds from 26 ports with std dev 3880"

If you don’t get GREAT or GOOD and gets something like POOR, you should immediately stop using it.

If you manage that DNS server, patch it or decommission it!

This is how to check on Windows

Open up command prompt by going Start –> Run –> CMD or on Vista typing CMD on the Start Search box

nslookup -type=txt -timeout=30 porttest.dns-oarc.net
nslookup -type=txt -timeout=30 porttest.dns-oarc.net ns1.your-isp.com
nslookup -type=txt -timeout=30 porttest.dns-oarc.net NS-SERVER-IP

You must see the GREAT or GOOD, if not your DNS Server is compromised.

DNS nslookup

comments powered by Disqus