2

I am trying to get an HTTP request through a private Tor network that I have setup using tunneling with socat.

In a private Tor network (10.0.0.216/29) I have relays setup on my servers 218 and 221 through which I am manually creating a circuit (218 -> 221). I have Apache running on 222 and hope to load the default page through a connected client.

I take 217 as a client and after creating the circuit, I use the following command:

curl --socks4a localhost:9050 10.0.0.222

This works successfully. Then I try to create a bidirectional tunnel using socat by the following command

socat TCP-LISTEN:9000 SOCKS4A:127.0.0.1:10.0.0.222:80,socksport=9050 &

And I try to access the same resource using curl -v localhost:9000 but there is no response. The verbose output:

* Rebuilt URL to: localhost:9000/
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:9000
> Accept: */*
> 

The connection times out after some time. Here is the clause that continuously is repeated in the info.log debug log file.

Oct 07 13:19:52.000 [info] choose_good_exit_server_general(): Found 1 servers that might support 1/1 pending connections.
Oct 07 13:19:52.000 [info] choose_good_exit_server_general(): Chose exit server '$<fingerprint of OR221>~OR221 at 10.0.0.221'

Oct 07 13:19:52.000 [info] compute_weighted_bandwidths(): Empty routerlist passed in to consensus weight node selection for rule weight as guard
Oct 07 13:19:52.000 [info] smartlist_choose_node_by_bandwidth(): Empty routerlist passed in to old node selection for rule weight as guard
Oct 07 13:19:52.000 [info] router_choose_random_node(): We couldn't find any live, guard routers; falling back to list of all routers.
Oct 07 13:19:52.000 [info] compute_weighted_bandwidths(): Empty routerlist passed in to consensus weight node selection for rule weight as middle node
Oct 07 13:19:52.000 [info] smartlist_choose_node_by_bandwidth(): Empty routerlist passed in to old node selection for rule no weighting
Oct 07 13:19:52.000 [warn] No available nodes when trying to choose node. Failing.
Oct 07 13:19:52.000 [warn] No available nodes when trying to choose node. Failing.

Oct 07 13:19:52.000 [info] compute_weighted_bandwidths(): Empty routerlist passed in to consensus weight node selection for rule weight as guard
Oct 07 13:19:52.000 [info] smartlist_choose_node_by_bandwidth(): Empty routerlist passed in to old node selection for rule weight as guard
Oct 07 13:19:52.000 [info] router_choose_random_node(): We couldn't find any live, guard routers; falling back to list of all routers.
Oct 07 13:19:52.000 [info] compute_weighted_bandwidths(): Empty routerlist passed in to consensus weight node selection for rule weight as middle node
Oct 07 13:19:52.000 [info] smartlist_choose_node_by_bandwidth(): Empty routerlist passed in to old node selection for rule no weighting
Oct 07 13:19:52.000 [warn] No available nodes when trying to choose node. Failing.
Oct 07 13:19:52.000 [warn] No available nodes when trying to choose node. Failing.

Oct 07 13:19:52.000 [warn] Failed to find node for hop 0 of our path. Discarding this circuit.
Oct 07 13:19:52.000 [info] onion_populate_cpath(): Generating cpath hop failed.
Oct 07 13:19:52.000 [info] circuit_get_open_circ_or_launch(): No safe circuit (purpose 5) ready for edge connection; delaying.

Oct 07 13:19:53.000 [notice] Tried for 120 seconds to get a connection to 10.0.0.222:80. Giving up. (waiting for circuit)

Any help is appreciated.

PS: I am trying to use socat as torify and torsocks do not seem to work for connections having a local DNS address resolution.

1

I had the same issue trying use socat to run an application through the Tor socks proxy on Tails. I was trying this:

# socat TCP-LISTEN:1234 SOCKS4A:127.0.0.1:remoteip:5678,socksport=9050 &
$ telnet remoteip 5678

which gave

telnet: Unable to connect to remote host: Connection refused

I had a grope around iptables and realised that Tails restricts outgoing network packets, even on the loopback interface. I added a rule to allow connections to the port on the loopback device that socat listens to (in the above example that's port 1234):

# iptables -I OUTPUT -o lo -p tcp --dport 1234 -j ACCEPT

After which everything worked as expected.

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.