How to Install Kali Linux Tools on Ubuntu Using Docker

In the past, Katoolin was a script that helped to install Kali Linux tools on your preferred Linux distribution. It allowed users to add Kali Linux repositories, install Kali tools, and remove them as needed. However, Katoolin is no longer in active development, and using it might lead to compatibility issues on modern systems.

Since Katoolin is no longer maintained, the recommended and modern way to use Kali Linux tools on your distribution is through Docker, which offers an easy and efficient method to install and run Kali Linux tools without making significant changes to your host system.

It provides an isolated environment where you can run penetration testing tools and other Kali utilities without affecting your main operating system.

In this article, we’ll walk you through the process of using Kali Linux tools with Docker, step by step.

What is Docker?

Before diving into how to use Kali Linux tools in Docker, let’s first understand what Docker is and how it works.

Docker is a platform that allows you to run software applications inside containers. A container is a lightweight, portable, and self-sufficient environment that runs applications in isolation from the host operating system.

Containers are faster, more secure, and more manageable than traditional virtual machines because they use the host’s operating system but still provide the necessary environment to run the applications.

Think of a Docker container as a box that holds everything an application needs to run—like libraries, dependencies, and settings. When you run an application in a Docker container, you don’t have to worry about whether it will work with your system or not.

How to Run Kali Linux Tools in Docker

Now that we know why Docker is useful, let’s go through the process of running Kali Linux tools from Docker containers.

Installing Docker in Linux

To use Docker, you first need to install it on your machine, here are the basic steps for installing Docker on an Ubuntu-based system:

sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt install docker-ce

Next, start and enable Docker to start automatically:

sudo systemctl start docker
sudo systemctl enable docker --now

Check the Docker version to ensure it was installed correctly:

docker --version

Pull Kali Linux Tools from Docker Hub

Docker Hub is an online registry where you can find and download Docker images, including those for Kali Linux tools. Many of Kali’s popular tools are available as Docker images, and you can pull them directly to your system.

For example, let’s say you want to use Nmap, a network scanning tool, as a Docker container, you need to download the latest Kali Linux image and then you can run specific tools from inside this container.

sudo docker pull kalilinux/kali-rolling

After pulling the image, you can start using Kali tools inside the container:

sudo docker run -it kalilinux/kali-rolling /bin/bash

Once inside the container, you can use any of the tools available in Kali Linux. For example, if you want to use Nmap, you can type:

nmap --version

This will show you the version of Nmap installed inside the container, and you can start using it as you would on a normal Kali installation.

Running Specific Tools Directly

If you only want to run a specific tool without pulling the whole Kali Linux image, some Kali tools are available as separate Docker images. For example, to run Metasploit Framework using Docker, you can do the following:

sudo docker pull metasploitframework/metasploit-framework
sudo docker run -it metasploitframework/metasploit-framework

This command runs the Metasploit Framework in an isolated container.

Install More Kali Linux Tools

Once you’ve learned how to pull the basic Kali Linux image or individual tools like Metasploit and Nmap from Docker Hub, you might want to install more specific Kali tools as Docker containers.

Before pulling a Docker image for a specific tool, you need to know what it’s called and where to find it. You can either search for the tools manually on Docker Hub, or use the search feature on the Docker CLI.

Here are a few popular Kali Linux tools and their Docker images:

  • Burp Suite – A popular web vulnerability scanner.
  • Aircrack-ng – A tool for wireless network cracking.
  • John the Ripper – A password-cracking tool.
  • Wireshark – A network protocol analyzer.
  • Hydra – A brute-force login cracker.

Alternatively, you can use the Docker CLI to search for images:

docker search kali

This will show a list of Kali-related images available on Docker Hub.

Persisting Data (Optional)

By default, any data you create or modify inside the Docker container will be lost once you stop the container.

To keep your data, you can use Docker volumes to persist it:

sudo docker volume create kali-data
sudo docker run -it -v kali-data:/root kalilinux/kali-rolling /bin/bash

This way, all your data will be stored in the volume, and it will persist even if you stop or remove the container.

After identifying the tool you want to use, the next step is to pull the Docker image called Burp Suite.

sudo docker pull portswigger/burp-suite
sudo docker run -it --rm portswigger/burp-suite
Conclusion

Using Kali Linux tools in Docker containers is a great way to access powerful security testing utilities without the hassle of installing and configuring them directly on your system.

It offers several benefits, including isolation, portability, and ease of use. Whether you are a beginner or an experienced security professional, Docker is a great tool to help you streamline your workflow while maintaining the safety and integrity of your main operating system.

Similar Posts