A collection of Python scripts for network reconnaissance and penetration testing, built with Scapy. Written as practical learning exercises for understanding core network attack techniques at the packet level.
⚠️ LEGAL & ETHICAL DISCLAIMER These scripts are for educational purposes and authorized security testing only. You may only run them against systems and networks you own or have explicit written permission to test. Unauthorized use is illegal and may result in criminal prosecution. You are responsible for how you use this code.
pip install -r requirements.txt
netfilterqueueneeds the system headers (on Debian/Ubuntu:sudo apt install libnetfilter-queue-dev) before it can build. It's only used bydnsspoofer.py.
Run all scripts with sudo — they manipulate network interfaces and packets.
Discovers live hosts on a network by sending ARP requests to a target range and listing the IP + MAC address of every responding device.
sudo python3 arpscanner.py -r 192.168.1.0/24IP address MAC address
192.168.1.1 00:11:22:33:44:55
192.168.1.42 aa:bb:cc:dd:ee:ff
Classic ARP man-in-the-middle attack. Continuously poisons the ARP tables of a target and the router so traffic flows through your machine. Restores the ARP tables automatically when stopped with Ctrl+C.
sudo python3 arpspoofer.py -t 192.168.1.100 -r 192.168.1.1Enable IP forwarding to route the victim's traffic:
sudo sysctl net.ipv4.ip_forward=1
Changes the MAC address of a network interface and verifies the change.
sudo python3 macchanger.py -i wlan0 -m 00:11:22:33:44:55HTTP packet sniffer. Captures live traffic on an interface, prints HTTP request URLs, and flags payloads that look like credentials (username/password keywords).
sudo python3 packetsniffer.pyThe target interface is hardcoded to
wlan0— edit thesniff("wlan0")line to match your interface.
Work-in-progress DNS spoofing skeleton. Currently only binds to a NetfilterQueue and prints packets — it does not yet modify or forge DNS responses.
sudo iptables -I FORWARD -j NFQUEUE --queue-num 0
sudo python3 dnsspoofer.py- These scripts use the legacy
optparsemodule and were written as educational exercises; they prioritize readability over robustness. - Some scripts have hardcoded values (e.g. the sniffing interface) — adjust them to your environment.
Free to use and modify.