"Nitro's ability to meet feature demands, coupled with its super fast NitroEDB data management engine on the back end put it in a unique position among SIEM vendors"
— Paul Roberts, Analyst, the 451 Group
 

Nitro on linked in Foolow us on twitter NitroSecurity's YouTube channel

 
 

Reducing the Risk of DNS Cache Poisoning via the Kaminsky DNS Vulnerability

download Reducing the Risk of DNS Cache Poisoning via the Kaminsky DNS Vulnerability whitepaper

The Kaminsky DNS Vulnerability, announced at the 2008 Black Hat event, poses significant risk to all network users, globally. While DNS vendors have rallied to provide patches, which protect against this vulnerability, there is still a significant risk that DNS servers can be exploited using the techniques outlined by Dan Kaminsky.

To help provide further protection, NitroSecurity worked with several outside security agencies--including the Rochester Institute of Technology--to develop a method wherein intrusion prevention (IPS) technology may be used to actively block this attack. The results: on it's own, NitroSecurity's proffered solution provides protection on par with a properly applied DNS server patch; when used to protect patched DNS servers, the protection is complete--virtually eliminating the risk of DNS cache poisoning.

"In the specified test environment a successful attack without the NitroSecurity IPS in place took approximately 4 minutes to exploit (average out of 10 tests). In the same environment with the addition of a NitroSecurity IPS, the attack continued for over 24 hours without a successful exploit. With a third party DNS server configured on the client, no noticeable interruptions occurred during an attack."

~ Rochester Institute of Technology

Overview

In response to growing concerns over the Kaminsky DNS Vulnerability, announced at the 2008 Black Hat event, NitroSecurity has researched additional methods of protecting corporate DNS resources, for use in addition to the application of DNS server patches, to prevent the successful exploitation of domain services. This research has led to the use of two custom detection signatures, which—when combined with reactive device blocking (also referred to as "blacklisting")—can provide much greater protection than that provided by DNS patches alone.

The need for the best possible protection against this vulnerability is driven by the proliferation of DNS throughout everyday personal and business Internet applications, and the potential risk involved in a successful DNS attack.

" ... the vulnerability described by Kaminsky is one that does not render DNS unusable, but rather allows the trusted application to answer legitimate questions with false and presumably dangerous answers ... one might argue that DNS cache poisoning has the potential to be far more hazardous to the safety of today's enterprise and it's unsuspecting user community."

1

While patching DNS servers is a requirement, the patch does not remove the vulnerability: it simply makes it more difficult to accomplish. Successful attacks have already been made against fully patched DNS servers.2 Discussion throughout the community is underway to find more layers of randomization to further reduce the chances of a successful attack. Most companies currently deploy Intrusion Prevention Systems, and if those systems support the correct features and signature libraries, they may be used as a further defense against this vulnerability. NitroSecurity has determined that, with the right combination of signatures and IPS features, along with appropriate DNS patches, the probability of a successful attack can be reduced from to 0.003% over one year, down from 37.1% over one month using the patch alone.3

Kaminsky's DNS Vulnerability

The Kaminsky DNS vulnerability is best described by Kaminsky himself4, but it is summarized here for convenience. The exploit uses known DNS vulnerabilities that allows a race condition between the attacker and a legitimate DNS server, in the attempt to gain ownership of DNS name/address translation. From Doxpara Research:

DNS can be thought of as a race: A request is sent. A good guy and a bad guy both want to get their replies to be trusted. The good guy has an advantage: He sees the request, and inside of it he can find a secret number, somewhere between zero to sixty five thousand. The race is not won until someone crosses the finish line with the secret number, and while the bad guy could guess the number, he has only a 1/65,536 chance of guessing correctly. Worse, the winner of the race gets to say how long it will be until the next race! The numbers can work out that it would take months, even years for the bad guy to finally win a race.

There's a new element, however, which improves the "bad guy's" chance of winning that race:

What's new is that the bad guy doesn't actually have to wait to start another race. DNS is actually more of a relay race than a sprint. Remember, you send a request to a server, and you might get a reply that says "www.foobar.com? Sure, here's the IP address to use." Or, you might get a message that says, "www.foobar.com? I don't know, ask ns1.foobar.com, here's its address." That's recursion. It's not a bug, or a rarely used feature. DNS is always sending you to different servers to find a record — this is how the servers that run .com work. ... names near www.foobar.com — 1.foobar.com, 2.foobar.com, 3.foobar.com — are referred to as "in-bailiwick". A referral to a name in-bailiwick must be trusted. ... he can run as many races as he wants. And eventually, he'll win one of them. And when he does win — when the bad guys guesses the secret number from 0 to 65536 — he won't just provide an answer for the random name that won. He'll simply feign ignorance: "83.foobar.com? I don't know, ask www.foobar.com, here's its address. Oh, and remember this for the next week."

From the perspective of a security vendor, this type of vulnerability is vexing because it is difficult to block. An IPS rule set to block DNS session responses would stop the attack, but would also block every legitimate DNS request, blocking legitimate traffic. The solution, as discussed later, must be aware of an attack, and must be capable of interrupting the race, but without arbitrarily blocking the legitimate operation of DNS.

Exploit Probability

The published solution to the vulnerability is the application of a patch to all vulnerable DNS servers (see CERT Vulnerability Note VU#800113 for a complete advisory). This is of course very important: the patch greatly reduces the probability of a successful exploit through randomization of the source port (in place of static udp/53). From CERT:

Because attacks against these vulnerabilities all rely on an attacker's ability to predictably spoof traffic, the implementation of per-query source port randomization in the server presents a practical mitigation against these attacks within the boundaries of the current protocol specification. Randomized source ports can be used to gain approximately 16 additional bits of randomness in the data that an attacker must guess. Although there are technically 65,535 ports, implementers cannot allocate all of them (port numbers <1024 may be reserved, other ports may already be allocated, etc.). However, randomizing the ports that are available adds a significant amount of attack resiliency. It is important to note that without changes to the DNS protocol, such as those that the DNS Security Extensions (DNSSEC) introduce, these mitigations cannot completely prevent cache poisoning. However, if properly implemented, the mitigations reduce an attacker's chances of success by several orders of magnitude and make attacks impractical.5

While this is true, analysis of the exploit probability shows that the attacks are still worthy of consideration. There is still a need to detect and protect against this exploit even after patches are applied. The solution discussed within this paper is fortuitously additive: that is, the solution will improve the protection provided by patching servers, to a probability approaching zero.

Figure 1 - Kaminsky DNS Vulnerability Exploit Probability

Acceptable Risk

"there's a reason you're not hearing anyone saying, "don't patch." And there's a reason we've been telling everyone this is just a stopgap — that we're still in trouble with DNS, just less. But in business, we choose our risks every single day. That's why it's called risk management, not risk elimination."

~ Dan Kaminsky 6

Figure 1 clearly illustrates that an unprotected and unpatched DNS server is essentially guaranteed to be exploited if attacked (The Blue Data). Protecting the network using the IPS protection solution (discussed in the following section of this paper) in conjunction with a patched DNS server is the best possible solution, resulting in minute probabilities of a successful attack (represented as green in Figure 1). It should be noted that deploying the DNS exploit IPS solution with an unpatched DNS server provides somewhat better protection than just patching the DNS server alone (the red and yellow lines in Figure 1). This presents a viable alternative to patching, if a DNS system is being used that can not be patched for some reason (although it is recommended that patches be applied immediately, and that if no patch is available, the DNS vendor in question be contacted immediately).

" As is typically the case in security, prevention truly is the best possible medicine."

~ Michael Leland7

The given probabilities for the DNS exploit may be acceptable. However, new attacks are being developed every day—around this vulnerability and others. The ability to detect malignant behavior among legitimate Internet protocol use, and to block such behavior, is necessary to thwart new variants. Thus the need for a further solution—such as the IPS protection solution described herein—that will:

  • Provide automatic and real-time protection against known vulnerabilities such as the Kaminsky DNS Vulnerability—for immediate defense.
  • Provide payload information involved in the attack (in this case, DNS server information)—to enable security teams to effectively and efficiently identify and block communications to the dangerous servers associated with the attack(s).

The Solution

NitroSecurity's IPS Protection solution provides additional defense against the Kaminsky DNS Vulnerability. The solution focuses on three areas:

  • The automatic detection of the attack
  • Active protection ("blocking") of the attack
  • Information gathering for further analysis and security measures

    Solution Details

    This solution utilizes a combination of several key IPS features, including:

    • Rate-based detection (threshold signatures)
    • Internal blacklist capability
    • Connection Tracking (flow collection)
    • Virtual IPS (aka, "multi-Snort")

    Rate-based detection is not a new concept to the security industry, although virtualization of the IPS detection ("Virtual IPS"), and the result-dependent suppression ("Internal Blacklist Capability") may be. Internal Blacklisting is the unique feature that enables the detection to become active, effectively blocking the attack while preserving legitimate DNS operation. While not inherently necessary to the solution, in noisy attacks such as an attack against a patched DNS server, the ability to run multiple detection engine processes in parallel is deemed prudent for the detection of two distinct signatures on between 134,217,728 and 4,294,967,296 packets.8

    Detection Signatures

    Two signatures are used to detect and threshold the types of response packets needed to actually accomplish the Kaminsky DNS Vulnerability attack. Again, the two custom detection signatures are processed in parallel for performance reasons. While the exact signatures are not presented here, there are open source equivalents published on emergingthreats.net 9. Using these signatures, the IPS detects both DNS 'A' and DNS 'NS' packets consistent with a Kaminsky DNS Vulnerability cache poisoning attack10. The rules use a rate thresholding capability to detect an anomalous DNS packet rate within what would otherwise look like normal DNS traffic. Unlike other approaches 11 , which might detect a Kaminsky attack, the use of this solution allows blocking behavior for actual protection against the attack.

    To mitigate the Denial of Service attack vector created by the two rules, the IPS' internal Connection Tracking system drops all DNS responses not preceded by a valid DNS request. The IPS makes available to the user detailed information about the triggered Kaminsky event, for use by SIEM or other event analysis tool. Included in this information is the triggering packet, containing the DNS Resource Records with the IP address of the dangerous DNS servers, the time at which the event was triggered, and which IPS detected the attack.

    IPS Blacklist

    The IPS capability that enables protection—that is, active blocking—of the DNS attack is the internal IPS blacklist. Blacklists, unlike typical IPS "block" actions, are the end-result of previous signature results, rather than a simple "block matched packet" methodology, they provide a "block subsequent packets after a match" methodology. This allows normal DNS responses to be received as normal. However, when the symptoms of the attack are detected, subsequent DNS responses from the suspect source IP are temporarily blocked, preventing the attacker from winning the DNS response race.

    Analysis and Conclusions

    In order to quantify how well NitroSecurity's solution mitigates Kaminsky attacks, Bernhard Mueller's DNS cache poisoning attack probability function12 was applied to an analysis of NitroSecurity's approach. NitroSecurity's NitroGuard IPS was used for internal test and validation. Figure 2 shows the details of the analysis. In addition to Mueller's assumptions, this analysis makes the following assumptions:

    R - The number of attack packets reaching a DNS server per second

    The value 15,000 was used for DNS servers not protected by an IPS based upon Mueller's assumptions.

    The value 0.1 was used for DNS servers protected by a IPS because the effect of the technique reduces the number of attack packets reaching a DNS server to this value.

    P - The effective number of ports used by a DNS server

    The analysis assumes that unpatched DNS servers will only use 1 port

    The analysis assumes that patched DNS servers will use all 64,000 unprivileged ports.

    N - The number of Authoritative DNS servers per domain

    The value 2 was chosen because at least two DNS servers per domain are required by DNS RFCs, and it also represents the scenario most vulnerable to a Kaminsky attack.

    The analysis shows:

    • Protecting a patched DNS server with an IPS reduces the probability of a successful Kaminsky attack to only a fraction of a percent, even if the attack lasts for as long as one year.
    • Protecting an unpatched DNS server with an IPS reduces the probability of a successful Kaminsky attack measurably, relative to a patched DNS server not protected by an IPS, even if the attack lasts for as long as one year.
    • Protecting an unpatched DNS server with a capable IPS, or patching a DNS server, significantly reduces the probability of a successful attack that lasts for up to one day, and after one day both solutions are increasingly inferior to protecting a patched DNS server with an IPS.
    • An unpatched DNS server, not protected by an IPS, is very likely to be successfully attacked within minutes.

    Considerations

    As with most network designs, there are considerations associated with a design that includes the NitroSecurity Kaminsky solution. These considerations are enumerated and discussed below. Kaminsky Flood Protection If an attacker floods a DNS server with nefarious DNS response traffic, consistent with a Kaminsky attack, the NitroGuard IPS will blacklist most of the flood traffic, thereby reducing the load on the protected DNS server and allowing it to maintain DNS responsiveness.

    Top-Level-Domain Poisoning Protection

    Because a top-level-domain Kaminsky attack looks just like any other Kaminsky attack to NitroSecurity's solution, the solution provides equally effective protection from this very dangerous aspect of the Kaminsky vulnerability. The NitroSecurity IPS protects against both single domain attacks (e.g., google.com) and tld domain attacks (e.g., com) by using the same signature detections and blacklisting

    Protection Against Internal DNS Poisoning

    One recommended method of reducing the risk of an exploit is to implement trusted, distributed resolution services such as those offered by OpenDNS. However, internal services are still at risk, and circumstances (availability, performance, etc.) may prevent some enterprises from using these services. NitroSecurity's proffered solution protects internal name resolution, as well as providing additional protection to those networks where outside DNS services are not feasible. NitroSecurity recommends using a service such as OpenDNS as a secondary or tertiary domain resolver, as a matter of best practice.

    Preventing DNS Denial of Service

    To prevent a Denial of Service of DNS resolution during an attack, the use of a trusted third party DNS server external to the NitroSecurity IPS is recommended. This is because, in some circumstances, legitimate name resolution may be impeded by the actions of the IPS. In these circumstances, normal "best practice" DNS configurations, including the use of trusted secondary and tertiary DNS using a 'trusted authoritative source' will provide failover resolution capabilities, assuming the proper configuration of such a facility in the local resolver. The use of a distributed system such as OpenDNS is recommended for external name resolution.

    Taking Further Action

    The NitroSecurity solution alerts, via the NitroView Enterprise Security Manager (ESM), network security personnel of any attacks and provides the information necessary to address the attacks, and to take further action, as necessary.

    1 Michael Leland, "Ask me no questions, I'll tell you no lies...", Online. http://www.siemblog.com/?p=9
    2 Evgeniy Polyakov, "Successfully poisoned the latest BIND with fully randomized ports!" [Online] http://tservice.net.ru/~s0mbre/blog/devel/networking/dns/2008_08_08.html
    3 Probability of success is calculated using Bernhard Mueller's DNS cache poisoning attack probability function. See Figure 1 (pg. 4) and Figure 2 (pg. 9) for details.
    4 Dan Kaminsky, "Details," July 24, 2008, DoxPara.com, http://www.doxpara.com/?p=1185
    6 Dan Kaminsky, "On the Flip Side," July 24, 2008, DoxPara.com, [Online] http://www.doxpara.com/?p=1215
    7 Michael Leland, "Ask me no questions, I'll tell you no lies...", Online. http://www.siemblog.com/?p=9
    8 Evgeniy Polyakov, "Successfully poisoned the latest BIND with fully randomized ports!" [Online] http://tservice.net.ru/~s0mbre/blog/devel/networking/dns/2008_08_08.html
    9 Jonkman, Matt, "DNS Poisoning Signature", [Online] 25-July-2008. http://www.emergingthreats.net/content/view/87/1/
    10 Kaminsky, Dan, "It's The End Of Cache As We Know It", [Online] 6-August-2008. http://www.doxpara.com/DMK_BO2K8.ppt
    11 Olney, Matthew, "Dan Kaminsky's 2008 DNS Vulnerability", [Online] 25-July-2008. http://www.snort.org/vrt/docs/white_papers/DNS_Vulnerability.pdf
    12 Mueller, Bernhard, "Improved DNS Spoofing Using Node Re-Delegation", [Online] 14-July-2008. http://packetstormsecurity.org/papers/attack/Whitepaper-DNS-node-redelegation.pdf




    These icons link to social bookmarking sites to help share this content.
    • share this page:
    • bodytext
    • del.icio.us
    • Reddit
    • Slashdot
    • Technorati
    • Propeller
    • TwitThis
 

Search NitroSecurity.com