Last active
August 29, 2015 14:05
-
-
Save j0lly/89c82bb5aac9116c5b7e to your computer and use it in GitHub Desktop.
little script to harvest open proxy on 8080 and send an ip list of the scanned /16 network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ¡ BSD ! | |
# | |
# J0lly 2014-08-22 | |
# command: ./arvest_proxy.bash 4.50 host@example.com & | |
# it takes the network part of a /16 network \ | |
# scan the net for open 8080 proxy \ | |
# test it with nc and send ip list via mail to the recipient | |
#eQ nohup | |
trap "" 1 | |
## find pseudo open proxy on port 8080 and log to xml format | |
time nmap --script http-open-proxy.nse -Pn -P0 -n --unprivileged -T4 $1.0.0/16 -p 8080 -oX ${1}.0.0 > /dev/null | |
sleep 5 | |
LIST=$(date +%y%m%d%H%M%S) | |
## grep good ip and test them against googl.com in order to find real open proxy and put in list_$LIST | |
for i in $( tac ${1}.0.0 | grep -A4 might | grep -oE "${1}.[0-9]{3}.[0-9]{3}" ) | |
do | |
echo -e "GET http://google.com HTTP/1.0\n\host: google.com\n" | nc $i 8080 | grep 'Location: http://www.google.' > /dev/null && echo $i >> list_$LIST | |
done | |
(echo "scan ${1}.0.0 ended" ; uuencode list_$LIST list_$LIST.txt) | /usr/bin/mailx -s "nmap scan" ${2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment