How to force whole-network Tor with LAN -> Tor -> WAN configuration?
-
I have made some progress on achieving my goal of forcing no-leak Tor access to the internet using the pfSense firewall. It's not quite as thorough of a solution as I have wanted, but it's still useful because it serves the job of isolating my entire network from the internet, and only allowing connections via Tor. In the process of setting this up, I've discovered several leaks I was not aware of, and some of them were even bypassing the VPN somehow. It's been a learning experience overall, and I think I have a workable version of a simple solution, just like I wanted, thanks to pfSense. Here's what I have done in detail, in case someone finds this discussion wanting to make Tor safer with pfSense:
1. Configure Tor to Use a Tor bridge: Vidalia -> Settings -> Network -> Bridge Settings. This will make it possible for the pfSense firewall to allow connections only to the Tor bridge IP address, and block all other connection attempts. Adding several different Tor bridges will ensure you have connectivity if one of them goes down. Using 3 different Tor bridge IP's is recommended, but only 1 is necessary to try this out. It is much easier to find mistakes if you start with only 1 Tor bridge. More can always be added later.
The format given by the official Tor bridge service (search the web for "Tor bridge") is intended for direct addition to the "torrc" config file. Remove the word "Bridge" and add each IP and port pair one line at a time in Vidalia. That is not explained anywhere that I could find, which is strange because Vidalia is supposed to make this easy.
2. pfSense Firewall -> Rules -> LAN: Click the green icon to disable the "Default allow LAN to any rule". The rule is usually at the bottom of the rules list. That disables all communication to the internet. Don't delete it, because you might want to re-enable it in the future (it is easy to re-add it if you delete it). Next, we allow only Tor to communicate with the internet.
3. pfSense Firewall -> Rules -> LAN -> add new rule (click the + sign): Allow the Tor bridge IP's, and make sure the "Anti-Lockout Rule" is at the top of the rules list, and the "Default allow LAN to any rule" is at the bottom of the list (and disabled).
Action: Pass
Disabled: unchecked
Interface: LAN
Protocol: TCP
Source: not: unchecked
Source: Type: any
Destination: not: unchecked
Destination: Type: Single host or alias
Destination: Address: Enter the Tor bridge IP address here
Destination port range: from: Enter the Tor bridge port here (usually 443)
Destination port range: to: Enter the Tor bridge port here (usually 443)
Log: checked
Description: Allow Tor bridge4. pfSense Firewall -> Rules -> LAN: A prompt will appear above the list of firewall rules asking you to apply your changes. Click "Apply".
5. pfSense Diagnostics -> States -> Reset States: Existing connections will not be stopped when you change firewall rules, so you must close those connections before you can see the results of your firewall changes. Click the "Reset" button, then you can immediately reload the Reset States page manually. Because the connection was disrupted by clicking the reset button, the page will not be able to load on its own. When it loads, the reset is done (almost instantaneously).
6. Edit your Tor torrc configuration file, and add "DNSPort 53" on a new line at the bottom, without quotes, then save the file and restart Tor. The built-in torrc editor in Vidalia did not work for me, so I only used Vidalia to find the path to the torrc file, and then I edited it with a regular text editor. You can find the path in Vidalia -> Settings -> Advanced -> Tor Configuration File. On Windows, it might look like "C:\Users\Somebody\AppData\Local\Vidalia\torrc". To use the built-in torrc editor, click the button that says "Edit current torrc".
7. Configure your OS's DNS settings to use 127.0.0.1 as the primary DNS. If you are forced to enter a secondary DNS, you can enter 127.0.0.2 (it doesn't work and it doesn't do anything).
8. Test your setup just to verify that you have internet access. Use a safe computer on a safe connection so that it's OK if something goes wrong and your IP address leaks out.
9. In pfSense, check the firewall logs in Status -> System Logs -> Firewall. You should see a lot of stuff getting blocked, and only a few things passing through. Make sure those things passing through are supposed to be passing through, and also that it's ONLY passing through the Tor bridge IP's. If there is a problem, you will see it in the firewall log. Check the log frequently to be sure everything except Tor is being blocked. pfSense is good at that, so there's not much to worry about.
10. Turn on Flash, JavaScript, and all the nasty little backdoors that Tor users fear, and use the "full anonymity test" for your web browser at http://ip-check.info/?lang=en . In every test I have run, only VPN and Tor exits have been detectable, which is exactly the way it's supposed to be!
Because pfSense is blocking EVERYTHING except Tor, there is no way for any PC on your network to learn what IP it is using to access the internet. Because every bit of data leaving and entering your PC and your LAN must pass through Tor, there is no way anyone else can learn what your true IP is either. I setup my pfSense system with 2 separate ethernet ports, so there is physical isolation between the LAN and the WAN.
I'm sure this setup isn't 100% bulletproof, but as far as I can tell, as long as pfSense doesn't get hacked, it would be OK for any PC on my network to get hacked, and the hacker would not be able to learn my IP address (and location). Because I'm not using Tor Browser, my activities online are still trackable with cookies, JavaScript, browser profiling, etc. Although no one knows my name and where I live if I don't tell them, the ability to track my internet usage means that, in the strictest sense, I'm not using the internet anonymously.
If I wanted to be completely anonymous AND untrackable, I would have to switch to using Tor Browser, or even better, Whonix. I may do that when my tasks require that much protection, but for most things most of the time, I don't care if people know which websites I'm visiting. In my case, that information isn't a problem for me. It might be for you.
To have a full-featured internet experience (with Flash, JavaScript, etc) combined with the ability to conceal my location, is good enough for me 99% of the time. I can always switch to Whonix or Tor Browser if I need more privacy than that. The pfSense firewall will still do its job of blocking everything that's not Tor, if something goes wrong with Tor Browser or Whonix. I see that surprise bugs have been found in Tor Browser before, and pfSense would have prevented the bug from doing any damage. Here's more info about one of those bugs:
https://blog.torproject.org/blog/firefox-security-bug-proxy-bypass-tbbs
I'm sure my setup can be improved. I've noticed that sometimes my PC tells me I've got no internet access when I actually do. That's probably because pfSense is blocking DHCP. As long as stuff keeps working, then the more the merrier :)
-
One more thing, Squid will not be effective for caching on pfSense with this setup because all connections are encrypted. There might be a way to get it to work, perhaps on my local PC, but it would take some interesting gymnastics to give Squid access to decrypted traffic so it could cache some of the data. That would be nice.
-
FYI, I polished up that info a little better and turned it into an article for LBC: 10 steps to make Tor safer with pfSense. Thanks for the help kejianshi. Even though I didn't quite get to where I wanted to go, your help eventually led me to another solution that worked for me, and will probably work for a lot of other people who ought to take a look at using pfSense. I guess that's the only part of this that I got right from the start - pfSense is the key component!
-
Another FYI, my article is now slightly famous thanks to reddit:
http://www.reddit.com/r/onions/comments/1l15hx/10_steps_to_make_tor_safer_with_pfsense/
http://www.reddit.com/r/privacy/comments/1l25mu/adding_more_tor_to_your_day_leading_up_to_a_total/
I hope the attention will lead more people to try using pfSense. It's a fantastic system that more people ought to know about. Being able to so easily do unexpected stuff with it will probably get people's imaginations going. What will they think of next?!
-
Well - as long as you are happy, I am happy. Are you using it?
-
Yes, I am using it. Further research indicated that Tor was not configured to accept external connections, so I will be revisiting this topic later. It may still be possible to force whole-network Tor, without any LAN client configuration. I have succeeded in tunneling UDP over Tor and Torifying everything using a VPN. I tested it with VoIP, and despite such a long route, the increased latency was acceptable! I fully expected VoIP to be miserable to use, but it was not much worse than using it without Tor. That was a huge surprise.
-
I just created a VLAN using pfSense, and am routing all external traffic over Tor using a Raspberry Pi 2…
pfSense is my acting DHCP server, but the Raspberry Pi 2 is the default gateway... The Raspberry Pi 2 is also provided Internet access using a different VLAN that's traffic is routed over my PIA (PrivateInternetAccess) VPN, but that's defaulted at my Cisco Smart Switch... So I'm double covered...
I created an SSID on my Meraki Wireless AP just for the new VLAN so all my wireless clients that use it will be doing so over the VPN/TOR networks...
I'm also not using SQUID at all... Everything just works...
If anyone is interested, I can gladly post a tutorial...
FYI, and any traffic that shouldn't (or can't) transmit over the Tor network is being dropped to prevent leaks.
I haven't thoroughly tested for leaks yet, but am doing so now...
-
I would be very curious to see your tutorial if you write one.
-
I posted it to my blog for initial posting…
Here's the link: http://www.lennysh.com/create-a-tor-vlan-using-a-raspberry-pi-and-pfsense/
Please let me know if I missed anything, or could of done anything better.
Once I get it fine tuned, I may copy/paste it here for easy finding...
-
Just remember the spooks run their own honeypots including smaller honeypots on public websites & services in plain view.
You can be found using TOR because in maths its possible to workout unknowns and thus you wont ever have perfect privacy or anonymity which is especially bad news for introverts.
-
+1 on the need for a TOR package. It would make setting up a guest wireless network really easy. No WLAN passwords needed and no worrying about what the guest do on the network.
-
I just found out that Intel has had backdoors in their hardware for years. Of course they claim it's just a bug, and only processors from 1995 to 2011 are affected, but there is conveniently always a "bug upgrade" that removes the old backdoor and creates a new one that will take a while to be found. With that in mind, I have to wonder if we're all wasting our time. AMD said they would review the possibility that they have a backdoor, but I'm not optimistic. Who can we trust these days?
I don't know much about Raspberry Pi - is it running on something that is less likely to be backdoored? The thought crossed my mind that since ARM designs, but does not manufacture, that means anyone they license their design to would be able to see the licensed design specs, and spot a backdoor if one existed. Intel, AMD, etc don't let anyone look at their designs, so it literally takes a decades and a lot of luck for someone to find out about a backdoor.
“We cannot trust” Intel and Via's chip-based crypto, FreeBSD …
Intel left a fascinating security flaw in its chips for 16 years – here's …
I don't know why everyone isn't talking about this, and bringing it up in every conversation that remotely involves cryptography. The Intel backdoor is so phenomenally effective that it can be installed into the CPU microcode. It cannot be detected, and it can never be removed. Wiping an HDD and doing a fresh OS install will not get rid of it. Of course, Intel claims they got rid of it in 2011, but then they introduced something that could potentially be a wireless backdoor:
“Secret” 3G Intel Chip Gives Snoops Backdoor PC Access Alex …
That article seems alarmist, and people criticizing it point out that a lack of an antenna would give it pathetically short range, but I completely disagree. I think the alarmist reaction is the right one. First of all, being able to gain complete access to a CPU even if it requires you to be within 10 inches of it, is more than adequate to make the backdoor useful. Simply walking past a PC might be sufficient to gain access to it. Or, what about sending RF signals down ethernet or power lines? That'd do it too. That kind of weak signal espionage is well-developed in "spook" world, and even lowly amateur radio enthusiasts are able to pull off tricks like that.
This whole-network Tor thing is something I take pretty seriously, and I'm not afraid to turn to specialized hardware like Raspberry Pi or whatever if that's necessary to ensure Tor's cryptography can't be rendered useless by hardware backdoors. This is crazy that this even needs to be discussed, but since it does, it ought to be tattooed on everyone's forehead until solutions are found and made available. Everyone needs to worry about this.
-
IMHO if you need THAT much encryption, you're doing something really bad. Either that or you need a titanium tin-foil hat.
If you're really worried about it, drive 100 miles in any direction, find a home with an unsecured wireless connection, and use a throw-away Netbook each time you access the Internet via Tor. Oh, and either steal the Netbook or pay with cash in a back alley.
-
tim.mcmanus, how much encryption are you referring to as "THAT much"? Because what I've described obliterates ALL encryption. What exactly is a "really bad" use of encryption in your opinion? How much do you think your opinion of badness matters to people who want to use effective encryption? And, most importantly, what gives you the idea that you know anything at all about what other people are encrypting?
If you will kindly give me your login credentials for this forum, I will write your opinion for you, posing as you. I might then proceed to proclaim your love of evil and all things forbidden, once again, posing as you. You don't like the sound of that? Oh, then it looks like you need "THAT much really bad" encryption too.
No, sir, you can take your opinion of what I'm doing with my encryption, and shove it - into your favorite encryption tool, and then delete the key.
-
Famous:
https://www.reddit.com/r/conspiracy/comments/3kinq6/why_isnt_everyone_talking_about_hardware/
…and:
https://www.reddit.com/r/conspiracy/comments/3kesvm/study_shows_conspiracy_theory_insult_losing_power/
-
Time to loosen the tinfoil hat.
-
Because what I've described obliterates ALL encryption.
Um, Tor…
And, most importantly, what gives you the idea that you know anything at all about what other people are encrypting?
Usually you encrypt things you don't want people to see. You're either severely paranoid or doing something really bad.
If you will kindly give me your login credentials for this forum, I will write your opinion for you, posing as you. I might then proceed to proclaim your love of evil and all things forbidden, once again, posing as you. You don't like the sound of that? Oh, then it looks like you need "THAT much really bad" encryption too.
It's actually a violation of the terms of using this board, sharing of login credentials. And I like it here, so, no, I won't share.
No, sir, you can take your opinion of what I'm doing with my encryption, and shove it - into your favorite encryption tool, and then delete the key.
I thought what you were doing obliterated all encryption. Are you sure you know what that word means?
-
Because what I've described obliterates ALL encryption.
Um, Tor…
Yes, Tor. Onion routing is fundamentally onion encryption. The only reason the onion routers don't know the source or destination of packets is because they're encrypted. No encryption, no Tor. Encryption backdoor, Tor backdoor.
And, most importantly, what gives you the idea that you know anything at all about what other people are encrypting?
Usually you encrypt things you don't want people to see. You're either severely paranoid or doing something really bad.
I wear clothes too.
If you will kindly give me your login credentials for this forum, I will write your opinion for you, posing as you. I might then proceed to proclaim your love of evil and all things forbidden, once again, posing as you. You don't like the sound of that? Oh, then it looks like you need "THAT much really bad" encryption too.
It's actually a violation of the terms of using this board, sharing of login credentials. And I like it here, so, no, I won't share.
You missed the point. Without effective encryption, you don't have to share your login credentials, they can simply be taken from you. Are you using an American-made CPU?
No, sir, you can take your opinion of what I'm doing with my encryption, and shove it - into your favorite encryption tool, and then delete the key.
I thought what you were doing obliterated all encryption. Are you sure you know what that word means?
You missed the point again. The point was that the encryption key isn't required. Don't worry, you won't lose your opinion by encrypting it, even if you do delete the key.
-
I think most people want privacy, assume they have it and therefore assume anyone excited about internet privacy must be a criminal or something.
I don't think tor is the way to go though. Its slow and has to many limitations.
A good VPN would be better.
-
Tor hasnt been that slow for me, but tails for example is not secure or hardened in any way, in fact alot of the so called privacy products when I started investigating them appear to do the opposite especially when considering how easy it is to stand out by virtue of running something different to everyone. In some respects the misdirection are the claims of affording some level of privacy, just like Snowden is a false flag as the spooks didnt know how to break it to the world the capabilities they have some of which go back last century.
The US or UK is no better or worse than Russia, China or North Korea, they still ignore their own laws when it suits them.
If anything, for privacy you'd probably want to use the most popular computer device and OS out there in order to blend into the crowds, beit a phone, laptop, tablet or desktop, and even then you still have stingrays to deal with, but if they want to target you, you have no privacy at all, lets face it even the land lines in your offices and homes are powered up 24/7 to listening in at will which is also handy in case of a powercut.
In the mean time this still hasnt stopped a few US companies taking out patents on stuff I've been working on, which is why people are financially cleansed in the same sense as ethnic cleansing was outlawed after WW2, as money makes developments, patents, lawyers etc all possible, which a one man band like myself simple cant compete with.
Ironic really how history repeats in many ways.