Torified OS within a Virtual Machine to hide you out exteremly.

Posted: March 15, 2014 in Security/Penetration testing

I am sick and tired of seeing people making threads about shitty VPN’s and how they are a good way to protect yourself when doing not so glamorous things online.

The bottom line is that is wrong. No matter how you look at it, a VPN is not safe to use when doing things related to exploitation.

The method entailed here is simple and should be relatively straight forward that uses a TOR (The Onion Router) gateway which we will tunnel all of your VirtualOS’s traffic through.

Prerequisites:
Virtual Box For Your System ( *Nix / Windows / OS X )
Whonix Gateway ( Sourceforge )
ISO of the Operating System of Choice i.e Windows 7 / Debian / Windows XP

Note: For my example in this guide I am going to give you an example of how to do it with a modified Windows 7 called Tiny7 (Google It). It is Windows 7 stripped down to the bare essentials so that it runs alot faster and alot smoother. The OS is strictly for using webapp epxloitation and not general browsing. I highly recommend you to use this. I will also be showing you how to use Kali Linux with this method.

How-To

The first thing you are going to want to do is acquire Virtual Box. Choose your appropriate system and save / open / run the installation following the steps given to you by the installer.

The next step you are going to take is to download the Whonix Gateway virtual box appliance I linked above. This is basically the gateway that will allow your virtual OS to run it’s traffic through TOR without leaking any data including your legitimate IP.

Navigate to the SourceForge link given and save the file to a location where you can easily access it later.

Note: The correct download is the second option entitled Whonix Gateway. Do not download Workstation as it is just another Linux OS which is tunneled through the gateway.

[Image: 0wovHrP.png]

Now you are going to have to retrieve the ISO of your OS of choice. You can do this either legally by supplying your own disks. Or finding a download online. Of course this only applies to Windows considering most Linux distros are open source and free.Once you have the ISO I suggest creating a folder where you will place the Whonix Gateway and your ISO image in one directory to make it easier.

The next step is to import the Whonix Gateway appliance within Virtual Box. To do this simply open Virtual Box and navigate to File > Import Appliance or Control + I on your keyboard. Now navigate to the directory of your whonix file and select the gateway and import it.

Once finished you are going to want to create your new VirtualOS to use with the TOR gateway. To do this navigate to the NEW button and type the name of your VirtualOS and select the correct operating system you are installing. Set the amount of Ram you wish to use for your OS.

Note: For Tiny7 I allocated 4GB because I have some to spare and it runs perfectly smooth without problems. For Kali I did 1GB and have had no problems.

Next set create the virtual hard drive using the VirtualBox Disk Image selection. I recommend creating a fixed size for moderate speed boost but dynamically allocated works fine as well. Continue through with the creation until it is complete.

Now we must edit some settings on the box to enable the gateway. It is imperative you follow my steps exactly.

Click once on your VirtualOS and choose settings.

From here navigate to System and choose the following settings:
[Image: 5zTIqiG.png]
[Image: N1RkXRd.png]

Next we are going to move on to Storage where you are going to select your ISO of choice:
[Image: hj065sC.png]

After this we move on to Network, where we will choose Internal Network and then select Whonix:
[Image: S00DcjK.png]

Following this move on to the last step of going to USB and UNCHECKING the Enable USB option:

 
[Image: Zz7k1ej.png]

Once finished click OK and launch your OS to install it. Once installed boot into your OS.

Now I will show you the final necessities to getting this to work within the OS itself.

For Windows 7 / XP Users:
The first step we are going to do once inside your new VirtualOS is to go to the search bar and search Network and Sharing Center. Once here you are going to click on the change adapter settings button:
[Image: o0nrzO8.png]
Once inside right click on the LAN connection and navigate to properties:
[Image: D6Uc8Ir.png]

From here we need to select IPv4 and then click Properties and insert the following values:

 
[Image: LSCK41q.png]

The numbers:

IP address Box > 192.168.0.50
Subnet netmask Box > 255.255.255.0
Default gateway Box > 192.168.0.10
Preferred DNS server Box > 192.168.0.10

Click okay and you are good to go!

For Linux users:

The first step is to open a Terminal and issue the following command:

sudo nano /etc/network/interfaces

From the editor we are going to copy and paste the following into our file:

auto lo
iface lo inet loopback

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.12
netmask 255.255.255.0
#network 192.168.0.0
#broadcast 192.168.0.255
gateway 192.168.0.10

Once done Cntrl + X to save hit Y to confirm and then hit enter.

Now we need to do the nameservers so we once again go into Terminal and issue the following command:

sudo nano /etc/resolv.conf

Once into this editor if there is anything in there simply delete it all. Copy and paste the following into the file:

nameserver 192.168.0.10

Once done Cntrl + X to save hit Y to confirm and then hit enter.

Now reboot and you are successfully routing your entire VirtualOS through TOR!

TO ENABLE INTERNET IN THE VIRTUAL OS YOU MUST FIRST RUN THE WHONIX GATEWAY AND LEAVE IT OPEN, THEN RUN THE VIRTUAL OS:
[Image: HfuAwN1.png]

You can ensure you are by going to the following website:

http://check.torproject.org

I have it set as my homepage:
[Image: wxwXsns.png]

 

kthanksbai!

Leave a comment