Configuring kali linux to connect to tor trough whonix gateway -Vbox

in #technology7 years ago (edited)

So if you've read this tutorial https://steemit.com/technology/@hallow/installing-kali-linux-in-virtualbox-windows-7-tutorial
you probably already have kali linux installed, you should however install whonix first and then install kali to properly ensure that all your traffic is routed trough whonix even the updates, the only thing you have to do is manually configure the connection in kali's installation and insert the whonix gateway ip address and the rest should automagically work(if it doesn't feel free to ask for help), but i'm going to show you how to connect it if you already have kali linux installed.

Lets get started!!

The first step is to download whonix just go to their website click donwloads and select "linux virtualbox" - https://www.whonix.org/wiki/Download



you must download the gateway to be able to route kali's connection



It will come in a .ova file no big deal, just drag it to virtualbox or double-click it and select the "import" option, and a new machine will appear in virtualbox, you can adjust the settings to your likings and if you're short on ram you can set the gateway to 196 Mb so that it only boots in command line interface only, like a server.... (most of them)

Just start the machine wait until it boots and it will show you some dialog boxes with information that i do recommend you to read, and when it asks you "are you're are ready to enable tor" if it is censored in your area you might want to consider to use a bridge to be able to access the tor network, otherwise just click next dont be scared by the massive ammount of info just read it, understand it and click next :)  (if it gives you an error just click ok it probably needs to update before it is working fine)



This is what Whonix looks like, if you're familiar with linux you will feel like home if not dont worry it's not that hard 



the only thing you need to do is update whonix and change its default passwords you can do this by opening the "Konsole" and typing in by order without quotes and don't copy after "-"

"sudo su" - This gives you administrator privileges the password is changeme but you probably found it already

"passwd" - Changes root password choose something strong...

"passwd user" - Changes user password also choose something strong...

"apt-get update && sudo apt-get dist-upgrade" - This downloads the updates and installs them, before it installs the updates it will show you the packages installed and the space required and you will have to press "Y" and  "Enter" to proceed 


sudo su
passwd
passwd user
apt-get update && apt-get dist-upgrade



you will also need the gateway ip for kali linux to connect so just open a new "Konsole" and type "sudo ifconfig" and remember the "eth1" "inet addr:" it will probably be the same as mine (10.152.152.10) 



now just edit kali's settings as shown in the image below 



and boot it up ... you probably wont have a connection right away, check that the whonix gateway has updated then reboot it and make sure it is connected to tor. And then you will need to edit some files in kali, for that, open the terminal and type the following commands(if you're already root user no need to type sudo su)

"sudo su" - Administrator privileges

"nano /etc/network/interfaces" - nano is a text editor (dont be afraid just because it looks like a terminal just use the arrows to navigate and write like you would on any other text editor) you can use whatever you like i normally use vi but if you're a begginer just use nano or leafpad, /etc/network/interfaces represents the location for the configuration file of the network interfaces as you can probably tell

sudo su
nano /etc/network/interfaces

Now navigate to the end of the file and add the following

iface eth0 inet static
address 10.152.152.11
netmask 255.255.192.0
gateway 10.152.152.10

To save the file when you're done just press "ctrl+x to exit, y to save, Enter to keep the same name for the file"

the "address" should be different from the gateway since it is the IP that kali will have and the "gateway" is the whonix gateway's IP


Next you will want to edit /etc/resolv.conf

nano /etc/resolv.conf

just delete everything and write 

nameserver 10.152.152.10


Now you just have to apply the changes by restarting the interface, just type in terminal 

sudo ifdown eth0
sudo ifup eth0

And you should be connected... To verify it just open the web browser and go to  https://check.torproject.org 


This is what happens if you use google's search engine



To avoid this just use duckduckgo


type in the address bar "about:preferences#search" and change the search engine, simple as that...


As you can probably tell by now your connection will be a lot slower but since you wont be using it to download torrents or watch videos in 4k or use any kind of social media associated with you it will be just fine to run nmap or any other tool across the internet dont use it for LAN it wouldn't make sense....


if whonix somehow isn't connected just run whonix check, it is located in the desktop if you are using GUI or whonixcheck command for CLI 

Hope you enjoyed this tutorial the next one will probably be about browser security and getting to know some basic tools for information gathering...


Conclusion

Well you can probably tell by now that whonix isn't suited for the most common activities on your daily basis but it is really great to simulate attacks on any environment you have set up to expose any major security flaws.

Also whonix doesn't make you fully undectectable or gives you full protection from your own mistakes to better understand this you can read this https://steemit.com/technology/@hallow/online-privacy-and-anonymity-basic-guide-1

also as many know tor's anonymity has been compromised when the fbi "cracked" it by controlling enough relay points so they could watch traffic flow and analyze it.... your ISP does keep logs too so they can tell if you connected to tor, you can use a vpn but more routes = longer loading times

This is really great to access sites blocked on your country just dont blame me if the police come knocking you're responsible for your actions

As Sudo always says 

"With great power comes great responsability" 

Sort:  

Execelent post @hallow thanks for sharing as it will help others.

Thank you!! I just dont understand why code blocks adds so many spaces whenever i edit the post, still trying to figure that out before posting my guide on browser security xD

I'm sure you will figure it out.

super nice post @hallow for Kali - nice work.

Coin Marketplace

STEEM 0.19
TRX 0.12
JST 0.027
BTC 60009.56
ETH 3342.57
USDT 1.00
SBD 2.42