How to Guide, Anonymizing Middlebox Tor proxy aka Transparently Routing Traffic Through Tor

This is something that just has to be written! Even if very messy and unpolished.  I literally googled for hours, tried everything and still came up short of my goal.  If you don't have any Linux/PC skills this will be hard. If you just want a solid Tor operating system try Liberte linux, the whonix system, tails linux or Tor gateway. Liberte and whonix being the most robust against attack. This semi-guide is about setting up a PC or rather a switch or WIFI router in your network that will route all traffic into the Tor network.


This isn't a complete guide but a better starting place than I had by far so good luck and I hope this helps. I used crunchbang linux btw. Also this setup requires 2 Ethernet ports /cards installed in the Tor box.


First we have https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy which comes close to giving you everything you need to get tor setup correctly (half the battle).
sudo apt-get install tor
That might work depending on your OS might not https://www.torproject.org/docs/debian.html.en
What you need to do is add torproject.org to your repository, just google a bit.  Then run sudo apt-get install tor again and if you added it correctly it will install.

Local Redirection and Anonymizing Middlebox

To enable the transparent proxy and the DNS proxy, add the following to your torrc. Found at /etc/tor/torrc   use sudo nano    nano is editor

VirtualAddrNetwork 10.192.0.0/10
AutomapHostsOnResolve 1
TransPort 9040
TransListenAddress 127.0.0.1
TransListenAddress 192.168.1.1
DNSPort 53
DNSListenAddress 127.0.0.1
DNSListenAddress 192.168.1.1

Configure your system's DNS resolver to use Tor's DNSPort on the loopback interface by modifying /etc/resolv.conf    edit this after tor is up and running

nameserver 127.0.0.1

 If you want to make the iptables rules permanent you have to make sure they are executed at start up time, for example by adding a script in the right directory. On Debian/Ubuntu you can do something like this:

sudo touch /etc/init.d/anonuser
sudo chmod 0755 /etc/init.d/anonuser
sudo nano /etc/init.d/anonuser

Nano is a text editor that you can use to put the following in the file... I've made changes that made my two interface setup work. Might need to have tor running first if it wont go after changes.

#!/bin/sh

# destinations you don't want routed through Tor
NON_TOR="192.168.1.0/24 192.168.0.0/24"

# the UID Tor runs as
TOR_UID="109"

# Tor's TransPort
TRANS_PORT="9040"

# your internal interface
INT_IF="eth0"
#your interface you hook a switch to so you can connect computers into your proxy
EXT_IF="eth1"

iptables -F
iptables -t nat -F

iptables -t nat -A OUTPUT -o lo -j RETURN
iptables -t nat -A OUTPUT -m owner --uid-owner $TOR_UID -j RETURN
iptables -t nat -A OUTPUT -p udp --dport 53 -j REDIRECT --to-ports 53
for NET in $NON_TOR; do
 iptables -t nat -A OUTPUT -d $NET -j RETURN
 iptables -t nat -A PREROUTING -i $INT_IF -d $NET -j RETURN
done

iptables -t nat -A OUTPUT -p tcp --syn -j REDIRECT --to-ports $TRANS_PORT

iptables -t nat -A PREROUTING -i $EXT_IF -p udp --dport 53 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -i $EXT_IF -p tcp --syn -j REDIRECT --to-ports $TRANS_PORT

iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
for NET in $NON_TOR 127.0.0.0/8; do
 iptables -A OUTPUT -d $NET -j ACCEPT
done
iptables -A OUTPUT -m owner --uid-owner $TOR_UID -j ACCEPT
iptables -A OUTPUT -j REJECT

You may need to use 'sudo bash anonuser' to run the script you just created. Check it has correct permissions to run 'ls -l anonuser' will show the permissions. You may have to copy it to your home folder to and then make it run, use   cp anonuser ~/    or something similar. Check sudo iptables --list   that should show rules in iptables!! If not read above.

B4 you try to run everything you need to setup your proxy interface correctly (eth1)
It needs to be static edit sudo nano /etc/networking/interfaces
 sudo /etc/init.d/networking restart   this restarts the network, you might need this, maybe it will give you an error like it did me? Ignore move on.  and or sudo ifconfig eth1 192.168.1.1 up    
Setup dnsmasq by sudo apt-get install dnsmasq  this is a DHCP server for ur proxy interface. edit sudo nano /etc/dnsmasq.conf then sudo /etc/init.d/dnsmasq restart
interface=eth1
listen-address=192.168.1.1
dhcp-range=192.168.1.1,192.168.1.254,1h
if you have more interfaces add them
interface=eth2 .... and ranges and so on

I used a switch to connect the two PC's lost about an hour playing with a router trying to make it work... my setup is as follows, internet >> proxy server >> anon pc   I didn't do anything to the anon pc its just stock.
I'm sure I missed some things but thats what google is for and just remember this project is really two things getting tor setup and getting your PC's talking to each other correctly. If you have a router make sure to disable dhcp and firewalls on it and plug all into the lan not wan/internet hub.

Views: 7737

Reply to This

Replies to This Discussion

Good article, thanks for sharing.

I've written a guide to some privacy/anonymity apps here

To answer some questions, what this setup allows you to do is have a WIFI network that routes all traffic through the Tor network. This way you can leave your WIFI unencrypted so anyone can use it and you don't have to worry about what they are doing (for the most part). If you don't want to run a WIFI you can just have a switch that you plug computers into and route the traffic through Tor that way. No configuring of the computers being plugged into the Tor switch or WIFI is required.

This setup requires 2 Ethernet connections on the Tor proxy server.

I would caution that the Tor exits can see your unencrypted traffic just be aware of that and I recommend installing the "https everywhere" plugin for your browser. Don't use services on Tor that are unencrypted like email as the Tor exit can read everything if it is not encrypted with https ...

You can if you wish solve the Tor exit problem by using a VPN but this slows your connection further vpnbook.com is free.

Wait. THere is one problem with that. If you run all of your internet traffic through TOR without changing online behavior, you have undermined the usefulness of TOR. 

Any online account you use that could personally identify you (email,banking,bill pay, etc.) should NOT be run through TOR. It doesn't matter how many anonymous loops you go through if you are still going to be connecting to services that can be used to identify you.

Keep this in mind...no amount of tools can keep you safe (online or offline) if you don't use them properly!

Thanks for the discussion.

Very true it all depends on what your situation is and what your trying to do. For most people they just want to blind their ISP and government from seeing their traffic. This video spells out how to operate if you really want to be anonymous http://12160.info/video/the-grugq-opsec-when-you-want-real-anonymity

RSS

"Destroying the New World Order"

TOP CONTENT THIS WEEK

THANK YOU FOR SUPPORTING THE SITE!

mobile page

12160.info/m

12160 Administrators

 

Latest Activity

Doc Vega posted a blog post
19 hours ago
Less Prone commented on Less Prone's photo
Thumbnail

NATO KB FINLAND

"Finland is being pushed into a totally unnecessary war. Russia hasn't been a thread to us for…"
21 hours ago
tjdavis favorited Doc Vega's blog post A Parallel Society May be the only Plausible Solution to the Division in the US
yesterday
tjdavis posted a video
yesterday
MAC posted a video

THIS IS WHY WE NEED PAPER BALLOTS!

THE MANIPULATION OF ELECTIONS: Veteran U.S. Air Force CIA Officer has evidence that can prove the source code operating the election machines in Smartmatic a...
yesterday
Less Prone favorited Doc Vega's blog post A Parallel Society May be the only Plausible Solution to the Division in the US
yesterday
Doc Vega posted blog posts
yesterday
Doc Vega commented on Less Prone's photo
Thumbnail

NATO KB FINLAND

"Got to hand it to the Finnish they are tough as hell and they don't put up with Russian…"
yesterday
tjdavis posted photos
Thursday
Doc Vega commented on cheeki kea's photo
Thumbnail

Both True.

"China has been up to no good for a long time and they do plan ultimately to not only be  world…"
Wednesday
tjdavis posted a video

We March

Provided to YouTube by Legacy RecordingsWe March · PrinceThe Gold Experience℗ 1995 NPG Records, Inc. Manufactured and Distributed by Legacy RecordingsRelease...
Wednesday
Snakedaddy favorited MAC's discussion "They're planning a FAKE alien invasion" as the ULTIMATE false flag
Tuesday
Snakedaddy favorited FREEDOMROX's blog post THE END GAME HAS BEGUN!
Tuesday
Less Prone favorited FREEDOMROX's blog post THE END GAME HAS BEGUN!
Tuesday
Doc Vega's 3 blog posts were featured
Tuesday
tjdavis's 3 blog posts were featured
Tuesday
FREEDOMROX's blog post was featured

THE END GAME HAS BEGUN!

I know many knew this was coming, but now it is here. What will you do? I know what all good men…See More
Tuesday
Sandy posted a video

Decentralized Medicine | Jack Kruse | Assembly 2023

Dr. Jack Kruse is a neurosurgeon and advocate for decentralized medicine. Often at odds with mainstream medical practices, he challenges established norms an...
Tuesday
MAC posted a discussion
Tuesday
Michael A. Pinson posted a photo

VOTE

As the month draws to a close and we look ahead to the November elections, I want to remind you of…
Monday

© 2024   Created by truth.   Powered by

Badges  |  Report an Issue  |  Terms of Service

content and site copyright 12160.info 2007-2019 - all rights reserved. unless otherwise noted