Slashdot Mirror


DNS Cache Poisoning Spreads Malware

Gamma_UCF writes "As of April 4, 2005 the SANS Internet Storm Center has raised their alert level to Yellow following a rash of active DNS poisonings. The infected DNS servers are re-directing users from popular sites such as Google or American Express to malware infecting advertising sites. According to the ISC presentation on the attack, it is believed to be linked to known spammers and malware distributors. The full presentation of information up until this point can be found here."

40 of 314 comments (clear)

  1. IRC by Wizy · · Score: 4, Informative

    Anyone who has been on irc for over 8 years remembers when DNS cache poisoning first started showing up (about 97.)

    This is a quote from the "IRC Operators Guide" written in 8/97:
    "DNS spoofing is a relatively new hit these days on IRC. You'll generally find spoofs one of two ways - you're watching the connections (usermode +c) and an unusual hostmask appears, or a user reports one. The first thing to do is to get the user's IP address (/stats L nick), and check to see if the DNS lookup matches the IP address. If it doesn't, you know you have a spoof. With this information, you can KILL the spoof, and when it reconnects, see where the real host is and issue a K-line (which won't stop them from spoofing again, but will prevent them from signing on *without* spoofing). Some servers have the capability of D-lines, which allow you to ban by ip mask. A D-line will prevent the client from connecting at all, regardless of whether they try DNS spoofing or not. If the server supports the DLINE command, you can do /dline ipmask :reason."

    It has been a well known problem since way back then and it has still not be dealt with in any real way.

    1. Re:IRC by Anonymous Coward · · Score: 3, Informative

      There are some things DNS implementors can do to protect against DNS cache poisoning. The best article about the subject is here.

  2. Re:More reason to use Firefox by mboos · · Score: 2, Informative

    It's the malware on the sites that the infected DNS servers redirect to.

    --
    --Mike Boos
  3. Re:If this is such a big deal... by Wizy · · Score: 5, Informative

    We have. This has been a known problem since early 1997. It is well documented in the IRC community (admins and coders.)

    Documents like this one from 1997: http://www.cs.rpi.edu/~kennyz/doc/unix/dns.spoof

  4. Re:How does this work? by Tony+Hoyle · · Score: 4, Informative

    It's where you have an insecure server and someone manages to modify your zone file externally. It really shouldn't be possible any more... all dns servers ship secure by default, and any admin that makes such a configuration change should be fired on the spot.

  5. How to stop DNS cache poisoning by Anonymous Coward · · Score: 0, Informative

    As a rather well known expert in the field of cybersecurity, I offer the following solutions (sans my standard $450/hr rate) -

    Turn the lifetime of all DNS records to 0. This way they will not be cached, hence no poisoning issues

    Upgrade everyone to BIND 9.0 - including Windows - and turn on crypto. This will add security so malicious users can connect and poison the DNS cyber buffer!

    Implementing these 2 will solve 90% of problems. Free advice from a top security consultant at Foundstone. (you'd know my name)

    1. Re:How to stop DNS cache poisoning by menscher · · Score: 4, Informative
      If all DNS records had 0 lifetime, the load on the core DNS servers would cause them to melt. Nice if you want a DDoS, not so nice if you want the internet to work.

      Ever heard of a monoculture? It's dangerous. That's the primary reason Microsoft has so many security issues. To guard against this, the DNS infrastructure of the internet is intentionally made to be heterogeneous. They use different DNS software on different operating systems as much as possible.

      Top security consultant? Doubtful. More likely an AC trying (and failing) to impersonate someone with a clue.

    2. Re:How to stop DNS cache poisoning by ebvwfbw · · Score: 3, Informative
      You shouldn't charge so much for dated and misleading information. I just checked out a boatload of name servers and they are all not only running at 9.0, most of them at 9.2 or later. Not caching a domain like google is also bad advice. Someone more critical may even say unprofessional.

      If you bothered to RTFA, you would also know that the problem is with Windows NT servers (that should have been taken offline years ago or upgraded to Linux) and Unix machines that were compromised (probably also not up to date). No upgrade in bind will help you on that one and NT is famous for being full of holes. Don't sweat it though, "experts" are dated quickly in this field.

      Encourage people to keep their systems up to date, patched and watched would be better. Do integrety checking - like with tripwire. Check it every day. Even then you can still get burned, happens to the best of us.

      Now, how do I get one of those fancy $450/hr jobs (No moving to Boston!)?

    3. Re:How to stop DNS cache poisoning by sloth+jr · · Score: 2, Informative

      Moderators, wake up and mark parent down (or at least funny, or troll)!

      Several severe reality problems with this "advice" (it's surely a troll, people - come on, "DNS cyber buffer?"):
      While that's a sure fire way of killing cache poisoning for your own records, setting DNS TTL to 0 for all records *will* cause severe Internet Armageddon as the root DNS servers explode (client DNS servers would be screwed in short order as well).

      Since DNS is a distributed system, run by admins clueful and otherwise, setting DNS TTL to 0 everywhere is not possible (short of owning every single DNS server out there).

      Further, setting DNS TTL to 0 does nothing to prevent caching of records on your own DNS server (and serving it to your clients).

  6. Re:How does this work? by Anonymous Coward · · Score: 3, Informative

    usually its done by flooding a dns server with carefully crafted false replys based on known previous requests from the server.

    or by taking advantage of servers that listen to extra information that they really shouldn't listen to in a reply.

    with both methods the aim is to trick the dns server into cacheing your false response for its clients.

  7. Re:windowsupdate.microsoft.com? by Anonymous Coward · · Score: 5, Informative

    Has anybody tried to redirect windowsupdate.microsoft.com? That could potentially install malware at massive privilege levels and therefore impossible to remove. And it's done automatically.

    Automatic updates that are not signed and verified will not install.

  8. Re:More reason to use Firefox by bcmm · · Score: 2, Informative

    And besides, there are plenty of cross-platform attack you could do with this.

    Want a copy of a user's eBay cookie? (Ok maybe eBay doesn't save passwords this way but you get the point, lots of sites do. It's like phishing, but the computer believes it's genuine, not just the user).

    --
    # cat /dev/mem | strings | grep -i llama
    Damn, my RAM is full of llamas.
  9. Re:windowsupdate.microsoft.com? by Dejohn · · Score: 4, Informative

    I believe that all Windows Update patches are digitally signed, so this spoof might be harder to pull of than it would initially seem

  10. Re:More reason to use Firefox by netcrusher88 · · Score: 1, Informative

    Well, yes, but I meant the malware on the sites redirected to. Obvoiusly, you can't avoid the DNS cache poisoning, so this would be annoyingly effective for phishing.

    --
    There's an old saying that says pretty much whatever you want it to.
  11. Re:windowsupdate.microsoft.com? by dAzED1 · · Score: 2, Informative

    they are. Hopefully someone will take the GP down a notch or 2 from "5-insightful" and up your retort a few notches from "1"

    Its not just windowsupdate.microsoft.com that is prived - it's a little more sophisticated than that.

    I'm not even a MS apologist...haven't used a MS product in many years (except when I'm forced to for work-related reasons)

  12. Re:How does it happen? by Anonymous Coward · · Score: 5, Informative
    There are a few ways. Off the top of my noggin:
    • If your target DNS server is running Microsofts DNS server, on W2K SP 1 or 2 (this may have been patched, I dunno), you can poison DNS using an alias. It's simple. You have to have control of a zone (say realzone.com) and a DNS server. You create a zone on your dns server under the name you want to poison, say example.com. Your DNS server thinks it is authoritative for the example.com zone. Next you create a host record in example.com that points to a host you control. In your real zone (realzone.com), you create a CNAME record for a host like spoof that points to hostname at example.com, like www.example.com. Then you point your local stub resolver at the target DNS server (most DNS servers will resolve for anyone by default). When you try to lookup spoof.realzone.com, the target DNS server will find your dns server. Your dns server will see that spoof.realzone.com is a CNAME for www.example.com and look that up. Since it thinks it is authoritative for example.com, it will ask itself, and returh that IP address to the target DNS server. Now it is in the targets DNS cache. Anyone who tried to resolve www.example.com from that DNS server will get the IP address of the host you defined in the example.com zone. Spoof!.
    • Another way is to sniff the traffic of the target DNS server and when it tries to resolve a host name, feed it the result of your choosing before the recursive query finishes. The first response wins, generally.


    There are probably other ways, but it isn't hard.

    The bottom line, DNS is an untrustworthy system.
  13. Re:Djbdns - immune to DNS cache poisoning (?) by Tuqui · · Score: 3, Informative

    The separation between DNS Server and DNS Cache is very clever. This is a point that even BIND must take care.

  14. Re:simple by fimbulvetr · · Score: 4, Informative

    This is a DNS server issue, not a client issue.
    Suppose you visit citibank.com often. citibank.com is at 192.168.0.1 (It's an example). If the dns server you normally query has been poisened, it could potentially give you 10.0.0.1 (that's an example too). 10.0.0.1 could be a quick 0 day citibank look alike setup in korea with the sole purpose of grabbing your username,password,acct number, etc.
    The real citibank.com would never know that this happened, and there is a real chance the person who ran your dns server wouldn't know either.
    There are no 10 minute preventative measures one could do to protect themselves on this one, outside of using a known good dns resolver. Even then, you have to know the the dns server the resolver uses is good...

  15. Re:Question by OnceWas · · Score: 4, Informative

    Opera (or Firefox) isn't immune to phishing attacks. How would you know you're giving your banking info to a phony site that looks exactly like your own bank's login screen? Especially if the domain name is correct?

    I assume SSL would catch some of this, but not all.

    DNS poisoning is creepy, since it's browser/OS agnostic.

    --
    Laugh while you can, monkey-boy.
  16. Yes and no. by jd · · Score: 3, Informative
    It has been dealt with, at the specification level. DNSSEC has been around for a while and for the ultra-paranoid, you can always run IPSec tunnels between DNS servers.


    The "no" part is that virtually nobody does this. All the protection in the world is useless if you don't use it. Further, the protections that do exist (such as those I mentioned) get redesigned a little too often, making wide-scale rollouts a real problem.


    Routers are another key part of the infrastructure where there is plenty in place that COULD prevent poisoning, but where actual use in the "Real World" is limited. If DNS ever does improve, then scammers may well simply shift to poisoning router tables to achieve the same results.


    The resources spent on producing quality and security are phenominal. The resources spent on actually putting these into practice can barely be detected with the best tunneling electron microscopes.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  17. Re:How does it happen? by Rolan · · Score: 3, Informative

    Start by clicking the "HERE" in the article and, oh, wow, there's a whole report on how it happens!

    --
    - AMW
  18. No by temojen · · Score: 4, Informative

    The article is about DNS Cache poisoning, not DNS spoofing. In DNS cache poisoning you're effectively telling the victim's DNS server to query your (fake) server for all of a class of requests (ie *.com), instead of the one it should be querying. DNS spoofing only tries to fool reverse lookups.

    1. Re:No by Wizy · · Score: 2, Informative

      The first spoofing tool I used on irc (EFNet) actually did cache poisoning. I know there are the tools that only did the reverse lookup spoofing. But the cache poisoning was done way back when. I believe (and I could be mistaken) that a guy by the name of johan wrote one of the first ones.

  19. Re:If this is such a big deal... by Dionysus · · Score: 3, Informative

    DJB has talked about it at least as far back as November 2001.
    libresolv problems,talking about poissoning

    --
    Je ne parle pas francais.
  20. Re:Funny How Easy this is to prevent by McSpew · · Score: 4, Informative

    Damn, if only I had checked the "turn on security" box!!

    From MSFT (http://support.microsoft.com/kb/241352/EN-US/)

    How very wrong you are.

    Win2k DNS automatically turns on "secure cache against pollution" in SP3+. Read about it at http://support.microsoft.com/kb/316786/EN-US/. Specifically, you're looking for this quote:

    DNS cache pollution protection is enabled by default in Windows 2000 SP3 and later.

    Win2k DNS servers with this feature turned on are STILL vulnerable. I know because my DNS servers are configured this way and I began to suffer from the DNS poisoning on Thursday of last week. It took me until Friday to get a real handle on what was happening. Slashdot ignored my submission of this story back then. They were too busy jerking around with April Fool's stories.

  21. Brian Krebs of The Washington Post... by latuZimZactly · · Score: 3, Informative

    Wrote about this today in his blog:

    http://blogs.washingtonpost.com/securityfix/

    He provides some background and comments from companies effected by the attacks. And he offers some opposing views from SANS and Symantec Corp. on whether this is a serious concern or not.

  22. Re:Djbdns - immune to DNS cache poisoning (?) by Anonymous Coward · · Score: 2, Informative

    Yes, djbdns is immune to cache poisoning (and pretty much any other attack that doesn't depend on any fundamental weakness of DNS itself).

    It is also immune to buffer overflows and runs as a non-root user locked in a chroot. It also is EXTREMELY lightweight, has a much easier/automatable config format than BIND (in fact we wrote a front-end for BIND that uses the tinydns line-oriented format), and has predictable documented memory usage.

    It has been this way for years.

    Anybody who uses BIND or Windows DNS has only themselves to blame for problems like this!

    Feel free to be smug.

  23. Re:SANS vs. the rest of the security community. by httptech · · Score: 4, Informative
    I wrote this article about the source and motivations of the attack (also mentioned by the Washington Post blog), so SANS is not the only security organization talking about it. But there's a reason you're not hearing alarm bells all over.

    Basically it comes down to this - the attack was used to hijack searches for pay-per-click engines. It was done in the most obvious way and got a lot of attention. If they had been smarter, they would only have redirected defunct sites instead of cnn.com and the rest of the .com TLD.

    Now that the cat is out of the bag, people are watching for the traffic, so a second, more malicious attack probably won't see nearly as much success. So there's no reason to panic - it's a 4-year-old vulnerability as it is, and fixed by a simple registry edit. Most people will be unaffected by it.

    -Joe

    Joe Stewart, GCIH
    Senior Security Researcher
    LURHQ http://www.lurhq.com/

  24. Re:April Fools Idea by Anonymous Coward · · Score: 1, Informative

    Are there really people who read at +something? About the first thing I did when I arrived here was starting to read at -1. It was pretty obvious that the funniest shit happens there.

  25. Poor, misunderstood IMDB.COM by Anonymous Coward · · Score: 1, Informative

    Quoting the article:

    imdb.com (online music database)

    That might be news to the people who run imdb.com - it's the internet MOVIE database, not MUSIC database :).

  26. Re:djbdns by Anonymous Coward · · Score: 1, Informative

    Actually, BIND 9 is a complete rewrite of BIND and does not have the security issues that BIND 8 and 4 have. Basically, recent versions of BIND 8 and BIND 9 do create random DNS query IDs, which makes this kind of attack far more difficult (it would have been nice if DNS was designed with variable length query IDs back in 1983, but the Internet was a different place back then).

    I really wish DJB advocates would realize that BIND 9 is not BIND 8 and below.

    To DJB's credit, he has written The best article on DNS cache poisoning I have seen.

  27. worst one; by jafac · · Score: 2, Informative

    When I directed my friends to locate Spybot Search And Destroy via Google, they got redirected to a software site that claimed to be Spybot Search and Destroy - but the software would not CLEAN infected systems unless you paid. What you end up installing, of course, just installs MORE spyware.

    So when you point freinds to Spybot Search and Destroy, you've got to give them the actual download link.

    --

    These are my friends, See how they glisten. See this one shine, how he smiles in the light.
    1. Re:worst one; by Anonymous Coward · · Score: 1, Informative

      there are hundreds of fake sites like these
      this site lists the worst offenders

      and this site has a hosts file that blocks them

      regards
      --AJS

  28. Re:Question by Anonymous Coward · · Score: 1, Informative

    You moron, this affects all browsers regardless.
    Were talking about DOMAIN NAME SERVERS, the ones that resolve IP addresses and tell your browser where to go.
    This has been a big problem lately, so much so that my ISP decided they had to lie to me about it two months ago when I pressed them on this issue.

  29. Re:windowsupdate.microsoft.com? by mborland · · Score: 2, Informative
    I hope I can handle this question.

    First, contrary to what some people think, to access a site with HTTPS which has a certificate, you do NOT contact the CA over the internet. This is because your browser already has the public key of that CA installed. The signature of the certificate you are shown by the real or fake site is verified/rejected not by looking something else up on the internet, but by performing cryptographic tests against that installed public key of the CA. This is not only an efficient process, it is much more secure (for the spoofing reasons you suggest).

    That's if you're talking about SSL stuff. If you are talking about the digital signature of the file(s) from windows update, you're using a very similar approach. I don't know the details of Windows Update, but I'll bet there is a local public key or set of keys from MS that are used to check the signature...nothing to download or look up over the internet.

    If I explained that rather poorly, I apologize. I just wanted to express that, contrary to what most people think, you do NOT use connections to the CA to verify a certificate.

  30. If you are an end-user by danila · · Score: 1, Informative

    If you become a victom of a DNS poisoning attack or if you want to avoid that in the first place, you can use a DNS server other than that of your ISP. For example, below are the names of Microsoft DNS servers (that can be expected to work reliably and be relatively safe):

    DNS1.CP.MSFT.NET 207.46.138.20
    DNS2.CP.MSFT.NET 207.46.138.21
    DNS3.CP.MSFT.NET 207.46.138.126
    DNS4.CP.MSFT.NET 207.46.245.230
    DNS5.CP.MSFT.NET 64.4.25.30
    DNS7.CP.MSFT.NET 207.46.138.14

    The IP-addresses may change when Microsoft changes their DNS Architecture.

    --
    Future Wiki -- If you don't think about the future, you cannot have one.
  31. Re:How does this work? by Stuwee · · Score: 5, Informative
    From memory, classic DNS poisoning goes something like the following:
    1. Pick any DNS server which isn't authoritative for the domain which you wish to poison with the IP of your choosing. Something like your ISP's DNS server will work nicely.
    2. Send a legitimate DNS request to the server for a domain which is authoritative under a server you are in control of, and which your choosen server (and any in-between it and your own server) won't already have in its cache.
    3. When the request for the domain comes into your server, you have the sequence number which originated from your target DNS server. The idea with this sequence number is that your reply to the originating server contains the number, and hence the server knows which request is being replied to. Here is where the vulnerability comes in.
      Earlier versions of BIND use sequential sequence numbers in each request; nowadays pseudo-random numbers are used. What we're really after here is the next sequence number, or at least an idea of what it might be. In the case of sequential numbers, you have a rather small range of next sequence numbers. If your pseudo-RNG isn't cryptographically secure, it's possible to guess the next number in the sequence (for which you might want to make a few legitimate requests to your target server to observe the sequence).
    4. Next up, make a request to your target server for the domain which you want to take control of. For this to work, your target DNS server must send out a further request for this domain. Since you have an idea of the sequence number which has been sent out with this request, you can now start flooding the target DNS server with false replies.
    5. The ultimate goal is that you will hit the correct sequence number with your false reply before the legitimate reply comes in, hence poisoning the DNS. Further requests to your target server within the record timeout (which you may specify yourself in your false replies, so they can last quite a while) will be replied to with a cached version containing your poisoned IP.
    6. Watch the requests come in for the content to your own IP, serve up appropriately.
  32. Re:Djbdns - immune to DNS cache poisoning (?) by nothings · · Score: 3, Informative
    While I don't think I'm in the clear because of this, I feel better protected from the (unwashed ;)) internet.

    That seems fairly reasonable. I don't think you're really protected from poisoning, unless "poisoning" only applies to certain kinds of DNS spoofing. Specifically, first note the exceptions to the djbdns security guarantee:

    • Bugs outside of djbdns, such as OS bugs or browser bugs. (People could seize control of BIND 9.1 through an OpenSSL buffer overflow, but that was a bug in OpenSSL, not in BIND.)
    • The vulnerability of DNS to forgery. (BIND's port reuse makes blind forgery much less expensive, but this is a quantitative difference, not a qualitative difference. The DNS architecture needs cryptographic protection.)
    • Denial-of-service attacks. (BIND 9's fragility makes denial of service completely trivial; but an attacker can easily take down the Domain Name System without using any of BIND's bugs. The DNS architecture needs to be decentralized.)

    Specifically, his forgery page points out that a spoofing attack based on the birthday paradox can still work... although probably tens of millions of packets are required. This page, which I think I got off slashdot before, uses the TCP sequence-number guessing tools to try to attack it. It's probably not quite as secure as djb estimates, but probably still in the millions. They don't seem to have actually run numbers for the randomized-port plus randomized-id, so it's unclear whether they actually attacked that thoroughly.

  33. Re:SANS vs. the rest of the security community. by McSpew · · Score: 3, Informative

    So there's no reason to panic - it's a 4-year-old vulnerability as it is, and fixed by a simple registry edit. Most people will be unaffected by it.

    Ah, but here's the rub: It's not fixed by a simple registry edit. Win2k SP3 and SP4 are "secure" by default. I'm running Win2k SP3 and SP4, and I was bitten by this. The MS articles I initially found about cache poisoning didn't mention that SP3 and SP4 are secured by default, so I went and inserted the registry setting and restarted my DNS servers. The next day, the poisoning was back. That was when I discovered that SP3 and SP4 are secured by default, and that was when I realized that this problem is more serious than most people realize.

    I tried to publicize what I'd learned on Friday. I submitted the story to Slashdot, where it was rejected because it wasn't an April Fool's prank. I submitted it to Russ Cooper's NTBugTraq, where it disappeared into the ether. Imagine my consternation when Russ Cooper was quoted in today's Washington Post security blog saying that nobody was seeing it. I wrote to Russ immediately after seeing that quote and assured him that I was seeing it and I had posted to his list, but the post had not been approved by him.

    I'm pissed off because very few people are taking this seriously and well-meaning people such as yourself are dismissing it as a minor vulnerability that's easily remedied with a registry edit. This attack is not remedied by inserting a registry entry and restarting the server--it affects servers that are supposed to be immune.

  34. Re:SANS vs. the rest of the security community. by httptech · · Score: 3, Informative

    You probably would have been better off sending your findings to handlers@sans.org - you're the first person I've heard say that the fix doesn't work, and since SANS hasn't updated the information, I presume they haven't heard about it yet either.

    Despite the fact that your experience contradicts MS and CERT-CC, I'm willing to accept the possibility that because the .com label in the Authority section is technically a subdomain of any .com domain they may be querying, the SecureResponses key doesn't reject it. This would be a fairly big deal (not too big, you realize, since most of the world doesn't use MS DNS servers) that would require some independent testing in order to convince MS to change their stance (and fix the problem for real).

    Any chance you captured some of the traffic as it was occuring on your would-be immune servers? Because the poisoning attack from abx4.com is over now, so it will take a bit of work to recreate it in the lab without those servers to conveniently supply the test packets.