How to use Kali linux Through Tor with Whonix Gateway

Introduction

In this tutorial we explain how to use Whonix Gateway as a tor router. You can use any machine even a virtual machine through the gateway. We are going to focus on how to setup kali to use a tor gateway, but you can use any distro you want.

Requirements

To start with this tutorial you need to download kali and whonix isos. You will also need virtualbox. Here you can download all requirements:


Step 1: Install and prepare Kali

Install Kali Linux in Virtualbox. When the kali installation finished, open a terminal an execute:

sudo apt update
sudo apt upgrade 

Halt the VM.

Step 2: Import Whonix Gateway

Import the Whonix Gateway Virtualbox appliance into Virtualbox.

Execute the same commands as before to update the operating system:

sudo apt update
sudo apt upgrade 

Reboot the VM.

Step 3: Network configuration

At this step we are going to connect the kali virtual machine to use whounix. Open Virtualbox network settings for Kali Linux (VM should be stopped). Configure the network adapter to use Internal Network, set the name to Whonix.

Now start Kali Linux and edit network settings, append to the end of the file /etc/network/interfaces the followinf content:

iface eth0 inet static
       address 10.152.152.3
       netmask 255.255.192.0
       gateway 10.152.152.10

Now we are going to change DNS settings to use whounix. To have persistent changes on resolve.conf we are going to install a package that allow us to changed resolv.conf.

sudo apt-get install resolvconf

Now open the file /etc/resolvconf/resolv.conf.d/base and append:

nameserver 10.152.152.10

Restart network with:

sudo ifdown eth0    
sudo ifup eth0

Use the following pages to verify that you Kali VM is using TOR: