kali安装tor

来源:互联网 发布:电脑网络开关设置 编辑:程序博客网 时间:2024/05/22 14:21


http://www.blackmoreops.com/2013/12/16 /installing-tor-kali-linux/


Wednesday , August 16 2017
blackMORE Ops

Installing Tor in Kali Linux

Tor is free software and an open network that helps you defend against traffic analysis, a form of network surveillance that threatens personal freedom and privacy, confidential business activities and relationships, and state security. Installing Tor in Kali Linux - blackMORE Ops - 2

This guide guides your through installing tor in Kali Linux.

Why anonymity matters?

Tor protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world: it prevents somebody watching your Internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location.

[Source: https://www.torproject.org/]

Installing Tor in Kali Linux:

Step 1: Getting tor service ready

There are 3 ways of installing Tor service in Kali Linux. You can install Tor by following any of these options:

Option #1: Install Tor from Kali Repository

Tor is available in Kali repository, to install it directly from the repository open your Terminal and type this:

apt-get install tor

If no error occurs, follow the second step.

Option #2: Install Tor from Debian Wheezy Repository

If you can’t install Tor using the first method then you may try this option. In this way we are going to add the official Tor repository according to our Debian distribution. Not to be confused, Kali is actually based on Debian and it uses the package management from “Wheezy”. So we are going to use “Wheezy” as our distribution.
Now open your terminal and follow these steps:

Step #1: Add repo to sources.list file

Lets add the distribution in the list by opening the sources.list file

leafpad /etc/apt/sources.list

Now add the following line at the bottom of the file,

deb http://deb.torproject.org/torproject.org wheezy main
Step #2: Add GPG Keys

Now we need to add the gpg key used to sign the packages by running the following commands:

gpg --keyserver keys.gnupg.net --recv 886DDD89gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
Step #3: Update package lists

Lets refresh our sources:

apt-get update
Step #4: Install singing keys

Now, before installing the Tor we must add the signing key,

apt-get install deb.torproject.org-keyring
Step #5: Install Tor from Debian repository

Finally,

apt-get install tor

Now Tor should be installed!
If no error occurs, follow the second step.

Option #3: Install Tor from development branch

If you are an advanced user and you want to install Tor using the development branch then this method is for you.

Step #1: Add Tor project repository to sources.list

You need to add a different set of lines to your /etc/apt/sources.list file:

deb http://deb.torproject.org/torproject.org wheezy maindeb http://deb.torproject.org/torproject.org tor-experimental-0.2.5.x- wheezy main
Step #2: Add GPG keys, keyring and install Tor

Then run the following commands at your command prompt:

gpg --keyserver keys.gnupg.net --recv 886DDD89gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -apt-get updateapt-get install tor deb.torproject.org-keyring

Now Tor should be installed!
If no error occurs, follow the second step.
Note: This release will provide you more features but it contains bugs too.

Option #4: Build and Install Tor from sources

If you want to build your own debs from source you must first add an appropriatedeb-src line to sources.list.

deb-src http://deb.torproject.org/torproject.org wheezy maindeb-src http://deb.torproject.org/torproject.org wheezy maindeb-src http://deb.torproject.org/torproject.org tor-experimental-0.2.5.x--wheezy main

You also need to install the necessary packages to build your own debs and the packages needed to build Tor:

apt-get install build-essential fakeroot devscriptsapt-get build-dep tor

Then you can build Tor in ~/debian-packages:

mkdir ~/debian-packages; cd ~/debian-packagesapt-get source torcd tor-*debuild -rfakeroot -uc -uscd ..

Now you can install the new package:

dpkg -i tor_*.deb

Step #2: Downloading and Running Tor bundle

Download the Tor Bundle from here,
https://www.torproject.org/projects/torbrowser.html.en
Download the architecture-appropriate file above, save it somewhere, then run one of the following two commands to extract the package archive:

tar -xvzf tor-browser-gnu-linux-i686-2.3.25-15-dev-LANG.tar.gz

or (for the 64-bit version):

tar -xvzf tor-browser-gnu-linux-x86_64-2.3.25-16-dev-LANG.tar.gz

(where LANG is the language listed in the filename).
Once that’s done, switch to the Tor browser directory by running:

cd tor-browser_LANG

(whereLANG is the language listed in the filename).
To run the Tor Browser Bundle, execute the start-tor-browser script:

./start-tor-browser

This will launch Vidalia and once that connects to Tor, it will launchFirefox.

Note: Do not unpack or run TBB as root. (though in Kali Linux, it doesn’t make any differences)

Conclusion

How secured is TOR? It’s only as secured as the upstream nodes are! VPN is always better solution and to be honest, VPN is faster than TOR. In case you’ve already tried TOR and it didn’t hold up to your requirements, you should try tosetup VPN to bypass security or restrictions.torsocks is another alternative to using TOR and it’s somewhat faster as there’s less users on that at anytime.

Thanks for reading. Please share with friends.

Previous How to change hostname in Kali Linux?
Next Fix “WARNING: The following packages cannot be authenticated!” in Kali Linux

Check Also

Correct way of installing VirtualBox Guest Additions in Kali Linux 2016.2/2017 (Kali Rolling)

How to install VirtualBox Guest Additions in Kali Linux (Kali Rolling / Kali Linux 2016.2 / Kali 2017)

Since Kali Linux 2016 came out (also known as Kali Rolling), it seems that Official …

Run Kali Linux in Microsoft Azure on SSD for free - blackMORE Ops - 1

Run Kali Linux in Microsoft Azure on SSD for free

Big news for Kali Linux users, now you can run Kali Linux in Microsoft Azure …

43 comments

  1. Kish

    Very helpful..Thanks

    Reply
  2. Roger Morton

    you say don't run or unpack as root. But on kali linux you are always root. What do you recomend? Create a non-root user or forget about this "don't run as root" bizo?

    Reply
    • anarchos

      you are not root all the time… create a new user and protect your ass…

      Reply
  3. blackMORE Ops

    Hi Roger,
    I didn't wrote that article. I guess that's what's recommended by TOR Project because of security risk where TOR might open up a port. In Kali, it doesn't really matter. I'll leave that line cause TOR can be used by Ubuntu/Debian non-root users as well and this serves up as a reminder not to run things you don't know as root.
    Personally I install tor(apt-get install tor), run tor service (service tor start) and use proxychains (proxychains iceweasel) to browse if I have to. Lastly I tail my log /var/log/tor/log to see the activities and keep a copy of that log separately stored.
    Good catch though. Thanks.

    Reply
  4. Tester

    For those who gets “The Tor Browser Bundle should not be run as root. Exiting”
    it’s because you’re running it as root
    You have 2 options
    – Make another user
    – Remove these lines of code:

    – Type

    nano start-tor-browser

    – Comment those lines

    #if [ “`id -u`” -eq 0 ]; then
    # complain “The Tor Browser Bundle should not be run as root. Exiting.”
    # exit 1
    #fi

    Now you can start as root

    Reply
  5. Sarthak

    WHY IS THIS HAPPENING? PLEASE HELP ME!

    guest@SarthaK:/home/tor-browser_en-US$ cd /home/tor-browser_en-US && ./start-tor-browser -G

    Launching Tor Browser Bundle for Linux in /home/tor-browser_en-US
    No protocol specified
    Error: cannot open display: :0.0
    Tor Browser exited abnormally. Exit code: 1

    Reply
    • blackMORE Ops

      Hi Sarthak,
      Run as ROOT and see how that works (or as sudo user). Good Luck.
      -BMO

      Reply
    • Richard

      Did you get thsi resolved? I’m having the same problem.

      Reply
  6. 5p412120w

    Hello. I know this is a bit old, but was wondering if blackops might be able to assist me.

    I’ve run through your tut and got everything fine up until launching tor where im getting this message:

    May 11 02:07:41.814 [notice] Opening Control listener on 127.0.0.1:9151
    May 11 02:07:41.814 [warn] Could not bind to 127.0.0.1:9151: Cannot assign requested address
    May 11 02:07:41.814 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
    May 11 02:07:41.814 [err] Reading config failed–see warnings above.

    Tor Browser exited cleanly.

    I’ve taken a look at some of the config files but don’t really know what im doing. I’m running kali on virtualbox and already have tor installed on my host. Not sure if that makes if a difference. If its too much of a bother, no worries, but any advice is appreciated. Thanks.

    Reply
    • blackMORE Ops

      Hi 5p412120w,
      I think you’ve installed Vidalia and trying to use TOR via that. In that case change port to 9051.
      For Vidalia try this:

      Settings > Advanced > Tor Control and checked Use TCP Connection (ControlPort) with the address 127.0.0.1:9051

      Another way is to kill tor as TOR daemon was already running which Vidalia didnt like.

      ps aux | grep tor

      Followed by the following command:

      service tor stop

      and then retry.

      Good luck.
      -BMO.

      Reply
  7. The Helpful Mathie

    Does this require firefox? Iceweasel is the default in kali.

    Reply
    • blackMORE Ops

      No it doesn’t require FireFox. You can use ProxyChain to pipe Tor to IceWeasel.

      proxychains iceweasel

      should do it. The benefit of using ProxyChains is that you can use almost any application via that … i.e.

      proxychains chromium(or)proxychains wget

      etc. Cheers,
      -BMO

      Reply
      • aarc2013aarcee

        Hi BMO,
        i could install the TOR for kali linux and the proxychain icweasel.
        i want to recd the target annonymously. how an i be sure that i am behind tor network or proxychain is working. Please tell method to check nad confirm that
        thanks in anticipation
        Happy Hunting

        Reply
        • blackMORE Ops

          http://www.whatismyip.com shows your IP.
          What you’re asking is probably how you can be completely anonymous. There’s no such thing as that! You can however change DNS and MAC (check tor manuals for more) to be somewhat anonymous. Note that tracking is not done based on IP anymore (well, the very basic form of it). Advanced tracking is done using cookies, browsing patterns, common search strings and many more. Also, no matter what you do, you are possibly jumping from one AS area to the next which can be tracked back as most of the backends lives in first world and you know who controls those.

          Reply
      • me

        Don’t do this. If you run Firefox via proxychains DNS queries won’t go over ToR and you’ll burn yourself. Use the ToR bundled browser.

        Reply
  8. AnonyX

    how to install vidalia

    Reply
    • blackMORE Ops

      apt-get install vidalia should do the trick…

      Reply
  9. mr.man

    When i enter tar -xvzf tor-browser-gnu-linux-x86_64-2.3.25-16-dev-LANG.tar.gz, it say that the file does exist. I put the newer version of the code in, but it still says that the file doesn’t exist.

    Reply
  10. Jeremy

    When I input the following command:

    apt-get install deb.torproject.org-keyring

    I get the following output:

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package deb.torproject.org-keyring.gpg
    E: Couldn’t find any package by regex ‘deb.torproject.org-keyring.gpg’

    I’ve been searching online, but I can’t find a good answer
    I’m running Kali v1.0.8 in VirtualBox v4.3.20

    Reply
    • blackMORE Ops

      This might help.
      Fixing error: Package packagename is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package ‘packagename’ has no installation candidate

      Reply
      • Jeremy

        I just finished trying this, but unfortunately I ended up with the same result in the end

        Reply
  11. Don

    Trying to update the repo. On the Tor site, it says to:

    Add this line to your /etc/apt/sources.list file:

    deb http://deb.torproject.org/torproject.org main

    Above you call it wheezy. is that still the proper DISTRIBUTION as of January- 2015?

    Reply
  12. Sebastian Kurz

    root@sebakurz-imac:/home/sebastiankurz# tar -xvzf tor-browser-gnu-linux-x86_64-4.0.3_de.tar.xz
    tar (child): tor-browser-gnu-linux-x86_64-4.0.3_de.tar.xz: The open ended with error: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    And so with all the downloaded files: tar.gz and tar.xz!!! The same result of such actions is happening with other files: jdk-8u31-linux-x64.tar.gz, install_flash_player_11_linux.x86_64.tar.gz, Adwaita-Cupertino-G34.tar.gz, 165894-Zorba-black.tar.gz and others in this format.
    My main question is: CAN, all of these files must be installed in the root directory? And only then do they decompress in a directory for the same – root?
    I put out all the action on behalf of the Administrator: sudo su. Tell me – what is my fault ?! In addition to a clean installation of individual programs – everything else that was described in your article, did not work!
    I ended up out of nowhere and decided to try to find an answer to mapabout IN RUSSIAN. They have, in Russian, that you describe the whole year – put 5 sekunt, and everything works! Following their advice and recommendations on the Russian forums, I began to understand the Kali much faster and easier! Why in your articles so all is not clear ??? Maybe this is a Google-translated? My native language is German. Machine translation and online in a browser so corrupts the truth ?! I do think that your instructions first translated into the language of abborigens Australia, then – the Jewish, and only then – in English, because that is how they are presented to management – can be understood only couple in love orangutans, at the time of their wedding coverings!!!

    Reply
    • sachin

      tar -xvJf tor-browser-gnu-linux-x86_64-4.0.3_de.tar.xz
      this should work

      Reply
  13. canadianht

    root@kali:~/debian-packages/tor-0.2.4.24# debuild -rfakeroot -uc -us dpkg-buildpackage -rfakeroot -D -us -uc
    dpkg-buildpackage: warning: using a gain-root-command while being root
    dpkg-buildpackage: source package tor
    dpkg-buildpackage: source version 0.2.4.24-1
    dpkg-buildpackage: source changed by Peter Palfrader
    dpkg-source –before-build tor-0.2.4.24
    dpkg-buildpackage: host architecture i386
    dpkg-checkbuilddeps: Unmet build dependencies: quilt libssl-dev libevent-dev (>= 1.1) asciidoc (>= 8.2) docbook-xml docbook-xsl xmlto dh-apparmor
    dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
    dpkg-buildpackage: warning: (Use -d flag to override.)
    debuild: fatal error at line 1357:
    dpkg-buildpackage -rfakeroot -D -us -uc failed


    i have this error -_-

    Reply
  14. Smokey DeVille

    Ok, I think I am having the same issue that Sebastian was (with installing the TOR Bundle, he seems to have other issues beyond that). Here is Kali gives me:

    root@kali:~/Desktop# tar -xvzf tor-browser-gnu-linux-i686-2.3.25-15-dev-LANG.tar.gz
    tar (child): tor-browser-gnu-linux-i686-2.3.25-15-dev-LANG.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now

    The package is on my desktop, I downloaded it straight from teh TOR website, would you happen to know how I can fix this?

    Greatly appreciated.

    Reply
    • kajokole

      cd Desktop

      Reply
      • kajokole

        Lang change to language u download for example en-US

        Reply
        • Trying

          it gives me the same error even after i put in cd Desktop and changed Lang to en-US

          Reply
    • sachin

      tar -xvJf tor-browser-gnu-linux-x86_64-4.0.3_de.tar.xz
      this should work

      Reply
  15. 6h0s7ca7

    Hello I attemptedmm what you proposed but this was the result I got:
    root@kali:~# apt-get install tor
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    tor is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.
    root@kali:~# tar -xvzf tor-browser-gnu-linux-i686-2.3.25-15-dev-en-US.tar.gz
    tar (child): tor-browser-gnu-linux-i686-2.3.25-15-dev-en-US.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now

    Reply
  16. Catzklawz

    you have to extract the archive and run the set-up. Peeps skipped that step that’s what throws the “child” error

    Reply
    • Trying

      how ? sry im new to this

      Reply
  17. Test41

    Where is these lines, there’s no such lines into this file.

    Reply
  18. kali

    Don’t start this as root, it’s a horrible idea. Instead make a new user

    root@kali:~# useradd fuckboy
    root@kali:~# chown -R fuckboy tor-browser_en-US # Replace with your TBB folder
    root@kali:~# gksu -u fuckboy tor-browser_en-US/Browser/start-tor-browser

    And it will run, not as root.

    Reply
  19. DrWashington

    adding non-kali repositories to kali can crashed you system. Why are you recommend add this ?

    Reply
  20. Abhi

    Unable to install tor because of following error

    root@Abhi:~# apt-get install tor
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    tor : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
    E: Unable to correct problems, you have held broken packages.

    Reply
  21. sponky

    try to use option 2, i get this when i reach the step to type “apt-get install tor”

    The following packages have unmet dependencies:
    tor : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
    Recommends: tor-geoipdb but it is not going to be installed
    Recommends: torsocks but it is not installable
    E: Unable to correct problems, you have held broken packages.

    Reply
  22. Bl4ck0ut

    ok so im on kali 2.0 and this is what happens right after i type apt-get install TOR using the second install method. I am also new to kali but its a must have as is Tor.

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    tor : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
    Recommends: tor-geoipdb but it is not going to be installed
    Recommends: torsocks but it is not installable
    E: Unable to correct problems, you have held broken packages.

    Reply
    • standard

      is this you? fight for freedom? its standard here :D

      Reply
  23. 0x4bdull4H

    Hi blackMORE Ops,

    Great tuts, I found a problem where I can’t add the gpg key
    #gpg –keyserver keys.gnupg.net –recv 886DDD89

    Kali gives me this”
    gpg: keyserver receive failed: No keyserver available

    I tried this

    #gpg –keyserver keys.gnupg.net –recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89

    ==> from torproject official page but it seems this also doesn’t work!! ==> it shows this:
    gpg: keyserver receive failed: Server indicated a failure

    what to do ?!!

    Reply
  24. 美剧天堂网

    very good,is very cool

    Reply
  25. yusuf

    When i say
    tar -xvzf tar -xvzf tor-browser-gnu-linux-x86_64-2.3.25-16-dev-en-US.tar.gz

    it says
    tar: Multiple archive files require ‘-M’ option
    Try ‘tar –help’ or ‘tar –usage’ for more information.

    please help

    Reply

Leave a Reply. (Anonymous comments allowed). Use WP, Twitter, FaceBook or Google+ for faster responses.Cancel reply

Recent Comments

  • lundgren@byu.net: Thank you!!...
  • Pete: Hello BMO fans. I made a mistake while installing Kali 2.0 64bit!!! on a USB 3.0...
  • Bob Kodadek: Alex didn't do anything of the kind! Alex stole the article and "PL2303_64bit_ I...
  • Destiny: Nice work there But my step 3 of installing gbedi did not go through as it gave...
  • FrostyLeaf: Black screen with "-".... Please help...

Recent Posts

  • Fix Java error Unsigned application requesting unrestricted access to system - blackMORE Ops

    Fix Java error Unsigned application requesting unrestricted access to system

    June 8, 2017
  • hpssacli command on ESXi and adding new Disk to ESXi host

    hpssacli command on ESXi and adding new Disk to ESXi host

    June 6, 2017
  • USB and SSD drive speedtest in Linux - blackMORE Ops - 11

    USB and SSD drive speedtest in Linux

    April 4, 2017
  • Apple Ransom

    Pay the Ransom or Face the Music – Hackers Threaten Apple Over iCloud Compromised Accounts

    March 24, 2017
  • Fix for Prolific USB to Serial RJ45 Ethernet Code 10 error - blackMORE Ops - 12

    Fix for Prolific USB to Serial RJ45 Ethernet Code 10 error

    March 23, 2017