Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PAGES="$1"
- #First a simple Bashtrap function to handle interupt (CTRL+C)
- trap bashtrap INT
- bashtrap(){
- echo
- echo
- echo 'CTRL+C has been detected!.....shutting down now' | grep --color '.....shutting down now'
- rm -f o.txt 2> /dev/null
- rm -f p.txt 2> /dev/null
- #exit entire script if called
- exit;
- }
- #End bashtrap()
- echo "Starting Hood3dRob1n's HideMyAss.com proxy scraper, hang tight this might take a few...." | grep --color -E 'Starting Hood3dRob1n||s HideMyAss||com proxy scraper||hang tight this might take a few'
- seq 1 "$PAGES" | parallel -k -j 0 curl http://www.hidemyass.com/proxy-list/{} -b "PHPSESSID=f0997g34g7qee5speh0bian143" --retry 2 --retry-delay 3 --connect-timeout 3 --no-keepalive -s -e "http://www.hidemyass.com/proxy-list/" 2> /dev/null | grep -A2 '<div style=\"display:none\">' | sed -e 's/<\/style>//g' -e 's/\-\-//g' -e 's/ <td>//g' -e '/^$/d' | sed -e 's/_/-/g' -e 's/<span class="[a-zA-Z\-]\{1,4\}">/~/' -e 's/<div style=\"display:none\">/~/g' -e 's/<span class=\"[a-zA-Z0-9\-]\{1,4\}\">/~/g' -e 's/<span class=\"\" style=\"\">/~/g' -e 's/<span style=\"display: inline\">/~/g' -e 's/<span style=\"display:none\">/~/g' -e 's/<\/div>//g' -e 's/<\/span>//g' -e 's/<\/td>//g' -e 's/<span>//g' -e 's/^~//g' > o.txt
- LINE_COUNT=0
- IP1=""
- IP2=""
- IP3=""
- IP4=""
- PORT=""
- cat o.txt | while read line
- do
- LINE_COUNT=$((LINE_COUNT +1));
- if [ "$LINE_COUNT" == 1 ]; then
- IP1=$(echo $line | awk -F"~" ' { print $1 }')
- IP2=$(echo $line | awk -F"." ' { print $2 }' | sed -e 's/^~//g' | awk -F"~" ' { print $1 } ')
- IP3=$(echo $line | awk -F"." ' { print $3 }' | sed -e 's/^~//g' | awk -F"~" '{ print $1 }')
- IP4=$(echo $line | awk -F"." ' { print $4 }' | sed -e 's/^~//g')
- fi
- if [ "$LINE_COUNT" == 2 ]; then
- PCHK=$(echo $line | awk '{print length($1)}')
- if [ $PCHK -le 5 ]; then
- PORT=$(echo $line | awk '{print $1}')
- fi
- echo "$IP1.$IP2.$IP3.$IP4:$PORT" >> p.txt
- LINE_COUNT=0
- fi
- done
- cat p.txt | sort | uniq > HMA.lst
- NUMPROX=$(wc -l HMA.lst | cut -d' ' -f1)
- echo
- echo "RESULTS FROM PROXY SCRAPING:" | grep --color 'RESULTS FROM PROXY SCRAPING'
- echo "Proxies Found: $NUMPROX" | grep --color 'Proxies Found'
- echo
- cat HMA.lst
- echo
- rm -f o.txt 2> /dev/null
- rm -f p.txt 2> /dev/null
- echo "Hope you have enough to actually hide your ass now :p" | grep --color 'Hope you have enough to actually hide your ass now :p'
- exit 0;
- # Greetz from H.R. :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement