How to start multiple Tor processes simultaneously with different output IP addresses?

I'm brand new to Tor, and I feel I need to consider a few Tors. The many terms that I mentioned here are not only multiple instances, but also the use of different proxy ports for each, as what was done here http://www.howtoforge.com/ultimate-security-proxy-with-tor )

I am trying to get started with 4 Tors. However, the manual applies only to Arch Linux, and I use the headless EC2 ubuntu 64 bit. It really is a pain that goes through the differences between Arch and Ubuntu. And here I am wondering if there is anyone who could offer any help to implement my idea.

  • Four Tors work simultaneously with each port, privoxy or polipo, or something is OK when it works. Similarly: 8118 <- Privoxy <-TOR> 9050 8129 <- Privoxy <-TOR <9150 8230 Β°; - Privoxy <-TOR <9250 8321 <- Privoxy <-TOR <-9350

  • Thus, if I try to return ip 127.0.0.1:8118, 8129, 8230 and 8321, they should return four different ips, which indicates that four different Tors are working at the same time. Then, a few minutes later, check again, all four of them should again have a new ips.

I know that my simple β€œdream” can happen in many ways, however ... I am not only new to Tor, but even to bash and python ... That's why I come here and see some of you could ignite me .

These links may be helpful:

http://blog.databigbang.com/distributed-scraping-with-multiple-tor-circuits/ https://www.torservers.net/wiki/setup/server#multiple_tor_processes Best,

btw if I run $ ps -A | grep 'tor' $ ps -A | grep 'tor' I have some examples, but with "?" under the tty column, what does it mean, since I know that tty means terminals?

+28
linux proxy screen-scraping tor socks
Jan 14 '13 at 15:18
source share
6 answers

Create four torrc files, say / /etc/tor/torrc.1 . /etc/tor/torrc.1 - .4 .

In each file, edit the lines:

 SocksPort 9050 ControlPort 9051 DataDirectory /var/lib/tor 

use different resources for each torrc file, for example. for torrc.1 :

 SocksPort 9060 ControlPort 9061 DataDirectory /var/lib/tor1 

for torrc.2 ,

 SocksPort 9062 ControlPort 9063 DataDirectory /var/lib/tor2 

etc.

A configuration file containing only the above lines will work: you can remove any other line from the default template if you like it.

DataDirectory can also refer to the current directory where tor running, for example:

 DataDirectory d1 

Then run tor as follows:

 tor -f /etc/tor/torrc.1 tor -f /etc/tor/torrc.2 

etc. for two other files.

This will create four different Socks5 servers on four ports. Each of them will open a different circuit that you need.

+32
Sep 19 '13 at 13:07 on
source share

Chain Tor recommended against . You can degrade anonymity rather than improve anonymity.

The result is undefined and potentially dangerous behavior. Theoretically, however, you can get six jumps instead of three, but it is not guaranteed that you will get three different haps - you can end up in the same jump, maybe in the reverse or mixed order. It is not clear whether this is safe. This has never been discussed.

You can choose an entry / exit point, but you will get the maximum security that Tor can provide when you leave the route selection in Tor; redefining I / O nodes can ruin your anonymity in ways we don’t understand. Therefore, the use of Tor over Tor is greatly discouraged.

You only need to use the Tor routing algorithm if you are smarter than the Tor developers.

Using privoxy / polipo has long been deprecated by the Tor project. You are recommended to use Tor Browser . Only Tor Browser gives you a single web fingerprint and you don't stand out.

Since Tor version 0.2.3, different Socks, - Dns- or TransPorts go through different schemes, therefore they prevent identity correlation. The term for this is flow isolation. Get it, you can add to torrc ...

 SocksPort 9050 SocksPort 9052 SocksPort 9053 SocksPort 9054 #... 

... and they will all think of different schemes.

When you use Tor Browser, you can also use the new Tor Button authentication feature. Press the Tor button (green onion) and select a new identity. This will reset all browser states and change the Tor circuit.

( And this is Tor, not TOR. )

Note that when using stream isolation, different circuits do not guarantee different Tor output nodes. Sometimes Tor uses only another guard or secondary relay. This is normal.

+15
Sep 19 '13 at 23:51 on
source share

I wrote a script to automate the Privoxy-Tor configuration process at https://github.com/anhldbk/privoxyTor/ . Hope this helps you!

+3
Dec 28 '13 at 5:49 on
source share

I tried torrc.1, torrc.2, etc. ... but that didn't work.

However this one worked:

  1. Stop the tor process: /etc/init.d/tor stop
  2. Open gedit/etc/tor/torrc (if you are not root, install sudo before accessing as root)
  3. Search for SocksPort 9050
  4. Now specify all the ports that you want to use as streaming ports (SocksPort 9060, SocksPort 9070, SocksPort 9080 .... etc.)
  5. Search ControlPort 9051
  6. Now place any ports that you want to use as streaming ports (ControlPort 9061, ControlPort 9071, ControlPort 9081 .... etc.). NOTICE THAT THE PORT OF MANAGEMENT IS ALWAYS SOCKSPORT + 1
  7. Run the tor process again: /etc/init.d/tor start
  8. Check tor /etc/init.d/tor status

this should show something like this:

 tor.service - Anonymizing overlay network for TCP Loaded: loaded (/lib/systemd/system/tor.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2016-05-13 22:18:21 GST; 1s ago Process: 10259 ExecReload=/bin/kill -HUP ${MAINPID} (code=exited, status=0/SUCCESS) Process: 10319 ExecStartPre=/usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0 --verify-config (code=exited, status=0/SUCCESS) Process: 10317 ExecStartPre=/usr/bin/install -Z -m 02750 -o debian-tor -g debian-tor -d /var/run/tor (code=exited, status=0/SUCCESS) Main PID: 10322 (tor) CGroup: /system.slice/tor.service └─10322 /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0 May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.860 [notice] Tor v0.2.6.10 (git-71459b2fe953a1c0) running on Linux with Li... 1.2.8. May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.860 [notice] Tor can't help you if you use it wrong! Learn how to be safe ...warning May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.860 [notice] Read configuration file "/usr/share/tor/tor-service-defaults-torrc". May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.860 [notice] Read configuration file "/etc/tor/torrc". May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.863 [notice] Opening Socks listener on 127.0.0.1:9050 May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.863 [notice] Opening Socks listener on 127.0.0.1:9060 May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.863 [notice] Opening Control listener on 127.0.0.1:9051 May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.863 [notice] Opening Control listener on 127.0.0.1:9061 May 13 22:18:20 momen-Lenovo tor[10322]: May 13 22:18:20.863 [notice] Opening Control listener on /var/run/tor/control May 13 22:18:21 momen-Lenovo systemd[1]: Started Anonymizing overlay network for TCP. 

Hint : some lines were elliptical, to display them completely, use -l.

+1
May 13 '16 at 18:40
source share

Make tor configuration directory:
$> mkdir -p ~/configuration_files/tor
$> config=~/configuration_files/tor
$> cd "${config}"

Copy /etc/tor/torrc to the configuration directory and make as many copies as you need: for example. 10
printf "torrc_%0.2s\n" {1..10} | xargs -I {} /bin/cp /etc/tor/torrc "${config}{}"

Copy /etc/torsocks.conf to the configuration directory and make as many copies as you need: for example. same as above 10
printf "torsocks_%0.2s.conf\n" {1..10} | xargs -I {} /bin/cp /etc/torsocks.conf "${config}/{}"

Create new data directories and correct ownership / permissions:
$> sudo mkdir /var/lib/tor{1..10}

Edit the configuration files so that they do not interfere with the corresponding port numbers:

 for a in {1..10}; do sed -i "s/^#SocksPort 9050.*/SocksPort $((9050+${i}))/;s|^#DataDirectory /var/lib/tor|DataDirectory /var/lib/tor${i}|" torrc_${i} sed -i "s/server_port = 9050/server_port = $((9050+${i}))/" torsocks_${i}.conf sudo chmod -R --reference /var/lib/tor /var/lib/tor${i} sudo chown -R CHANGETHIS:CHANGETHIS /var/lib/tor${i} done 

Note. Change CHANGETHIS to the user / group of the user who plans to use it.

After that, it is easy to get it; you start separate instances of tor using the corresponding configuration file, for example. /usr/bin/tor -f "${config}/torrc_3"

To use it all you have to do is export the TORSOCKS_CONF_FILE variable to point to the corresponding torsocks.conf file:
For example. $> export TORSOCKS_CONF_FILE="${config}/torsocks_3.conf"

Then you can torify / torsocks any application from this particular shell, and it will use the torsocks_3.conf proxy server.
Try: $> torify bash
$> curl www.ipmango.com/api/myip

To switch to another proxy, simply run the corresponding tor using its torrc file and export the TORSOCKS_CONF_FILE variable to indicate the new configuration.

Here is a simple alias that does the job after you configured it above and you have roxterm installed. It will check netstat to make sure that the proxy server is already running, and if it does not start in a separate shell window.

alias prox='_(){ proxy=${1:-1}; config_base="~/configuration_files/tor"; port=$((9050+${proxy})); netstat -an | { ! grep -q "127.0.0.1:${port}"; } && roxterm -e bash -c "/usr/bin/tor -f \"${config_base}/torrc_${proxy}\"; bash"; export TORSOCKS_CONF_FILE="${config_base}/torsocks_${proxy}.conf"; }; _'

To use it:

 $> prox 4 $> torify bash 
0
Dec 10 '15 at 23:45
source share

You should take a look at Multitor.

https://github.com/trimstray/multitor

0
May 18 '19 at 13:51
source share



All Articles