1

I've been trying to setup a transparent Linux-based tor proxy on CHIP, following these instructions.

I've created a /etc/tor/torrc file like this:

Log notice file /var/log/tor/notices.log
VirtualAddrNetwork 10.192.0.0/10
AutomapHostsSuffixes .onion,.exit
AutomapHostsOnResolve 1
TransPort 10.0.1.28:9040
DNSPort 10.0.1.28:53

And then, before playing with any iptables, decided to test it using wget by trying the proxy from within the machine:

wget -e use_proxy=yes -e http_proxy=10.0.1.28:9040 http://google.com

What I get then is:

--2016-07-09 14:43:45--  http://google.com/
Connecting to 10.0.1.28:9040... connected.
Proxy request sent, awaiting response... No data received.
Retrying.

--2016-07-09 14:43:46--  (try: 2)  http://google.com/
Connecting to 10.0.1.28:9040... connected.
Proxy request sent, awaiting response... No data received.
Retrying.

--2016-07-09 14:43:48--  (try: 3)  http://google.com/
Connecting to 10.0.1.28:9040... connected.
Proxy request sent, awaiting response... Read error (Connection reset by peer) in headers.

And on Tor's log file, this:

Jul 09 14:43:48.000 [warn] getsockopt() failed: Protocol not available
Jul 09 14:43:48.000 [warn] Fetching original destination failed. Closing.

What am I doing wrong?

MORE INFO:

I've run Tor using strace, and this is what I've got when I'm trying to use it as a proxy:

accept4(8, {sa_family=AF_INET, sin_port=htons(46950), sin_addr=inet_addr("10.0.1.28")}, [16], SOCK_CLOEXEC|SOCK_NONBLOCK) = 13
setsockopt(13, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
getsockopt(13, SOL_IP, 0x50 /* IP_??? */, 0xbee6a8c8, 0xbee6a8b0) = -1 ENOPROTOOPT (Protocol not available)

The culprit is somewhere in this area: SOL_IP, 0x50 /* IP_??? */, as I understand the ENOPROTOOPT means that the option name is unavailable for the protocol chosen.

1 Answer 1

1

You're trying to use a transparent proxy as an http proxy, this will not work.

You will need to follow the iptables setup, or some kind of packetfilter that has REDIRECT-like fucntionality.

Have a look at "How does Tor transparent proxying work?".

2
  • Ok, granted I said in my question I didn't finish all the steps (I'm having different problems with iptables). But how does this explain the errors on getsockopt? Jul 11, 2016 at 5:08
  • The fact that you're trying to use it incorrectly? 0x50 (80) is SO_ORIGINAL_DST which is used to find the original destination of the trasparent proxy and you don't have one because... you're not using it as a transparent proxy
    – cacahuatl
    Jul 12, 2016 at 23:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .