How to set up Kali Linux in Docker?

DOCKER

A tool to create, deploy and run applications by using containers.

Docker is a set of the platform as service products that use OS virtualization to deliver software in containers. A Docker container image is a lightweight, standalone, executable package of software that has everything you need to run an application like code, runtime, system tools, system libraries, and settings.

Docker is very convenient platform as a service as it is available for every device now like laptop, Desktop, Raspberry pi, Linux, etc.

Install Docker

Uninstall old version of Docker if you have:

sudo apt-get remove docker docker-engine docker.io

Install latest version of Docker:

sudo apt-get install docker-ce

For installing Docker in Raspberry Pi, use the following command:

sudo apt-get install --no-install-recommends docker-ce

Note:

If you get aufs-dkms package error while installing Docker on Raspberry pi use –no-install-recommends switch to resolve this issue by not installing aufs-dkms package, that anyways is not much needed.

Configure Docker APT repository (Required)

echo 'deb [arch=amd64] https://download.docker.com/linux/debian buster stable' | sudo tee /etc/apt/sources.list.d/docker.list

For configuring in Raspberry Pi 32-bit:

echo 'deb [arch=armhf] https://download.docker.com/linux/debian buster stable' | sudo tee /etc/apt/sources.list.d/docker.list

For configuring in Raspberry Pi 64-bit:

echo 'deb [arch=arm64] https://download.docker.com/linux/debian buster stable' | sudo tee /etc/apt/sources.list.d/docker.list

STEPS TO SET UP KALI LINUX IN DOCKER

Note: Following steps will be same for installing kali linux in raspberry pi with Docker also.

1) Sign in to Docker account.

2) Get Docker Desktop application suitable for your system with steps above.

3) Go to terminal type:-

docker pull kalilinux/kali-linux-docker

This will download and install the docker image.

4) Run Kali Linux image with the following command:-

docker run -t -i kalilinux/kali-linux-docker /bin/bash

This will start a reverse shell with this image. and you will get the command line control of Kali Linux.

5) Update all packages database of Kali Linux.

apt-get update

If there is a new version of the package available. apt-get will download this information (not the package itself).

6) upgrade all the packages that are already installed.

sudo apt-get dist-upgarde

It looks for dependencies with the newer version of the package being installed and it tries to install new packages or remove existing ones on its own.

Necessary software for penetration testing

1) Install the necessary tools for cyber forensics:-

sudo apt update && sudo apt install kali-linux-foresic

2) Get top 10 tools meta-package of Kali Linux with following command:-

sudo apt update && sudo apt install kali-linux-top10

Now get your hands on to real Tools.

Penetration testing is considered one of the best cybersecurity careers at this point in time. If you are playing this I think you are a cybersecurity enthusiast. So, Click the link and Now get hands-on to the real-world tools.

3) Get only password cracking tools:-

sudo apt update && sudo apt install kali-linux-pwtools

4) Tools related to website penetration testing:-

sudo apt update && sudo apt install kali-linux-web

5) Tools for wireless network penetration testing:-

sudo apt update && sudo apt install kali-linux-wireless

All other bundles can be found by clicking this button:-

Some of Docker important commands

Here are some of the commands that you will need while running Docker.

  • docker images – Shows you all images present in the registry.
  • docker run – Runs a command in a new container.
  • docker start – Starts the stopped containers.
  • docker stop – Stops running containers.
  • docker build – Builds an image form a Docker file.
  • docker pull – Pulls an image or a repository.
  • docker push – Pushes an image or a repository to a registry.
  • docker export – Exports a container’s filesystem as a tar format.
  • docker exec – Runs a command in container.
  • docker search – Searches the Docker Hub for images.
  • docker attach – Attaches to a running container.
  • docker commit – Creates a new image from a container’s changes.

Have a comment on this story? Please click “Add Your Comment” below. If you’d like to contact cybercrip’s editors directly, send us a message.

Leave a Reply

Your email address will not be published. Required fields are marked *