Skip to content

Instantly share code, notes, and snippets.

@Daniyal-Javani
Last active April 27, 2018 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daniyal-Javani/f0dcce508978a37d3cad9677dfe5ff43 to your computer and use it in GitHub Desktop.
Save Daniyal-Javani/f0dcce508978a37d3cad9677dfe5ff43 to your computer and use it in GitHub Desktop.
Run Proxychains with multiple tor IP
#!/bin/bash
start=64000
mkdir temp
for (( i=1; i<=6; i+=2))
do
socksPort=$((i+start))
sControlPort=$((i+start-1))
cp /etc/proxychains4.conf temp/p$i
sed -i -e "s/socks5 127.0.0.1 9050/socks5 127.0.0.1 $socksPort/g" temp/p$i
cp /etc/tor/torrc temp/t$i
sed -i -e "s/#SOCKSPort 9050/SocksPort $socksPort/g" temp/t$i
sed -i -e "s/#SControlPort 9051/#SControlPort $sControlPort/g" temp/t$i
sed -i -e "s|#DataDirectory /var/lib/tor|DataDirectory temp/tor$i|g" temp/t$i
tor --quiet -f temp/t$i &
sleep 15
proxychains4 -q -f temp/p$i curl icanhazip.com
done
rm temp/ -r
sudo killall tor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment