- Left = vm_0 = 192.168.15.4 = localhost:23333 = victim DNS Server = Apollo
- Right Top = vm_3 = 192.168.15.7 = localhost:23335 = Attacker = dns_attacker
- Right Bottom = jin511_ = 192.168.15.5 = localhost:23334 = User = dns_user
- see
commit 42417bb9ce435c01727b8bf2af4f6e43248a2ca9for how I Poison the cache of Apollo from the attacker's machine- Actually,
commit ba53c2eab735d558a817342ab9c91a8840bf6976did a great improvement on the success probability, but MOST of my effort is in the previous commit.
- Actually,
- see here, this is the poisoned DNS cache from Apollo (after I run ./udp <attack_IP> <server_IP> and poisoned the server successfully).
- You can type
cat my_result.db | grep dnslabto see the result of my poison.
- You can type
- Steps for having done these:
- restart the DNS Server on Apollo
- config the attacker machine, letting it use Apollo as the local DNS Server (by Configing the DHCP client on it)
- actually, you can also do this similarly on the user's machine
- Send a non-exist url (
?????.example.edu) from attacker machine to Apollo, and this is almost implemented in the original udp.c - After 3., the attacker should pretend it's the real domain server
example.edu., build tons of fake responses and send to Apollo, hoping one's Transaction ID is identical towhat Apollo actually sends to the real domain server. This is implemented by me in the newest udp.c- We need to know the real ip of the real domain server
example.edu., and it's easy to usedigcommand to do so. - We need to know all the details of the DNS protocol and how to build a fake one, actually I combine the information from both lab_description_pdf and the wireshark package capture results.
- We need to know the real ip of the real domain server
- Go back to 3., repeat this process for several times. Actually after my calculating, in
commit ba53c2eab735d558a817342ab9c91a8840bf6976I implement a method which has roughly80%possibility to poison the DNS Server's Cache each time you run ./udp <attack_IP> <server_IP>.
- see here, this is the dig result from the user's machine.
- Steps for having done these:
- config the Apollo, when meeting
ns.dnslabattacker.net., just go to192.168.15.7(not192.168.15.6, because of my VM's configure) - config the attacker's machine, build a rule of which (fake) ip address to return when the user sends a dns lookup like
<??>.example.eduto Apollo (and then attacker) dig www.example.eduon user's machine
- config the Apollo, when meeting
- since it's against the Bailiwick checking.
ns.dnslabattacker.net.is not in domainexample.edu.
- Modify content in attacker's machine's
/var/www/index.html(You can contain some malicious contents, but I didn't) - Add a new rule
test IN A 192.168.15.7in attacker's machine's/etc/bind/example.edu.db, and then restart the attacker's DNS server. - What happened?
- When the user type
wget http://test.example.edu, it first sends DNS query to Apollo (cause Apollo is its local DNS Server) - Since the DNS Cache of Apollo is already poisoned, it recv DNS query
test.example.edu, and wantsns.dnslabattacker.net.can answer the ip. Because we have already modified/etc/bind/named.conf.default-zoneson Apollo, this query will be directed to attacker (192.168.15.7) - Then attacker reply "The IP for
test.example.eduis 192.168.15.7" - Then the user send HTTP request to 192.168.15.7, thus finishing our attacking.
- When the user type