ra`s fnord » Security http://ra.fnord.at blog Thu, 20 Sep 2012 12:06:12 +0000 http://wordpress.org/?v=abc en hourly 1 Easy and secure anonymous internet usage http://ra.fnord.at/2011/05/easy-and-secure-anonymous-internet-usage/ http://ra.fnord.at/2011/05/easy-and-secure-anonymous-internet-usage/#comments Sun, 29 May 2011 15:42:31 +0000 ra http://ra.fnord.at/?p=247 As of June 2012 all updates regarding the (fast) gateway will be posted on github.

Short version:

An easy and secure way for anonymous internet usage:

  1. Install and start Virtualbox (at least version 4).
  2. Download two VM images: Tor gateway and Tor workstation
  3. Import the images (in Virtualbox File->Import Appliance)

To start using the internet anonymously you just have to start both VMs Tor gateway VM and Tor workstation VM. As soon as they they finished booting, you can use the anonymous internet access through the Tor workstation. If you want to stop using the internet anonymously, just power down both VMs.

Long version:

The goal of this article is to provide a solution to use the internet anonymously in an easy and secure way. Anonymous as in no one but you must be able to tell that you are communication with a certain receiver (like browsing a website: No one must know that you are surfing that certain website). A way to use the internet anonymously is to use an internet connection that can not be tracked down to your person and a computer that has no information stored about you. Which means quite an effort every single time you want to use the internet anonymously. For an internet connection that can not be tracked down to your person, software like Tor has been developed to accomplish this also over a non-anonymous internet connection. Checking if the computer has no information stored about you, can not be handled by the Tor software and must be handled by the user! Currently there is one major problem if you want to use the internet anonymously: You really do have to understand the functioning of computer networks and the Tor software to a degree that is far away from being trivial – otherwise you might probably use the software in an insecure way. Let me give you some examples:

  1. Install the Tor client to your Operating System and configure your browser to use the local TOR client through SOCKS-proxy functionality of Tor (or use extensions like Torbutton for Firefox to do that for you). While this is quite easy to accomplish, it has a major security drawback: If you use your everyday browser it has a lot of information stored about you and your browsing history and behavior which it might leak. Even if you use some other browser, you must turn of all plugins like Java or Flash and disable Javascript (or use a proxy like Privoxy to do that for you) so they can not leak information like which sites you visited or in which network or city you are, … But this breaks lots of websites nowadays. While this approach might be easy it is usable for browsers only and far from being “secure”.
  2. If you use the tsocks/torify approach which allows non SOCKS aware applications (e.g telnet, ssh, ftp etc) to use SOCKS without any modification, you can use most applications. But they might still leak information about the local system themselves. Besides there is the risk of just forgetting to type the “torify” in front of the command that should be executed. Which is definitely not what one wants to happen. So this approach is neither “easy” nor “secure”.
  3. The VM approach I already wrote about in an article earlier, puts the software you are using on the internet into an virtual machine (VM) which reduces the risk to leak information about you and the information within the VM. The drawback is that you have to configure a redirection with a packet filter or firewall on your host system and that you have to set up and configure a VM to use as an anonymous workstation. So this approach is still far from being “easy”.

Which is why I want to discuss a new approach that is at least as secure as the last one above (#3) but additionally should be quite easy to use:

  1. Install and start Virtualbox (at least version 4).
  2. Download two VM images: Tor gateway and Tor workstation
  3. Import the images (in Virtualbox File->Import Appliance)

To start using the internet anonymously you just have to start both VMs Tor gateway VM and Tor workstation VM. As soon as they finished booting, you can use the anonymous internet access through the Tor workstation. If you want to stop using the internet anonymously, just power down both VMs. The task of routing traffic through the Tor network has been moved to the Tor gateway VM. So you do not have to modify your local system any more then installing Virtualbox and importing both VMs. You do have a preconfigured Tor workstation ready to use that boots within a minute and you can be sure to anonymously use the internet. The Tor gateway runs OpenWRT Linux using just about 8Mb of disk space and 32Mb of RAM. It boots in less then 3 seconds and transparently routes all traffic generated within the Tor gateway itself and every traffic coming on the virtual internal interface “tor” through the Tor network. You do not need to do anything but start when you want to use Tor and stop the VM when you finished. The Tor workstation runs Micro Core Linux using about 120Mb of disk space and 192Mb of RAM. It boots in less then a minute and has some browsers (Firefox, Chromium and Opera) and a terminal installed. It only stores information within a session. So if you shut it down and boot it again it does not have any information about the previous session. Of course you are not forced to use the Tor workstation. You can use any other VM (Linux, Windows, AmigaOS, just any TCP/IP capable Operating System). Just configure the network settings of the VM (in Virtualbox Settings->Network->Adapter attached to internal network “tor”). Please report, if you encounter any unwanted behavior or find any problems! Also do so if you have got any suggestions to improve the VMs or this approach as a whole. Side note: The content of the communication between you (Tor workstation VM) and any receiver (e.g. a website) is necessarily only encrypted within the Tor network. So if you open an unencrypted connection to any receiver the Tor exit node which in fact opens the connection to the receiver is able to see the content of the connection. So do not send any sensible information like passwords over unencrypted connections!

Information for developers

There is a git repository available for building the Tor gateway image from scratch. Feedback and patches are welcome.


To use the fast gateway you need to change the internal network of workstation VM to “torfast”.

http://ra.fnord.at/2011/05/easy-and-secure-anonymous-internet-usage/feed/ 134
Routing unmodified Virtual Machines through the TOR network http://ra.fnord.at/2010/02/routing-unmodified-virtual-machines-through-the-tor-network/ http://ra.fnord.at/2010/02/routing-unmodified-virtual-machines-through-the-tor-network/#comments Wed, 03 Feb 2010 16:43:13 +0000 ra http://ra.fnord.at/?p=205 So far I had three different TOR setups:

  • A browser (Firefox) using a local HTTP proxy (Privoxy) which uses a local TOR client through SOCKS.
  • tsocks/torify to make non-SOCKS-aware-applications work through TOR.
  • A virtual machine (VM) where some applications are configured to use the local HTTP proxy and/or TOR client.

Each of these setups has different disadvantages and neither fits my requirements:

  • In the browser approach I had to turn off all plugins (Java, Flash, ..) and Javascript so they can not leak information about the local system. Unfortunately this breaks many websites nowadays.
  • The tsocks/torify approach works for most applications but they may leak information about the local system themselves. Anyway there is a small risk of just forgetting to type the “torify” in front of the command I want to execute which I really do not want to happen.
  • The VM approach is like putting the two previous approaches into a VM. So the risk of leaking local information is reduced to the VM. Anyway I have to make applications running within the VM explicitely use the TOR network. Besides I want to take care that no other traffic but TOR is going out of the VM which means I have to set up a packet filter on the host.

One solution might be to transparently route a VM through the TOR network so that a VM does not need to be modified in any way. It is quite simple and should work on all OS although I just tried it on a Linux host. As already said, the VM can run any OS!

The host must to redirect all TCP packets to a transparent SOCKS proxy which itself forwards the packets to a TOR client. UDP packets with destination port 53 are redirected to a small script which puts the payload into a TCP packet and forwards it to a TOR client. This is necessary because TOR itself can only handle TCP packets. The host must drop all other packets coming from the VM.

How this works under a Linux host:

  • Create an unprivileged user “torbob” that runs the VMs.
  • Choose a virtualization software. I decided to go for qemu/kvm since I am already familiar with it. Using Virtualbox or VMware should also work.
  • Install, configure and run a transparent SOCKS proxy. I use redsocks but there are also others around. Remember the port it is listening on (31337 in this case). Update: This is not necessary anymore, because Tor has an inbuilt SOCKS proxy since version Just add “TransListenAddress″ and “TransPort 31337″ to your torrc.
  • Configure and run the tor-dns-proxy.py script from dsocks which does the UDP->TCP packet DNS conversion and remember the port it is listening on (1253 in this case). Update: This is not necessary anymore, because Tor has this inbuilt since version Just add ” DNSListenAddress″ and “DNSPort 1253″ to your torrc. If you want to be able to resolve .onion domains, you also have to add “VirtualAddrNetwork″ to your torrc.
  • Redirect the packets from the VM to the local daemons:

iptables -A OUTPUT -t nat -p tcp -m owner –uid-owner torbob -j REDIRECT –to-ports 31337
iptables -A OUTPUT -t nat -p udp –dport 53 -m owner –uid-owner torbob -j REDIRECT –to-ports 1253

  • Make sure that packets to that daemons are accepted and all other packets from that user are dropped/logged:

iptables -A OUTPUT -d -p tcp -m tcp –dport 31337 -m owner –uid-owner torbob -j ACCEPT
iptables -A OUTPUT -d -p udp -m udp –dport 1253 -m owner –uid-owner torbob -j ACCEPT
iptables -A OUTPUT -m owner –uid-owner torbob -j LOG
iptables -A OUTPUT -m owner –uid-owner torbob -j DROP

  • If you want to share files through SMB between the host and the VM you have to add a few more rules *before* the rules above:

iptables -A OUTPUT -t nat -d -p tcp -m tcp –dport 445 -m owner –uid-owner torbob -j RETURN
iptables -A OUTPUT -t nat -d -p tcp -m tcp –dport 139 -m owner –uid-owner torbob -j RETURN
iptables -A OUTPUT -d -p udp -m udp –dport 137 -m owner –uid-owner torbob -j ACCEPT
iptables -A OUTPUT -d -p tcp -m tcp –dport 445 -m owner –uid-owner torbob -j ACCEPT
iptables -A OUTPUT -d -p tcp -m tcp –dport 139 -m owner –uid-owner torbob -j ACCEPT

  • Thats it. Now starting a VM (or running any other program) as user “torbob” will either route its traffic through the TOR network (or drop the packets if they use an unsupported protocol).
http://ra.fnord.at/2010/02/routing-unmodified-virtual-machines-through-the-tor-network/feed/ 0
Flash cookies http://ra.fnord.at/2009/04/flash-cookies/ http://ra.fnord.at/2009/04/flash-cookies/#comments Fri, 10 Apr 2009 23:08:50 +0000 ra http://ra.fnord.at/?p=168 If you are concered about your privacy while browsing you probably know about cookies and handle them properly (delete them automatically when closing a browser session, block all cookies except whitelisted ones, ..).

Macromedia/Adobe introduced something similar to cookies called “Local Shared Object” in Flash6. Unfortunately browsers (at least Firefox) currently do not handle Flash cookies easily. If you tell your browser to clear its cookies they simply persist.

I was very surprised by the vast amount of flash cookies located on my system. Take a look yourself “~/.macromedia/Flash_Player/#SharedObjects/” for Linux, “~/Library/Preferences/Macromedia/Flash Player/#SharedObjects/” for Mac OS X or “%APPDATA%\Macromedia\Flash Player\#SharedObjects\” for Windows XP/Vista.

Two Flash cookies on my system are related to a browser game all others were not needed and I deleted them. You can configure your flash preferences at Adobe. If you want to deny all Flash cookies you need to set the amount of disk space that can be used to “None” at the “Global Storage Settings”. You will then be asked everytime a Flash object wants to set a cookies unless you also enable “Never ask again”.

Some more information about Flash cookies.

http://ra.fnord.at/2009/04/flash-cookies/feed/ 0
Kernel “Trusted Path Execution” patch (tpe) http://ra.fnord.at/2007/09/kernel-trusted-path-execution-patch-tpe/ http://ra.fnord.at/2007/09/kernel-trusted-path-execution-patch-tpe/#comments Mon, 10 Sep 2007 17:33:29 +0000 ra https://sunkist.annessi.at/wordpress/2007/09/10/kernel-trusted-path-execution-patch-tpe/ I just finished a patch to the Linux kernel which implements “trusted path execution”.

You can specifiy a trusted directory and a group as “trusted” or “untrusted”.
If the group is untrusted all users belonging to this group will only be able to execute files from the trusted directory. If the group is trusted all users will only be able to execute files from the trusted directory but users belonging to the group (and root of course).

Get it here: linux-2.6.18-tpe_restriction (patch, 5 KB)

The patch is based on grsecurity – so credits go to Brad Spengler.

http://ra.fnord.at/2007/09/kernel-trusted-path-execution-patch-tpe/feed/ 0
Kernel Patches (proc & dmesg restriction) http://ra.fnord.at/2007/07/kernel-patches-proc-dmesg-restriction/ http://ra.fnord.at/2007/07/kernel-patches-proc-dmesg-restriction/#comments Tue, 31 Jul 2007 16:38:11 +0000 ra https://sunkist.annessi.at/wordpress/2007/07/31/kernel-patches-proc-dmesg-restriction/ I updated two kernel patches to the Linux kernel.

  • linux-2.6.18-proc_restrictions.patch (patch, 12 KB) which basically restricts non-root users from viewing all processes (plus an option for some additional /proc restrictions). It is possible to define a GID which is not affected by the restrictions.
  • linux-2.6.18-dmesg_restriction.patch (patch, 1 KB) which restricts non-root users from viewing kernel log buffer messages.

Both patches are based on grsecurity – so credits go to Brad Spengler.

http://ra.fnord.at/2007/07/kernel-patches-proc-dmesg-restriction/feed/ 0
OpenWRT: 802.1x WPA2 TLS http://ra.fnord.at/2007/07/openwrt-8021x-wpa2-tls/ http://ra.fnord.at/2007/07/openwrt-8021x-wpa2-tls/#comments Tue, 31 Jul 2007 16:26:55 +0000 ra https://sunkist.annessi.at/wordpress/2007/07/31/openwrt-8021x-wpa2-tls/ Ein nettes Howto wie man unter OpenWRT WPA2 TLS lauffähig bekommt. Auch nützlich, wenn man kein OpenWRT nutzt (im speziellen die Zertifikatgenerierung für Windows Clients).


http://ra.fnord.at/2007/07/openwrt-8021x-wpa2-tls/feed/ 2
Skype ist böse[tm] http://ra.fnord.at/2007/03/skype-ist-bsetm/ http://ra.fnord.at/2007/03/skype-ist-bsetm/#comments Sat, 03 Mar 2007 11:14:57 +0000 ra https://sunkist.annessi.at/wordpress/2007/03/03/skype-ist-bsetm/ Philippe Biondi und Fabrice Desclaux haben gestern auf der Blackhat den Vortrag Silver Needle in the Skype gehalten, in dem sie Skype einmal genauer unter die Lupe genommen haben.
Die Folien gibt es hier.
Fazit: Falls Skype noch läuft: Abdrehen – JETZT!
Und Alternativen wie Jingle/Jabber verwenden.

http://ra.fnord.at/2007/03/skype-ist-bsetm/feed/ 0
OpenSSL security advisory http://ra.fnord.at/2006/09/openssl-security-advisory/ http://ra.fnord.at/2006/09/openssl-security-advisory/#comments Mon, 25 Sep 2006 20:40:25 +0000 ra https://sunkist.annessi.at/wordpress/2006/09/25/openssl-security-advisory/ Ouch..

See: http://www.openssl.org/news/secadv_20060905.txt

Update: Now there is even an public exploit available http://www.cdc.informatik.tu-darmstadt.de/securebrowser/

http://ra.fnord.at/2006/09/openssl-security-advisory/feed/ 0
Six Tips to Protect Your Online Search Privacy http://ra.fnord.at/2006/09/six-tips-to-protect-your-online-search-privacy/ http://ra.fnord.at/2006/09/six-tips-to-protect-your-online-search-privacy/#comments Sun, 24 Sep 2006 21:13:20 +0000 ra https://sunkist.annessi.at/wordpress/2006/09/24/six-tips-to-protect-your-online-search-privacy/ Summary:
1. Don’t put personally identifying information in your search terms (easy)
2. Don’t use your ISP’s search engine (easy)
3. Don’t login to your search engine or related tools (intermediate)
4. Block “cookies” from your search engine (intermediate)
5. Vary your IP address (intermediate)
6. Use web proxies and anonymizing software like Tor (advanced)

More in depth original version

http://ra.fnord.at/2006/09/six-tips-to-protect-your-online-search-privacy/feed/ 0
WTH & 22C3 Videos http://ra.fnord.at/2006/09/wth-22c3-videos/ http://ra.fnord.at/2006/09/wth-22c3-videos/#comments Thu, 07 Sep 2006 14:38:00 +0000 ra https://sunkist.annessi.at/wordpress/1970/01/01/wth-22c3-videos/ Beside from the lock bumping video I enjoyed this WTH & 22C3 videos most (every video is several 100Mb in size):

ftp://ftp.ccc.de/congress/22c3/lectures/video/mp4/720×576/22C3-408-en-private_investigations_in_searching.mp4 (this one’s really great!)

http://ra.fnord.at/2006/09/wth-22c3-videos/feed/ 0
Lock bumping http://ra.fnord.at/2006/09/lock-bumping/ http://ra.fnord.at/2006/09/lock-bumping/#comments Thu, 07 Sep 2006 12:55:42 +0000 ra https://sunkist.annessi.at/wordpress/2006/09/07/lock-bumping/ It’s very impressing how easy it is to open locks..

Lockpickers site:

Lock tests:

Bump proof locks:

Video from the whatthehack (~667Mb):

http://ra.fnord.at/2006/09/lock-bumping/feed/ 0