Tuesday, June 25, 2013

Locking down your Tor usage

Due to increased interest, I figure I should post about this in a more public area.

Problem statement : "I worry that unintended data is leaking from my machine while I'm using Tor."

The solution : Using iptables to block all data exiting the machine that is not coming from the Tor daemon.

The way that I do this is by creating a simple script in my home directory called "torlock.sh".  This file contains the following lines:

sudo iptables -F
sudo iptables -I OUTPUT -o wlan0 -m owner ! --uid-owner debian-tor -j REJECT

This assumes a few things.

  1. You are on a Linux box with iptables.
  2. The local tor server is running as the user "debian-tor".
  3. You are connected to the internet through the wlan0 interface.
  4. You don't already have complex iptables rules in place.
  5. You are using the standard tor daemon, without vidalia, privoxy, or the browser bundle.

This will work out of the box for anyone on Ubuntu or Debian who installed it via the supported PPAs.

To get this working with the browser bundle, I first set a password for the debian-tor user, made sure the home directory was set to /var/lib/tor , and then installed the browser bundle there.  Then, when I want to run the browser bundle, I first run the ./torlock.sh script, then run "su debian-tor".  At that point, I can connect to anything using tor, and no traffic from my admin user, or even from root, can exit the box.  Any scripts or tools you're using should be run as your regular user, and you are guaranteed that they will only be able to touch the internet through tor.


  1. I just run over this site which I thought that it was great. It looked fascinating and I chose to investigate each substance and I read yours. My compliment about this blog is exceptionally positive I visit this blog first time and inspire by this good stuff work. Incredible post keeps up posting such great information. If you like to travel then you can use munnar call taxi for a trust worthy travel.

  2. They were flexible with their times to minimise any inconvenience to the day to day running of our business. Locksmiths proved themselves to be professional, reliable and totally honest. We would be happy to recommend them to any business. we remain a family owned business. Our objective is to provide prompt, professional, and courteous service in the security field. We specialize in servicing flat rate lock n key denver

    residential, commercial, high security and some automotive needs. We also service and sell safes as well as electronic locking devices. Please visit our products page to explore some of the product lines we have available.

  3. that is fantastic blog, I will pas this to the other peoples. http://write-my-essays.org/ninjaessays-com-review/

  4. Once the insurance employment is depended to the best administration in London, you can thoroughly depend on them and guarantee that your security is ensured. When you need to contract a security for an occasion, or a body monitor for your VIP's or for security to homes and workplaces, hunt down an administration that will render finish wellbeing for the cash they are being paid. https://how-to-remove.org/malware/ransomware-removal/fbi-virus/

  5. It is very interesting and useful post.Here is more informative information.I really enjoy to reading this article.Thanks for sharing with us. Eukhost Coupons

  6. Hi, Myself Mytravelshanti- India Tour or travel :: I Like your Blog post. India Tour Packages
    Travel To India

  7. Thank you for helping me solve the problem. Gonna try it immediately.
    dog breeds

  8. This good information about Security because in these days this is need everyone so this Content is very nice.
    Travel to India

  9. This is good blog about Security purpose writing because in these days everyone need so this Content is very fine.
    best Deals,and Upcoming Event

  10. good content writing about Security purpose because in these days everybody keep sophisticated security.
    Kerala Package
    Kerala Ayurveda Package

  11. شركة عزل اسطح
    خدمات عزل الاسطح من الخدمات التى فى حاجة الية فى المكان فاذا اراد ان تقوم باعمال العزل لاى اسطح فى المصانع – المنازل – الفلل ... وغيرها وتبحث عن افضل الخدمات التى تساعد فى الوصول الى افضل ما تتمنى ان ترى علية النتائج فعليك ان تتعاون مع شركة قمم التميز التى تحقق اعلى مستوى من العزل بالاعتماد على افضل المواد المخصصة فى القيام باعمال العزل والتى استطاعت ان تتاكد ان اعمال العزل التى تتم بالخيش المقطرن والسيلتون من افضل الخدمات المثالية المميزة التى تحقق اعلى مستوى من العزل دون ان يؤدى الى ظهور اى عيب فى اعمال العزل . شركة عزل اسطح بخميس مشيط
    لا تكتفى شركة قمم التميز بالقيام باعمال العزل فى منطقة معينة بل تسعى الى الوصول الى اى مكان فى شرق الرياض – جنوب الرياض – غرب الرياض – وسط الرياض من اجل ان تحقق خدمات العزل لجميع عملاء الشركة الكرام . شركة عزل خزانات بخميس مشيط
    تهتم شركة عزل اسطح بالقيام باعمال العزل الحرارى من خلال الاعتماد على افضل الطرق المثالية وافضل الخدمات المميزة فى القيام باعمال العزل بالاضافة الى ان الشركة تهتم باعمال الكشف الدورى من فترة الى اخرى من اجل ان يتم التحقق ان اعمال العزل تمت كما هو مطلوب فى المكان . شركة عزل فوم بخميس مشيط
    العزل الحرارى يساعد فى حماية الاسطح من التعرض الى ارتفاع فى درجة الحرارة وتسربها عبر الجدران فى فصل الصيف بالاضافة الى التعرض الى التصدعات وعوامل المناخية المختلفة التى تتعرض الية فى فصل الصيف نتيجة لشدة الحرارة التى تظهر التشوهات فى المبانى ، بالاضافة الى ان لدينا خدمات العزل المائى من خلال الاعتماد على خدمات العزل المائية التى تتم من خلال افضل خدمات متواجدة والتى تسعى الى تحقيق افضل مستوى من الخدمة والعزل بالفوم ايضا من اهم الطرق الحديثة التى استخدامت فى العديد من الدول الاوربية لانه يساعد فى حماية المبنى من التعرض الى الحرارة المرتفعه او التعرض الى التسربات للمياة والحفاظ على المبنى من اى مشاكل وعوامل مناخية ، فاعمال العزل للفوم اختصار لكل طرق العزل والتى تساعد فى الحفاظ على المبنى .
    كشف تسربات المياه
    شركة كشف تسربات المياه بخميس مشيط
    تسربات المياه مشكلة تؤدى الى التعرض الى عدد من المشكلات الاخرى ، فالاهمال فى تسربات المياه يؤدى الى التعرض الى الكثير من المشكلات التى نحن فى غنى عنة فاذا تعرض الى التسربات وتعرضت الى ظهور عدد من المشكلات الاخرى مثل سقوط الدهانات والتعرض الى مشاكل الرطوبة فعليك ان تتواصل وتتعاقد مع شركة قمم التميز المخصصه فى اعمال الكشف عن تسربات المياه


  13. This blog is so nice to me. I will continue to come here again and again. Visit my link as well. Good luck
    cara menggugurkan kandungan
    cara menggugurkan hamil

  14. This comment has been removed by the author.

  15. This comment has been removed by the author.

  16. In the recent times, when the healthcare costs have risen drastically and there has been an unprecedented surge in the prices of surgeries and services, one can only hope for a marvel to happen in times of such medical emergencies. healthcare plan in India

  17. ViDiCia is visualized with a dream of realizing Nutritional and Health needs; for everyone in this running sphere of life, we live today. ViDiCia environment comprises of the platform ViDiCia and the payment medium VDC coin. In an efficient manner, they complement each other. ViDiCia simplifies nutrition needs and VDC simplifies payment mechanism of ViDiCia. With the growth of ViDiCia; VDC coin will witness a steep rise. The concept of Nutritious Healthcare will attract a lot of enthusiasts, so will the value of VDC grow. Blockchain Based Healthcare Platform

  18. It is essentially why such advances have turned out to be imperative piece of society. Credits have moved toward becoming inside individuals' compass and have turned out to be more conceivable to address their issues at the most punctual conceivable time. car title loans chicago

  19. The measure of cash to be gotten will rely upon the auto's esteem. Endless supply of the estimation of the auto and concession to the cash to be obtained, the borrower gets the chance to keep his or her auto. aaa1autotitleloans.com/chicago

  20. I like to read your article because it really helps me. Thank you for sharing this post with us.
    Togel Online

  21. pasarqq merupakan situs bandar yang sama seperti taipanqq yang memberikan kemenangan rate tertinggi. Ada juga penyedia domino handal merpatiqq beserta dengan halaman sahabatqq. Mari selalu bergabung dengan kami untuk memperoleh jaminan menang sebesar 101% di interqq , wargaqq.

    jempolqq juga terbukti memberikan kartu yang bagus kok bos. Satu situs yang berguna anda gabungi pasti membuahkan hasil maksimal ya bos hokiqq.

    Yang terakhir bisa kami bagikan dan pastinya berguna yaitu pakqq

  22. I will be sure to bookmark it and return to read more of your useful info.


  23. Poker online situs terbaik yang kini dapat dimainkan seperti Bandar Poker yang menyediakan beberapa situs lainnya seperti , kemudian,, dan yang paling akhir yaitu Jangan lupa mendaftar di panenqq

  24. Design your everyday with best girly iPhone 7 plus cases you'll love. Show off your style with artwork and trending designs from independent artists across the world.