How to use Wget with Tor Bundle in Linux

10

8

I'm a Linux Mint (Lisa) and Tor Bundle user trying to use wget over Tor. After following the directions I found here, all I get when running wget is an output file saying, "514 Authentication required."

Here's what I did: I downloaded the latest version of Tor Bundle (Version 2.2.35-9) for Linux and extracted it. I ran ./start-tor-browser. Then in Vidalia I went into Setting -> Advanced, and uncheck "Configure ControlPort automatically." (Later I also tried changing "Authentication" to "None" but this still didn't work.) The IP address is set to localhost and the port is 9051.

From the terminal I said:

export http_proxy="http://127.0.0.1:9051"
wget -proxy=on www.whatismyip.com

This gave me an output file saying, "514 Authentication required" instead of www.whatismyip.com. Any ideas?

Asher Walther

Posted 2012-03-26T01:23:48.407

Reputation: 485

i've read that both TOR and Vidalia have configuration files, look for the words user or password there and see if it's not as you'd think like maybe there's some username or password there. – barlop – 2012-03-26T04:27:31.857

Answers

16

on Ubuntu or Debain, install package "torsocks"

sudo apt-get install torsocks

After that, use wget like this:

torsocks wget http://foo.onion/data.bar

Produnis

Posted 2012-03-26T01:23:48.407

Reputation: 279

doesn't work for me. 05:19:02 libtorsocks(22594): SOCKS server refused connection tor running on 9050 port, and it seems to be this beast does it on 127.0.0.1:80 – holms – 2014-09-25T02:21:50.470

torify --help says, torify is now just a wrapper around torsocks(1) for backwards compatibility. – palswim – 2017-06-24T21:47:26.267

4

Tor standalone only includes a SOCKS proxy for connecting to the Tor network, and the Tor browser bundle doesn't add any additional proxies.

The usual method of dealing with programs that require an HTTP proxy is to install one of your own, such as Privoxy or Polipo, then chain that proxy to Tor. For instance, in Privoxy's configuration, you would specify:

forward-socks5  /  127.0.0.1:9050 .

Privoxy then listens on port 8118 and you configure your HTTP proxy setting to http://localhost:8118.

Unfortunately it appears that Linux Mint doesn't carry either of these packages in its repositories. You might consider switching distributions, or compiling one yourself.

Michael Hampton

Posted 2012-03-26T01:23:48.407

Reputation: 11 744

Step by step instructions here.

– Skippy le Grand Gourou – 2014-11-04T10:14:46.423

2

Use Torify, which is a simple wrapper for torsocks and Tor, for example:

$ torify curl ifconfig.me
$ torify wget -qO- -U curl ifconfig.me

Before using, make sure your Tor server is up and running.

See also: How to anonymize the programs from the terminal? at Tor SE

kenorb

Posted 2012-03-26T01:23:48.407

Reputation: 16 795

This is probably the easiest solution for most people. – A.Danischewski – 2015-06-22T22:17:11.560

As torify --help says, torify is now just a wrapper around torsocks(1) for backwards compatibility., so this answer is identical to the torsocks answer.

– palswim – 2017-06-24T21:47:09.070

0

torify seemed to work for me:

 torify wget https://www.some_url.com

Here's the access.log entry from my webserver:

207.244.70.35 - - [13/Sep/2018:03:57:25 +0000] "GET / HTTP/1.1" 200 8446 "-" "Wget/1.17.1 (linux-gnu)" "207.244.70.35" response-time=0.02

207.244.70.35 is not my real IP and therefore this command works

Here is a python script that does the same thing that I found here

#! /usr/bin/python3
import subprocess
from subprocess import Popen, PIPE
import sys
import os


# use torify to make a wget 
class Wgettor():
    def __init__(self, url):
        if not self.__is_activated():
            print("Ensure Tor service is running")
            sys.exit()
        else:
            self.url = url
            self.wget()

    # ensure Tor service is running
    def __is_activated(self):
        service_cmd = "service --status-all | grep tor"
        p = subprocess.Popen(service_cmd,
                             shell=True,
                             stdout=PIPE).communicate()[0]
        return "+" in str(p)

    def wget(self):
        prox = [
            "torify", "wget", self.url
        ]
        os.system(" ".join(prox))


if __name__ == "__main__":
    Wgettor("https://www.some_url_here.com")

kittyboo

Posted 2012-03-26T01:23:48.407

Reputation: 13

0

Maybe www.whatismyip.com is checking X-Forwarded-For header and trigger an error.

I recommend you to test another one (this is my own, so I know there's no detections of any kind, just your public address) : http://sputnick-area.net/ip

Edit: I think you should remove -proxy switch while it's not in man wget. IIRC, wget can detect the proxy itself. :

wget -q -O - www.whatismyip.com

Gilles Quenot

Posted 2012-03-26T01:23:48.407

Reputation: 3 111

-O - redirects to stdout, -q is just the progress meter as mentioned by @Gilles. – hanetzer – 2016-02-27T05:24:17.900

I have the same problem with sputnick-area.net/ip. But nice thinking though, it was a good idea to test that. – Asher Walther – 2012-03-26T01:33:21.237

See my edited post above – Gilles Quenot – 2012-03-26T01:42:19.563

could drop the -q too it looka from the man page thta -q is about supressing output. What is -0 ? – barlop – 2012-03-27T19:45:08.127

1-q simply hides the progress meter – Gilles Quenot – 2012-03-27T21:34:41.620

1you haven't answered the question =/ – holms – 2012-05-05T02:59:03.287

0

proxychains also does the job, with the following configuration

socks5 127.0.0.1 9150

$proxychains curl ifconfig.me ProxyChains-3.1 (http://proxychains.sf.net) |DNS-request| ifconfig.me |S-chain|-<>-127.0.0.1:9150-<><>-4.2.2.2:53-<><>-OK |DNS-response| ifconfig.me is 219.94.235.40 |S-chain|-<>-127.0.0.1:9150-<><>-219.94.235.40:80-<><>-OK 178.63.97.34

Randomix2

Posted 2012-03-26T01:23:48.407

Reputation: 9