Tor is one of the best freely available network to protect your identity. Its considered safe because of its highly cryptographic data transfer methods. I’m not going to explain working of tor in detail, if you are interested pls read my previous blog on How to change tor exit node manually. You can switch between exit nodes every 10 seconds manually. Here  i have made a new script TorGhost for your ease.

Two main features of TorGhost

1. Routes all traffic

TorGhost can route all the network traffic through tor network i.e. every single application that tries to connect internet will go through tor network. No single ping will be leaked out, thus protecting your identity. Normally most of us use proxychain or similar application to route the traffic for a specific app. The problem is some application tends ignore proxy for much faster connection which can leak out sensitive information thus revealing your original identity or location. TorGhost can prevent you from this worst scenario. TorGhost set up a certain rules in iptables to route all outgoing connection though a certain proxy port. It also reject some sensitive incoming and outgoing request which may leak your original ip address.


2. DNS leak protection

DNS leak one of the serious issue in network security that most of us don’t know. Government organisations hunts down most of the hackers using this vulnerability. No matter how safe you encrypt dns leak is a serious issue. for more info:  What is DNS leak and how it affects your anonymity . TorGhost have a solution for that too. It can use a remote and anonymous DNS server to resolve hostname unlike other unsafe applications that uses dns provided by your ISP.



Video Demo


Download and Install TorGhost

Open the terminal and follow the commands.

# git clone
# cd torghost

chmod installer and install torghost

# chmod +x
# ./

Everything is ready. Now just open the terminal and type “torghost

To start torghost type the following command

# torghost start

To stop torghost type the following command

# torghost stop

After this you no longer have to setup manual proxy for each applications such as browsers. Any doubts or questions? post it on the comment section below. If you like this blog give me a like on facebook and add me on google plus. Subscribe my youtube channel for video tutorials.

Susmith Krishnan

I’m a computer enthusiast basically and i love to write blogs on tech issues and cyber security. I started penetration testing at the age of 16 and i would like to explore security vulnerabilities and latest tech news and wanna share with you


Me · December 12, 2016 at 6:09 pm

Hi, thanks for sharing.

However, I have an issue trying to make torghost work: it is stuck at “Fetching IP”. Is there a fix for this problem ?

    susmith HCK · December 15, 2016 at 1:05 pm

    sometimes it will take a little time to load the network.

darky · January 10, 2017 at 7:34 pm


This is good, I check it thru website leak test and it pass. But I want to make sure that in terminal commands everything pass to it. Can you give me some advise where I can see that traffic really goes to it. Thanks so much.

zolarious · January 23, 2017 at 2:34 pm

mine is stuck on “Fetching current IP” no matter how long I leave it, it doesn’t acquire and IP
is there any solution?

    susmith HCK · January 23, 2017 at 6:19 pm

    “Fetching the ip” actually means its searching a third party server for public IP even though if it fails you have already got an ip, you can check it with your browser. little bug fix needed in the code ill do it soon.

      zolarious · January 23, 2017 at 8:22 pm

      I think some how tor is blocked by my isp ( saudi arabia) as it’s not working on windows either, and I have also tried toriptables2 script and also it wasn’t able to get an ip address.
      I am trying to figure out how to install a cutome tor bridge to check of that will solve the issue

zolarious · January 25, 2017 at 2:32 pm

I found what was wrong with mine
I was trying to run it from a live usb kali linux, which most of it’s packages including tor needed to be updated
so I have switched to persistent mode updated all the packages
simply by writing these commands in terminal
apt-get update
apt-get upgrade
apt-get dist-upgrade
then installed tor by this command:
apt-get install tor
then downloaded torghost, installed it and voi la tor is working, torghost is working too.

kirib · February 17, 2017 at 3:34 am

Installing tor bundle
E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
=====> Installing TorGhost
=====> Done
=====> Open terminal and type ‘torghost’ for usage

I have this problem when installed torghost, can you give solution?

    thegargol · July 23, 2017 at 8:53 pm

    maybe you can rname archives lock in apt-get folder with :
    mv /var/lib/dpkg/lock /var/lib/dpkg/lock_bak


Dsiak · February 20, 2017 at 12:19 am

Successful in a persistent kali 19/02/2017

this is sun g00d script boi, gratz thxvm ~s2

vagrant_ · March 29, 2017 at 10:34 pm

Same can be achieved simply by running tor normally and setting a Manual Proxy with socks set to localhost ( on port 9150.

Now all your traffic should be directed through tor services.


please advise if this is a dumb method. It seems to work perfectly for me.

    susmith HCK · March 31, 2017 at 10:28 am

    This will work but you cant be secure from DNS leak.

      vagrant_ · April 4, 2017 at 9:43 pm

      you sir are very correct thanks for the advice!

run3r · April 29, 2017 at 7:18 am

I instaled in ubuntu 16.04, probably I make a disaster. Now my firefox doesnt work. I use kali linux but I want to try this script in ubuntu.

Thanks for your work!!

N0m0Fud · May 29, 2017 at 10:22 pm

This only routes IPv4 traffic through Tor. Might be worth a look to include IPv6 traffic as well.

nokog · June 4, 2017 at 12:09 pm

This seems to require sudo to run, on Debian Jessie.

Mister · August 5, 2017 at 6:20 pm

I’ve sshd into my server and started torghost, but now I can’t connect back to it. Is there any workaround for this?

HECTOR BARAJAS · August 19, 2017 at 4:42 am

Hangs on fetching IP for the longest time. Updated, upgraded, nothing seems to work. Torghost isnt working for me

kieon · August 21, 2017 at 6:37 pm

Nice i learn some thing today

hexyn · October 8, 2017 at 4:15 pm

how to uninstall torghost

i m intalling torghost then nothing is change and my browser is not connected to internet when i install it

nima · November 9, 2017 at 8:20 pm

thanks a lot for making this awesome script. I was using it some days ago and it worked awesome but from last night it keeps showing this lines and I can’t use it anymore. What should I do? please explain them in way understandable to a script kiddie :))

[18:19:07] Torrc file already configured
[18:19:07] DNS resolv.conf file already configured
Failed to start tor.service: Unit tor.service not found.
[18:19:07] Starting tor service.. [done]
sh: 3: ‘debian-tor’:: not found
iptables v1.6.1: owner: Bad value for “–uid-owner” option: “-j”
Try `iptables -h’ or ‘iptables –help’ for more information.
iptables v1.6.1: owner: Bad value for “–uid-owner” option: “-j”
Try `iptables -h’ or ‘iptables –help’ for more information.
[18:19:07] setting up iptables rules [done]
[18:19:07] Fetching current IP…
[18:19:07] CURRENT IP :

Fyr · March 10, 2018 at 11:59 am

Running Torghost successfully on Kali Linux 18.1 HDD install.
Have now tried to run on KaliLinux LivePersistence and get this output:

[13:03:22] Torrc file already configured
[13:03:22] Configuring DNS resolv.conf file.. [done]
Failed to start tor.service: Unit tor.service not found.
[13:03:22] Starting tor service.. [done]
sh: 3: ‘debian-tor’:: not found
iptables v1.6.1: owner: Bad value for “–uid-owner” option: “-j”
Try `iptables -h’ or ‘iptables –help’ for more information.
iptables v1.6.1: owner: Bad value for “–uid-owner” option: “-j”
Try `iptables -h’ or ‘iptables –help’ for more information.
[13:03:23] setting up iptables rules [done]
[13:03:23] Fetching current IP…
[13:03:23] CURRENT IP :

Your comment will be appreciated

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.