Tor: Part 3 - Becoming An Onion

Discussion in 'Linux Security' started by Eric Hansen, Sep 4, 2013.

  1. Eric Hansen

    Eric Hansen Moderator Staff Writer

    Messages:
    116
    Likes Received:
    69
    Trophy Points:
    28
    In the previous article we set up Tor and was able to successfully use it to browse the web securely. Now we’ll take it a step further and become part of the Tor browsing network. As being an exit node holds a bit more power we’ll take it a step back and be a relay node. This means that traffic will flow in and out of our network, but no one can see it coming from us or somewhere else. Tor also states that this can provide better anonymity than just running it as a client.

    What’s Required
    Before we dive right into it we should look at what exactly is required to run a Tor relay node first. While if you have any sort of upload and download speed you’ll be contributing, Tor typically looks for nodes that have at least 50 kB/s (kilobytes per second) for both upload and download. You can throttle how much Tor uses but this is the standard. To find out how much your ISP allows go to a speed testing site (I use http://www.speedtest.net) and perform the test to a very far location. If you do it from a close site then the results can be skewed a little bit.

    While it may or may not be needed, its always nice to make sure your ISP is fine with it, so you should browse through the Terms of Service and Acceptable Use Policy. You’ll be looking for something mentioning proxies. I’ve never ran into issues with my ISP but that’s not to say everyone will have my luck either.

    You’ll also want to sudo su - so you can be root. We’ll need to edit /etc/tor/torrc which requires root privileges as well as restart the Tor service.

    Configuring Tor
    As stated we’ll need to edit /etc/tor/torrc, so lets open that up in an editor (nano fan here, use whichever you like) as root and get to work!

    First thing to search for is “Nickname” which is how Tor will recognize you. Uncomment it by removing the “#” in front and set a unique nickname. If you want to have some fun base64 a message and see if anyone decodes it (typically you won’t know but its fun regardless to me).

    Next we need to know which port Tor will listen to for incoming connections. For this we need to uncomment “ORPort”. The default is 9001 but you can change it to your taste, just make sure the port is connectable from outside of your network.

    Lastly we need to set our contact information in case of any events. For this look for “ContactInfo” and uncomment it. There’s two options: non-GPG signed and GPG signed. If you know what GPG is and have it set up for said email uncomment the second one, most users will just want to uncomment the first one, however, and set it.

    Restarting and Knowing If It Worked
    Save the file and close out of your editor, we’re done with it now. This part is a little tricky so to speak (though, in reality, not really...you’ll see what I mean). The only way for us to know if it worked is to monitor the Tor log, since Tor doesn’t output anything as it’ll be running as a daemon. Open up two terminals and in one run this command:
    Code:
    tail -f /var/log/tor/log
    In the other do this as root:
    Code:
    /etc/init.d/tor restart
    Switch back to the terminal you ran the tail command in and keep an eye for this message:
    Code:
    [notice] router_orport_found_reachable(): Self-testing indicates your !ORPort is reachable from the outside. Excellent. Publishing server descriptor.
    The point of this message is to let you know that the port you set as the “ORPort” previously is reachable for the Tor network to get to it. This is how Tor will be able to route your Traffic through.

    How to Rate Limit Tor
    This requires editing the torrc file again but as this isn’t mandatory to run a relay I chose to put this at the end once we know everything works as it should. Note though that this won’t throttle anything outside of Tor. So your regular Internet connection will remain untouched, the only affected traffic will be what goes through Tor.

    As root again edit /etc/tor/torrc and look for this line:
    Code:
    #RelayBandwidthRate 100 KB
    Uncomment it and set the “100 KB” to an appropriate number. Typically 50-100 KB is sufficient but the minimum allowed is 20 KB. This will mean that Tor will throttle traffic to only X KB/MB/etc… every second. So if RelayBandwidthRate is 500 MB then 500 MB of traffic will be allowed every second.


    Below that there will be:
    Code:
    #RelayBandwidthBurst 200 KB
    Its the same purpose, but sets an upper limit. Sometimes Tor will want to push out the last bit of traffic for a short time and this setting does it for you. I would set it to double what RelayBandwidthRate is. This setting is comparable to what swap or a page file is to a operating system for memory.

    Attached Files:

    • slide.jpg
      slide.jpg
      File size:
      135.4 KB
      Views:
      98,071

Share This Page