You can run Kali Linux on any platform that supports Docker

May 29, 2015 01:25 GMT  ·  By

At the request of many users, the Kali Linux developers are proud to announce the immediate availability of Docker images for the Kali Linux operating system, helping users run Kali on various OSes.

With the official Kali Linux Docker images, which include a minimal Kali Linux 1.1.0a base, you can easily run the best penetration testing distribution on almost any platform, including Mac OS X, SUSE, Gentoo, CentOS, RackSpace, and Azure.

Docker is a revolutionary, open-source software solution that lets system administrators and application developers package, distribute and run apps in virtual containers, anywhere, without too much of a hassle.

To get started, you will need to install the latest version of the Docker software on your operating system of choice. Once Docker is successfully installed and configured, you can use the following commands to fetch the Kali Linux images from the Docker repository and run the penetration testing distro.

code
docker pull kalilinux/kali-linux-docker
docker run -t -i kalilinux/kali-linux-docker /bin/bash
apt-get install metasploit

Building your own Kali Linux Docker images is easy

Additionally, the Kali Linux developers were kind enough to provide detailed instructions on how to create your very own Kali Linux Docker images. All you have to do is paste the following code in a build.sh file, make it executable, and run it on a terminal emulator. Easy as pie!

code
#!/bin/bash
# Install dependencies (debbootstrap)
sudo apt-get install debootstrap
# Fetch the latest Kali debootstrap script from git
curl "http://git.kali.org/gitweb/?p=packages/debootstrap.git;a=blob_plain;f=scripts/kali;hb=HEAD" > kali-debootstrap &&\
sudo debootstrap kali ./kali-root http://http.kali.org/kali ./kali-debootstrap &&\
# Import the Kali image into Docker
sudo tar -C kali-root -c . | sudo docker import - kalilinux/kali &&\
sudo rm -rf ./kali-root &&\
# Test the Kali Docker Image
docker run -t -i kalilinux/kali cat /etc/debian_version &&\
echo "Build OK" || echo "Build failed!"