Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "This script loads website from different IPs using Tor."
- echo "Ensure that you have tor started and working on localhost:9050"
- echo "This script also requires 'expect' program (/usr/bin/expect) to work."
- function hello {
- ip=$(curl --silent --socks5 127.0.0.1:9050 whatismyip.org)
- if grep -Fxq "$ip" ip.list
- then
- echo "This IP ($ip) was already used. Switching to another in few (random) seconds..."
- sleeping
- changeip
- starting
- else
- echo "Found new IP $ip. Using it..."
- 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
- echo "Page loaded, adding IP to database..."
- echo $ip >> ip.list
- sleeping
- changeip
- starting
- fi
- }
- function sleeping {
- sleep 10
- }
- function starting {
- sleeping
- hello
- }
- function changeip {
- /usr/bin/expect -f torci.sh
- }
- hello
Advertisement
Add Comment
Please, Sign In to add comment