Saturday, September 23, 2017

Installing Kali Tools on Windows 10 Subsystem for Linux

If you haven't been keeping up with the times, let me learn ya a little sumpin' sumpin'.  There is meow a bash/linux/Ubuntu environment in Windows 10.  I've played with it a little thus far and have been pretty impressed.  For one reason or another, if you're a security practitioner, you may be interested in Kali tools for the sweet, new Subsystem for Linux in Windows.  While there are still some bugs, it's still fun to play with.  I've broken down the instructions to get Kali's tools up and running on the environment, which is Ubuntu-flavored.  The instructions are in layman's terms for those of you that may not be as experienced, but want to learn anyways. Also, the instructions are brief to cut straight to the chase.  As general overview, what needs to happen is: enable the subsystem, turn on developer mode, update the system, and lastly, use Katoolin to install Kali tools.

Before beginning, make sure your Windows 10 build is on the latest build and up-to-date.

Enable the Windows Subsystem for Linux
From the Windows Menu Type Powershell, right click the Powershell icon and select "Run as Administrator", then run the following command to enable the subsystem

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux 

After, perform the requested reboot.

Turn on Developer Mode in Windows
From the Windows Menu,
1. Type Settings and click to open the control panel
2. Select Update & Security 
3. On the next screen, left side, select "For Developers"





















Enter the Bash Environment
1. Type "bash" and hit enter.  Boom! You're in!


Installing Kali tools
You'll want to use the Katoolin script that automates the install of Kali tools on an Ubuntu distro, which is what the bash environment is based on.

Install the Git client and Update
This should now be installed by default, but if it's not for whatever reason, do it manually.
1. sudo apt-get install git 
2. sudo apt-get update

Install Python
Oddly enough, Python wasn't installed on my initial install. You'll need it for Katoolin (let alone Kali).

sudo apt-get install python

Download (clone) the Katoolin package/script
1. sudo git clone https://github.com/LionSec/katoolin.git

As an optional step/side note, if you intend to run Katoolin in the future for update purposes, you can copy it to the /usr/bin directory.

   a. sudo cp katoolin/katoolin.py /usr/bin/katoolin

   Make it executable
   b. sudo chmod +x /usr/bin/katoolin

Running Katoolin 
Once you've successfully cloned Katoolin, change into the katoolin directory and make the katoolin.py script executable.
Note: the katoolin directory is in the directory you were in when you performed the clone command.

1. cd katoolin
2. chmod +x katoolin.py
3. python katoolin.py

You should have this pretty screen:



4. Type 1 and hit enter to select "Add Kali repositories & Update".  
5. Type 1 and hit enter again to select "Add kali linux repositories"


From here, there's a menu option to view your sources.list, which is where the script adds your Kali repository.  Alternatively, you can run 

cat /etc/apt/sources.list and you should see the following lines added:

# Kali linux repositories | Added by Katoolin
deb http://http.kali.org/kali kali-rolling main contrib non-free

Note: If you run the Katoolin script multiple times, it doesn't check to see if it has already updated the file.  It blindly drops another round of lines, which will throw some warnings when you update, but won't mess anything up.

Sweet! You've added the repos, which will allow you to update the Kali tools over time. 

6.  Type "back" and hit enter to return to the main menu.  
7.  Type 2 and hit enter to select "View categories"
8.  You can pick and choose, what packages you want to install, but I went ahead and nuked the site from orbit and selected 0 to install all. Why would you not?

By this point everything should be installing.  It'll take a while to get everything installed:


Whammy! You're done!

An extra note:  I tested a few tools and they worked.  Others didn't.  Nmap for example, didn't :( I haven't had the chance to dig in and figure out exactly why.  I'm sure there's still a lot of porting that needs to happen, but this is an awesome start!

I hope this was helpful.  If you come across any issues, please be sure to drop a comment and I'll update the instructions accordingly.  

1 comment: