Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using CURL with TOR as a Proxy on CentOs

Tags:

proxy

tor

centos

I want to use Tor as a proxy for HTTP-requests with curl or wget on a CentOS Machine. I used this How-to and I looked for some answers on stackexchange and stackoverflow. https://medium.com/the-sysadmin/using-tor-for-your-shell-script-fee9d8bdef5c#.9ixz30jbn

If I typing into my shell 'tor' I get this:

Aug 31 21:01:29.871 [notice] Tor v0.2.8.6 running on Linux with Libevent 2.0.22-stable, OpenSSL 1.0.2h and Zlib 1.2.8.
Aug 31 21:01:29.871 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Aug 31 21:01:29.871 [notice] Read configuration file "/home/wmjio5f6/.linuxbrew/etc/tor/torrc".
Aug 31 21:01:29.909 [warn] ControlPort is open, but no authentication method has been configured.  This means that any program on your computer can reconfigure your Tor.  That's bad!  You should upgrade your Tor controller as soon as possible.
Aug 31 21:01:29.937 [notice] Opening Socks listener on 127.0.0.1:9050
Aug 31 21:01:29.939 [notice] Opening Control listener on 127.0.0.1:9151
Aug 31 21:01:29.000 [notice] Parsing GEOIP IPv4 file /home/wmjio5f6/.linuxbrew/Cellar/tor/0.2.8.6/share/tor/geoip.
Aug 31 21:01:30.000 [notice] Parsing GEOIP IPv6 file /home/wmjio5f6/.linuxbrew/Cellar/tor/0.2.8.6/share/tor/geoip6.
Aug 31 21:01:30.000 [notice] Bootstrapped 0%: Starting
Aug 31 21:01:31.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Aug 31 21:01:32.000 [notice] Bootstrapped 85%: Finishing handshake with first hop
Aug 31 21:01:32.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
Aug 31 21:01:32.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Aug 31 21:01:32.000 [notice] Bootstrapped 100%: Done

Where is my error, or wich command is the right?

like image 857
Wilhelm Avatar asked Aug 31 '16 19:08

Wilhelm


People also ask

How do you use curl with Tor?

The line Opening Socks listener on 127.0. 0.1:9050 tells you that it's SOCKS (proxy) port is listening on port 9050. This is the port you want applications like curl or wget to proxy through. As shown in the article you linked, you just need to run curl using Tor's SOCKS port.

How do I use curl with a proxy?

To use a proxy with Curl, you must pass the required proxy address using the -x (or --proxy) command-line option and proxy credentials using the -U (or --proxy-user) command-line switch. Proxy credentials may also be passed in the proxy string and will be URL decoded by Curl.

Can you use Tor as a proxy?

Using the Tor browser, you can hide your online activity from network surveillance and traffic analysis. You can configure your Web browser — Mozilla Firefox, Google Chrome and Internet Explorer — to use the Tor proxy, and your communications are anonymized as long as the Tor browser is running in the background.


1 Answers

You've made no mistake. That output indicates that Tor launched, connected to the network and is running. You'll probably want to figure out how to daemonize it, or run it in the background (nohup tor &).

The line Opening Socks listener on 127.0.0.1:9050 tells you that it's SOCKS (proxy) port is listening on port 9050. This is the port you want applications like curl or wget to proxy through.

As shown in the article you linked, you just need to run curl using Tor's SOCKS port.

curl -s --socks5-hostname 127.0.0.1:9050 http://www.showmyip.gr
like image 175
drew010 Avatar answered Nov 15 '22 08:11

drew010