sxiii

TorPageLoader

Aug 11th, 2011
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.90 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo "This script loads website from different IPs using Tor."
  4. echo "Ensure that you have tor started and working on localhost:9050"
  5. echo "This script also requires 'expect' program (/usr/bin/expect) to work."
  6. function hello {
  7.  
  8. ip=$(curl --silent --socks5 127.0.0.1:9050 whatismyip.org)
  9.  
  10. if grep -Fxq "$ip" ip.list
  11. then
  12.    echo "This IP ($ip) was already used. Switching to another in few (random) seconds..."
  13.    sleeping
  14.    changeip
  15.    starting
  16. else
  17.    echo "Found new IP $ip. Using it..."
  18.    curl --silent --output /dev/null --user-agent "Mozilla/5.0 [en] (X11; Linux 2.7.15 i686)" --socks5 127.0.0.1:9050  http://example.com
  19.    echo "Page loaded, adding IP to database..."
  20.    echo $ip >> ip.list
  21.    sleeping
  22.    changeip
  23.    starting
  24. fi  
  25.  
  26. }
  27.  
  28. function sleeping {
  29. sleep 10
  30. }
  31.  
  32. function starting {
  33. sleeping
  34. hello
  35. }
  36.  
  37. function changeip {
  38. /usr/bin/expect -f torci.sh
  39. }
  40.  
  41. hello
Advertisement
Add Comment
Please, Sign In to add comment