Skip to content

Instantly share code, notes, and snippets.

@ahhh
Created February 17, 2016 23:06
Show Gist options
  • Save ahhh/4aba7b62cae435f96c5f to your computer and use it in GitHub Desktop.
Save ahhh/4aba7b62cae435f96c5f to your computer and use it in GitHub Desktop.
shell script for getting new IPs through TOR and hitting an endpoint with these IPs
#!/bin/bash
votecounter=0
derp="init_value"
count=0
while true; do
derp=$"init_value"
derp=$(curl -s --socks5-hostname localhost:9050 http://www.imdb.com/name/nm0000206/ | grep -o "Keanu Reeves")
if [ "$derp" != "init_value" ]; then
let votecounter=votecounter+1
echo "Success - page visits: "$votecounter
else
echo "Failure"
fi
count=$[$count + 1]
if [ $count == 4 ]; then
echo "Acquiring new IP"
echo -e 'AUTHENTICATE "Hackasaurus" \r\nSIGNAL NEWNYM \r\nQUIT\r\n ' | nc localhost 6543
ip=$(curl -s --socks5-hostname localhost:9050 http://icanhazip.com)
echo "New IP is: " $ip
count=0
fi
# sleep 30
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment