This Python script allows you to perform DNS spoofing by intercepting DNS packets and modifying their responses. It utilizes the netfilterqueue
library to capture and manipulate network traffic
Before running the script, make sure you have the following prerequisites installed:
- Python 3.xx
scapy
librarynetfilterqueue
library You can install the required libraries using pip:
$ pip install scapy netfilterqueue
or if netfilterqueue
not installed properly, try this:
$ sudo pip3 install --upgrade -U git+https://github.com/kti/python-netfilterqueue
$ python3 dns_spoofer.py --host <IP_ADDRESS> --queue-num <QUEUE_NUMBER> --domain <DOMAIN_NAME>
--host
: Specify the IP address for your fake DNS server.--queue-num
: Specify the queue number to trap the sniffed packets.--domain
: Specify the domain name that you want to spoof its IP.
- Run your script and provide the
queue-num
to the one that you specified before in the command above:
$ python3 dns_spoofer.py --host 192.168.152.157 --queue-num 7 --domain www.bing.com
To run this script, you need root privileges
since it involves manipulating network traffic. Make sure to run it with administrative rights.
This script is provided for educational purposes only. Use it responsibly and at your own risk.
Disclaimer: This script should only be used on networks that you have permission to test or for educational purposes on your own network. Unauthorized use is illegal and unethical.
v1.0.3 - 29/12/2023
- improve DNS spoofing functionality
- increase verbose output to user