Connecting to a local address while using torsocks

I recently started using torsocks to ensure that all network traffic from certain programs are routed through the Tor network.  I quickly ran into problems when that program was firefox because of my setup.  I prefer to have firefox proxy all connections through privoxy to remove the adds and have privoxy proxy through to Tor.  If you’re wondering why I’d want to use torsocks if I already have all my privoxy’d connections proxied through Tor, its because firefox plugins need not respect the proxy (this hasn’t been sufficiently verified, so I may be wrong here).  So plugins such as the Google voice plugin could allow google to corrolate your tor browsing session with your real ip.

This kind of setup isn’t currently possible with torsocks (version 1.3).  You’ll get some error messages on stdout saying: “Connection is to a local address (127.0.0.1), may be a TCP DNS request to a local DNS server so have to reject to be safe. Please report a bug to http://code.google.com/p/torsocks/issues/entry if this is preventing a program from working properly with torsocks.” (see torsocks bug)  Fair enough, torsocks was built to ensure that traffic didn’t escape tor.  However, in this case I know that everything going to my local privoxy instance IS going through Tor. (Note: If you’ve not configured your privoxy instance to use Tor AND resolve DNS names through Tor, you’ll shoot yourself in the foot).  Really torsocks only needs to prevent traffic destined to standard DNS ports, assuming you know there’s not a DNS server listening on a non-standard port.  But torsocks blocks traffic to all ports of local addresses, ie the local privoxy instance.

Luckily, there’s a patch to do just that along with ubuntu builds (see this comment).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: