#!/bin/sh # # findproxy - automagically seaches for proxies that allow connections # to a specified host/port # # This script is released under the GNU GPL. It is provided as is and without # warranty. # host and port to connect to HOST=www.touset.org PORT=80 # port the proxy should run on OPENPORT=80 SEARCH="(elite)" WAITTIME=20 TMPFILE=/tmp/proxyscan rm -f $TMPFILE for NUM in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do wget -q --output-document=- http://www.samair.ru/proxy/proxy-${NUM}.htm | grep -A63 "
" | egrep "^[0-9]" | egrep "$SEARCH" | grep -v SSL | cut -d\ -f1 | egrep ":${OPENPORT}$" | cut -d: -f1 >> $TMPFILE
done
for IP in `cat $TMPFILE`
do
echo " Up:" $IP `echo "CONNECT $HOST:$PORT HTTP/1.1
Host: $HOST:$PORT
" | nc -q1 $IP $OPENPORT 2>&1` | egrep "HTTP/1.0 200 Connection established" | cut -d\ -f1-3 &
done
sleep $WAITTIME
kill `pidof nc`
rm $TMPFILE