info.cern.ch:
Before attackThe picture below shows the real page ofhttp://info.cern.ch with Firefox on the user machine
(it432a).
| After attackThe picture below shows a fake page ofhttp://info.cern.ch with Firefox on the user machine
(it432a). It actually shows the web content of the attacker's web server.
|
Now, let's start with setting up the environment.
about:config and set the IPv6 related options accordingly.
about:preferences
and change the setting. In particular, turn off the option "enable
secure DNS using:". This is a very powerful security measure to check the
authenticity of the DNS server. Our attack won't work with this option.
http://info.cern.ch.
http://info.cern.ch.
dig info.cern.ch
sudo nmcli con edit "Wired connection 1"
print set ipv4.ignore-auto-dns yes set ipv4.dns 192.168.172.5 save quit
sudo service NetworkManager restart
nmcli dev show | grep DNSGive the results of the above command in the lab report to show that your work is successful.
bind9 program for the DNS service.
bind9:
sudo apt update sudo apt install bind9
/etc/bind/named.conf.options as follows:
// dns-validation auto; to turn off DNSSEC.
dump-file "/var/cache/bind/dump.db";to specify the file to dump the DNS cache.
dns-validation no;to turn off DNSSEC.
options {
directory "/var/cache/bind";
// ...(omitted) ...
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
// dnssec-validation auto;
dump-file "/var/cache/bind/dump.db";
dnssec-validation no;
listen-on-v6 { any; };
};
After editing the file, run the following command to check if there is
any error in the configuration file you changed:
named-checkconf
sudo rndc dumpdb -cache sudo rndc flush sudo service bind9 restart
dig info.cern.ch
info.cern.chThe actual IP address is 188.184.21.108, but set the IP address in your fake response to the following:
192.168.172.6Note that this is the IP address of the attacker machine (i.e., it432c).
| it432a |
choi@it432a:~$ sudo systemd-resolve --flush-cache choi@it432a:~$ dig info.cern.ch ; <<>> DiG 9.16.1-Ubuntu <<>> info.cern.ch ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2294 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 65494 ;; QUESTION SECTION: ;info.cern.ch. IN A ;; ANSWER SECTION: info.cern.ch. 86400 IN A 192.168.172.6 ;; Query time: 71 msec ;; SERVER: 127.0.0.53#53(127.0.0.53) ;; WHEN: Sat Aug 06 03:03:41 EDT 2022 ;; MSG SIZE rcvd: 57 |
dig uses. It will be
helpful to flush it before running dig command. You will have
trial and errors.
prn argument)
print the packet, your function has to craft and send a fake packet. The
general code flow should be as follows:
def spoof(pkt):
ip = IP(...)
udp = UDP(...)
dns = DNS(...)
pkt = ip/udp/dns
send(pkt)
You will have to use as much information from pkt as possible to
craft the packet successfully.
sudo apt update sudo apt install apache2
sudo systemd-resolve --flush-cache
http://info.cern.ch. (You probably need
to refresh the page.)
~/bin/submit -c=IT432 -p=lab03 lab03_report.doc *.py
sudo nmcli con edit "Wired connection 1"
print set ipv4.ignore-auto-dns no set ipv4.dns save quit
sudo service NetworkManager restart