|
############################################################################
#####
Subject: DNS Multiple Race Exploiting Tool release
Homepage: http://www.securebits.org/dnsmre.html
Download: http://www.securebits.org/tools/dns_mre-v1.0.tar.gz
OS: The tool runs on Linux
Target OS: Tested against windows 2003 server
############################################################################
#####
01 Introduction
02 Features
03 Extra Notes
04 Running the Tool
05 Example
06 Credits
01 Introduction
---------------
DNS Multiple Race Exploiting Tool exploits an inherent bug in the
implementation
of DNS Cache. The result of this exploitation is cache poisoning/overwriting
with
new entries. The exploitation happens by querying a DNS server, that either
supports recursion or is configured with forwarders, for non-existent
hostnames
for a target domain. Along with the queries are fake reply/replies with
static
Transaction ID(s). Every query will generate another query from the DNS
server
with a random TXID. If one of the replies contains this specific TXID, the
cache
is poisoned. Because the replies are sent directly after the query, they
will
arrive at the DNS server much earlier than the legitimate reply from some
Name
Server.
This attack was discovered and announced by Dan Kaminsky of Doxpara
Research in
July 2008.
02 Features
-----------
A. The tool can attack both unpatched DNS systems as well as patched DNS
systems. Attacking a patched system requires a much longer time than an
unpatched system though.
B. The tool can launch two modes of attack; one is
against DNS server that supports recursion, and the second mode is against
DNS
server configured with forwarder DNS. The attack modes differ in the "flags"
carried in the DNS fake replies. Since a DNS with server forwarder(s) sends
a
query with the "recursion desired" bit set, the reply has to have this bit
set,
too. Also, the reply has to have the "recursion available" bit set. On the
other
hand, a DNS server with recursion sends query with the recursion bit unset
(i.e.
iteration query), the reply has to have this bit unset, too.
C. The tool spoofs the source IP address of the queries. This is useful if
the
attacker does not want leave any trace of his IP address on the server.
D. The tool utilizes CNAME Record Type to inject the false entry. The way
the
poisoning is implemented is by sending two answer Resource Records (RRs):
One is
a CNAME RR, and the second is an A record. Every fake reply contains
something
like:
[1] abdc.example.com is a CNAME of IN Class for www.example.com
[2] www.example.com is an A of IN Class for IP 11.22.33.44
E. The tool sends multiple fake replies with different TXIDs to increase
the
probability of hitting the correct TXID. This is useful in reducing the time
needed to generate a "hit". For a server that does not randomize the source
port
number, the maximum number of iterations needed is 65546 (an average would
be
32768). However, by sending 10 to 15 TXIDs, for example, the probability of
making a "hit" is higher in a shorter time; an average of ~3000 iterations
are
needed.
03 Extra Notes
--------------
[*] There is a sleeping time between sending the Query and the Replies. The
currently configured value of this time is 100 Milliseconds. This is
important
because during the test, I found that if the reply is sent directly along
the
query, the fake reply would arrive at the server before the server sends its
own query and the fake reply would eventually be ignored.
[*] There is another sleeping time between every iteration (query+replies).
This "time" is meant to control the amount of packets per second. Currently,
this "time" is 100 Milliseconds.
[*] The tool does not create the packets in every iteration. It creates the
needed packets (1 query and multiple replies based on the number of TXIDs)
at
once at the beginning. For later iterations, portions of the packets are
modified
and re-sent again. This is done for faster operation and to use the least
amount
of memory.
[*] I am currently researching the most optimized and efficient way to
poison a
DNS system that randomizes the source port address. This includes the
threshold
number of TXIDs beyond which an attack would be unsuccessful, or sending
multiple
queries first before sending their corresponding fake replies, and so on.
If you have some ideas and suggestions, please write to me at