Hi everyone,
I use the Wi-Fi pineapple as a man in the middle Device Redirecting all traffic to a Laptop That the Wi-Fi pineapple is tethered to, Similar to this setup: https://www.evilsocket.net/2016/09/15/WiFi-Pineapple-NANO-OS-X-and-BetterCap-setup/
So here's my setup,
MacBook running linux VM (Virtual box) Connected via USB To the Wi-Fi pineapple That's sending all traffic To the virtual box Machine
: Pardon my diagram skills :(
Here describe that I have created Based off of the post Above, HoweverI don't think this is ideal since you would need to ssh into the pineapple to run this script every time. Ideally it would be best to do this via the web interface of the pineapple via a simple "enable proxy" button etc. Any feedback would be appreciated.
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo "Usage: $0 (enable|disable)"
exit 1
fi
action="$1"
case $action in
enable)
echo "Enabling ..."
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 172.16.42.42:8080
#iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 172.16.42.42:8083
iptables -t nat -A POSTROUTING -j MASQUERADE
;;
disable)
echo "Disabling ..."
iptables -t nat -D PREROUTING -p tcp --dport 80 -j DNAT --to-destination 172.16.42.42:8080
#iptables -t nat -D PREROUTING -p tcp --dport 443 -j DNAT --to-destination 172.16.42.42:8083
;;
*)
echo "Usage: $0 (enable|disable)"
exit 1
;;
esac