Created
May 15, 2016 07:54
-
-
Save mhahl/34f4c4baeea9e9090debb6f6cebc3dfd to your computer and use it in GitHub Desktop.
Hit a URL thought a number of different proxies using a list of user-agents
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 | |
# http://www.user-agents.org/allagents.xml | |
userAgents=`cat allagents.xml | grep -iB 5 '<Type>B</Type>' | grep -i '<String>' | cut -c 9- | sed 's/..........$//'` | |
function getRandomUA() | |
{ | |
maxLines=`echo "$userAgents" | wc -l | tr -d ' '` | |
randomUserAgent=$(echo "$userAgents" | sed -n $[ ( $RANDOM % ( $[ $maxLines - 1 ] + 1 ) ) + 1 ]p) | |
echo $randomUserAgent | |
} | |
cat proxy.txt | while read line | |
do | |
ua=$(getRandomUA); | |
echo -x "$line" -A \"$ua\" http://URLGOESHERE.example.com | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment