3

I'm trying to download a file using wget, but I've exceeded (without knowing there was a limit) the limit of downloaded bytes for my IP address, which means that I can't download anymore the files I was downloading repeatedly by re-running a script.

I was essentially trying to re-running a shell/bash script (somehow testing if it works correctly), but I can't do it anymore until I fake my IP address. So, I decided to install tor and torsocks and execute the following commands:

echo | tor &
torsocks wget <some_url>

but it doesn't work. I've never really got into tor (and even less torsocks), so I'm not sure if that's the right tool for this case. Any help is appreciated.

Note: I know a little bit about the tor network, and I thought that in general it should create a proxy and not show my IP address to the world, but apparently that's not exactly what's happening.

2

torify as a nice frontend for torsocks which makes life far easier. It automates and simplifies the setup of torsocks in the background, making it as simple as simply invoking torify before the intended commands.

What you need to run to put to work any program that uses TCP connections in the Tor network are the steps bellow:

  • run the tor daemon; if in Debian do:

    sudo apt-get install tor
    sudo service tor start
    

    if in MacOS (tested with Sierra 10.12.2 beta, MacPorts 2.3.5):

    sudo port install tor
    sudo port install torsocks
    tor &
    
  • call in the command line most of the tools whose communications are based in TCP with torify. For instance:

    torify wget ...
    

or

    torify ssh ...

From man torify:

torify is a simple wrapper that attempts to find the best underlying Tor wrapper available on a system. It calls torsocks with a tor specific configuration file.

torsocks is an improved wrapper that explicitly rejects UDP, safely resolves DNS lookups and properly socksifies your TCP connections.

   Please note that since both method use LD_PRELOAD, torify cannot be applied to 
suid binaries.
  • Sorry, I forgot to say I'm currently working on a OS X, but it should be equivalent to what I did except that I used torsocks instead of torify...Anyway, I will try to use torify instead of torsocks then... – nbro Nov 28 '16 at 16:26
  • Tested it in Sierra and MacPorts, it works. – Rui F Ribeiro Nov 28 '16 at 16:46
  • Have you used torify or torsocks at the end? – nbro Nov 28 '16 at 17:06
  • torify... torify automates and simplifies the setup of torsocks in the background – Rui F Ribeiro Nov 28 '16 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.