Dns Attack
Dns Attack
Dns Attack
reverse zones to
Local DNS server. Configure an attacker's name server and use its domain name for three tasks
Task3: Cache poison the DNS resolver so as to send packets to attckers name server.
Explain BIND9 and RFC 1035 standards used for configuration settings.
In this activity we are performing local dns attack to be precise we are attacking between two machine ie server an
user but it is ethical incorrect to do it in actual servers and users so we first making environment such that the user
servers and attacker is at same system so we can achieve this by docker container , so first we downloaded the lab
setup provided by seed labs which contain docker images of user server and attacker , basicially by this lab setup
these are some command by which we can activate the docker.
From above commands our docker containers are ready to use till now ,after words Open five terminals, each
assigned to one of the following machines: local DNS server (IP: 10.9.0.53), user (IP: 10.9.0.5), attacker's name server
(IP: 10.9.0.153), seed attacker, and seed router, representing the three original machines, as well as the two spoofed
entities (attacker and router) for the user.
Run the commands so that all five terminals are also ready to use successfully and so that our machine is configured
sucessfully
So our all the five terminals are get configured successfully now we have to perform the tasks listed above one by
one.
#!/usr/bin/env python3
from scapy.all import *
def spoof_dns(pkt):
if (DNS in pkt and 'www.example.com' in pkt[DNS].qd.qname.decode('utf-8')):
After whole setup and running rndc flush command in server terminal the user ia asking the packet from
www.example.com by the help of dig command and asy you can see in python code attached above the packet is
spoofed in attacker terminal .
Task2: Cache Poison the local DNS server
Make certain that the DNS cache on the local DNS server is devoid of any entries. You can achieve this by executing
the command below to flush the cache: rndc flush
#!/usr/bin/env python3
from scapy.all import *
def spoof_dns(pkt):
if (DNS in pkt and 'www.example.com' in pkt[DNS].qd.qname.decode('utf-8')):
#!/usr/bin/env python3
from scapy.all import *
def spoof_dns(pkt):
if (DNS in pkt and 'www.example.com' in pkt[DNS].qd.qname.decode('utf-8')):
BIND9 is a widely used software that acts as a Domain Name System (DNS) server. It relies heavily on
the standards defined in RFC 1035 for its core functionalities. This RFC outlines the specifications for
operating and implementing DNS servers, including message formats, resource records, zone transfers, and
error handling mechanisms.
Think of RFC 1035 as the language that governs how DNS servers communicate. BIND9 configuration
files use this language to define various aspects of the server, such as zone definitions (mapping domain
names to IP addresses), resource record types (different types of information stored in the DNS), and
security settings. Understanding both BIND9 and RFC 1035 empowers you to effectively configure your
DNS server, troubleshoot issues, and gain a deeper understanding of how the DNS ecosystem functions.
Learnings
Get to know about the docker container and how 3 machine is setup in form of docker images
To learn more about the the attacks and there spoofing
Get to know about Bind and rfc 1035
Gain insights into how attackers can manipulate DNS records through techniques like cache poisoning and
spoofing to redirect traffic.
References
https://github.com/ChitrakshGupta/Essential-Cybersecurity-Activities-Seed-Labs/tree/master/Local
%20DNS%20Attack%20Lab (My own github)