PentestingDarkWebSites/tor.md

2.9 KiB

Tor can also be used with a lot of different tools. The first thing to do is to get tor installed on your machine, This guide assumes that you will be using a Linux based distro.

Installing tor

apt install apt-transport-https

First thing we should do is install the apt-transport-tor pacage. This command allows all the installed packages to use the libapt-pkg library. This is needed so we can access HTTPS links without getting an error.

Check the offical tor website to make sure that you enter the correct information into the /etc/apt/sources.list file.

The follwing commands could be used to determine what distro your machine is running/

lsb_release -c
cat /etc/debian_version

The website tells us to enter the following lines to the /etc/apt/sources.list file:

deb https://deb.torproject.org/torproject.org trusty main
deb-src https://deb.torproject.org/torproject.org trusty main

You should have GPG already installed, if you dont please install it. Before installing any package, you should always import the packages public key into your key ring. This is so we can sign the package and make sure that it is valid and the legit package. Use the following comamnds to import into your keyring.

curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import

The command above will download torproject's key and import it into your key ring.

gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -

This command will export the key and add it to the systems APT key management utility. This is used by the system to make sure that the package you install are legit and from the creators. Of cource, the devs of the package could of been breached and then the hackers added malicious coden and used the stolen keys to sign it but any decent dev should be safe.

apt update

Now we have to update the machine so that all the stuff we did, can take effect.

apt install tor deb.torproject.org-keyring

Installing this will make sure that the current key is always present on your machine. It will also install tor.

Starting Tor

sudo service tor start

This command will start the tor service.

First thing you should is check to make sure that the service is running.

sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:22 ## see a specific port such as 22 ##
sudo nmap -sTU -O IP-address-Here

Listed above is a list of commands that could be used to check to see if there is any open ports on the machine.

What IP/port to use?

Usually tor uses the IP of 127.0.0.1 and the port 9051

sources