This script is the actual man-in-the-middle attack (MITM). You enter target IP, then default gateway, and then you can sniff their packets
The script that actually performs sniffing of DNS, HTTP, and HTTPS requests and responses
Here you can basically spoof 1 domain name to redirect to the fake IP, imagine this fake IP is your local-hosted phishing website that looks exactly like the website user is trying to visit lol)