Hacking coming from a host machine without any form of proxying is usually reckless for a hacker, in addition to in a penetration test, could lead to an important IP address becoming quickly blacklisted by the target. By routing all traffic over Tor in addition to reducing the threat of malicious entrance in addition to exit nodes that has a VPN, we can configure Kali to become thoroughly private in addition to anonymous.
Running Kali Linux in a virtual machine can be an ideal hacking platform for launching attacks, nevertheless is usually only as anonymous or private as the connection used. Tor is usually an effective traffic obfuscation network, in addition to while Tor Browser alone cannot support a hacker’s behavior, we can use Whonix to route the entirety of our Kali Linux traffic over the Tor network.
Finally, in order to add a further level of anonymity, we can combine a VPN with Tor in order to further obfuscate our host traffic in addition to prevent against Tor Deanonymization Attacks.
Step 1: Gathering Prerequisites
VirtualBox is usually used for all virtualization within This particular tutorial. that will runs on Windows, OS X, in addition to is usually available inside the repositories of most Linux distributions. that will can be downloaded coming from here, or that will can be installed on a Debian-based Linux distro such as Kali with the following command.
sudo apt-get install virtualbox
In order to virtualize Kali, we’ll need a Kali disc image. We can download that will here, choosing the correct architecture (32- or 64-bit) in addition to the desktop environment of our choice. “Kali 64 bit” should work for most users.
Whonix provides an OVA file which can be opened in addition to configured within VirtualBox. We only need the Gateway image, as we will be using Kali as our workstation rather than the Whonix Workstation environment. The Whonix-Workstation file can be downloaded here.
Finally, you’ll need a VPN service to be able to route traffic over the VPN before entering the Tor network. We recommend Private Internet Access’s VPN service, however, there are many various other free in addition to paid VPN services available online.
When choosing a VPN, that will’s best to consider the general trustworthiness of the service, the location of their servers, as well as their stated policies regarding data in addition to metadata logging. PIA features a stated policy of not keeping logs, nevertheless no server outside of one under a user’s own control can ever be assumed to be completely trustworthy.
With all of the prerequisites prepared, we can begin configuring our virtualized environment.
Step 2: Configuring Whonix in VirtualBox
With VirtualBox open after completing that will’s installation, first select the “File” menu in addition to click on “Import Appliance.”
Click the folder icon on the right to “Choose a Virtual Appliance File to Import” in addition to to open a file browsing menu.
Browse to the Whonix Gateway OVA file which was previously downloaded, select that will, in addition to click “Next.” After This particular, click “Import” to initiate the configuration of the Whonix Gateway virtual machine.
The License Agreement must be agreed to by clicking “Agree” in order to continue the configuration process. After completing This particular process, VirtualBox should look something like the image below, that has a Whonix Gateway virtual machine available inside the left pane of the window.
The steps for configuring the Kali virtual machine within VirtualBox will be similar to the process for configuring the Whonix Gateway. We’ll need to choose a few additional configuration options, in addition to directly point VirtualBox towards our Kali disk image.
Begin by clicking the “fresh” button at the upper left corner of the VirtualBox interface.
inside the next form, choose a descriptive name for your virtual machine, in This particular case “Kali Linux,” in addition to select “Type: Linux” in addition to “variation: Linux 2.6 / 3 / 3.x / 4.x (64-bit)”
inside the next step, allocate the amount of memory you would certainly like for the virtual machine to access. At least 1024 MB, or 1 GB, is usually recommended. On hardware with more RAM, a larger allocation could lead to more effective performance.
Then choose “Create a virtual hard disk right now.”
Select VDI or “Virtual Disk Image” in addition to “Dynamically Allocated.”
Lastly, allocate the amount of space you are willing to provide for the Kali virtual machine.
Keep in mind that will This particular limit is usually based on the maximum size the VM will be allowed to take up on your hard drive, in addition to not necessarily the amount of space which that will will actually take up.
The size of the virtual machine is usually more likely to correlate more closely to the size of the disc image, or ISO file, which the VM boots coming from.
Finally, after clicking “Create” the Kali virtual machine should appear inside the left pane, along with the previously configured Whonix Gateway VM.
After the virtual machine has been added, we can run that will by pressing the start button with our Kali virtual machine selected.
Upon booting up the virtual machine, we’ll be prompted to select a virtual drive. At This particular stage, the Kali Linux ISO file should be selected.
After “Start” is usually pressed, a Kali should begin that will’s startup process in addition to open a boot menu.
The virtual machine behaves as if that will were a Kali image being loaded onto any various other piece of hardware, in addition to as such at This particular stage that will can be installed, or run as a live boot. The Whonix in addition to VPN configuration will still function that has a live boot device, in addition to the machine state in addition to configuration can be saved using VirtualBox’s save state function.
Installing Kali onto the virtual machine does, however, provide some benefit. The virtual machine can be booted in addition to rebooted, in addition to with This particular, that will may be easier to save configuration states on the virtual hard drive rather than solely within VirtualBox’s save states. The graphical install works as any various other distro install wizard in addition to should be relatively simple to follow.
After the virtual machine has been installed or booted, the following steps will allow us to configure that will to work with Whonix.
Upon booting our Kali VM, our first action should be to open a Terminal window in addition to update the system.
sudo apt-get update && sudo apt-get upgrade
We’ll update the package registry, in addition to upgrade outdated packages.
After our system has finished updating, we can shut down the system using Kali’s login manager.
First, we’ll want to boot our Whonix virtual machine inside the same way as we started off the Kali VM, by pressing the “Start” button inside the upper left of the VirtualBox window. After initial configuration, in addition to potentially a required reboot of the virtual machine, we should be left with something similar to the window below.
We’ll want to leave This particular open as we configure Kali, as all of Kali’s traffic will be passed through Whonix, in addition to through Whonix over Tor. This particular Tor gateway will only work so long as that will is usually booted in addition to running.
Next, we’ll return to the VirtualBox manager, right-click on the Kali VM, in addition to select settings. Within the setting window, we’ll want to select the “Network” option inside the left pane, in addition to here change “Attached to” to “Internal Network” in addition to select “Whonix” as the “Name” parameter.
After This particular settings change is usually saved by pressing “OK” we can boot our Kali virtual machine back up. Once Kali is usually booted, network activity most likely will not be functional. Before Kali traffic can be routed through Whonix, a few alterations will need to be made to Kali’s networking configuration. First, let’s disable the network adapter using ifconfig.
right now, /etc/resolv.conf will be updated with the correct Whonix nameserver. We can edit This particular in GNU Nano. Nano’s controls are relatively simple, the arrow keys in addition to page up/down keys move the cursor, in addition to keyboard inputs are inserted into the file. To open a nano window, type the following.
We’ll want to add the following to the file, first removing any various other configuration parameters if any are present.
We can write our alterations to the file with Ctrl+O in addition to then exit Nano with Ctrl+X.
The next file we’re going to edit is usually /etc/network/interfaces. We can do so by typing the following.
At the bottom of the file, we’ll want to add the following information in order to define where the virtual network adapter should look for certain network items.
iface eth0 inet static
Again, write our alterations to the file with Ctrl+O in addition to then exit Nano with Ctrl+X.
Finally, we just bring our virtual network adapter back online in addition to traffic should be routed properly by typing the following.
We can check that will our traffic is usually being routed over Tor by going to a page like This particular Tor testing page. If the page confirms we are using Tor, we’ve succeeded in routing all of our Kali traffic over Tor!
Step 6: Adding a VPN
As we are routing all of our traffic within the virtual machine through Tor, we can enclose all traffic leading towards them by adding a VPN, either on the host device which is usually running the virtual machines, or by adding a VPN to our Whonix configuration. that will’s generally easier to add a VPN to the host, nevertheless if we wish to ensure that will all of our traffic is usually enclosed inside the VPN in addition to that will no leakage is usually possible, we may use a tool like VPN Firewall for Linux host systems.
VPN configuration differs according to different operating systems or distros. If your VPN provider offers a configuration file for their VPN, such as an OpenVPN file, you may be able to simply import the configuration.
Private Internet Access’s VPN, for example, provides a Downloads in addition to Support page which explains how to install in addition to configure their VPN on a variety of operating systems.
With all of these anonymity tools configured in addition to a Kali virtual machine, you’re ready to browse in addition to hack privately, securely, in addition to anonymously!
Thanks for reading, if you have any questions, you can ask inside the comments below or on Twitter.