-
Book Overview & Buying
-
Table Of Contents
Kali Linux Intrusion and Exploitation Cookbook
By :
I think a little about is justified here. Docker is a new open source container technology, released in March 2013 that automates the deployment of applications inside self-sufficient software containers. Docker (built on top of Linux containers) provides a much simpler way of managing multiple containers on a single machine. Think of it as a virtual machine but it is more lightweight and efficient.
The beauty of this is that you can install Kali Linux on almost any system, which can run Docker. Let's say, for example, you want to run Kali on Digital Ocean droplet but it does not let you spin-off a Kali Linux directly like it does for Ubuntu. But now, you can simply spin-off Ubuntu or centos on digital ocean and install Docker on it and pull the Kali Linux Docker image and you are good to go.
Since Docker provides another layer of abstraction, it is beneficial from security standpoint as well. Let's say, if you are running an apache server that is hosting an application, you can simply create a Docker container for this and run it. Even if your application gets compromised, the attacker would be self-contained within the Docker image only and will not be able to harm your host operating system.
Having said all that, now with installing Docker on your machine, for the purpose of demonstration we will be installing Docker on a Mac operating system.
For this recipe, you will need the following things:
Perform the following steps for this recipe:
Applications | Docker | Docker Quickstart Terminal.app or open the Launchpad and click on Docker Quickstart, When you double-click on the application, you will see the terminal as shown in the following screenshot:

docker run hello-world
You will see the following output if your installation succeeded:

Kali Linux image, as shown in the screenshot:

docker pull kalilinux/kali-linux-docker docker run -t -i kalilinux/kali-linux-docker
kali Metasploit image on the hub and install the one with the highest number of pulls so far, as shown in the screenshot:

docker pull linuxkonsult/kali-metasploit
docker run command as shown:
docker run -t -i linuxkonsult/kali-metasploit
The will be as shown in the screenshot:

Once the framework is prepared it is unpacked and executed, it should look as follows:

As you can see, you have Metasploit updated and running. But this is not it; all the changes you have made are not permanent, until you commit the changes. Once you commit the changes, you can pick up next time from where you left off. To commit the changes, open another console window and type the command:
docker ps

docker commit <docker-id> <docker-name> docker commit bd590456f320 admiring_pike
On successful commit, you will see the following output:
b4a7745de59f9e106029c49a508c2f55b36be0e9487dbd32f6b5c58b24fcb57
In this recipe, we need Virtualbox already installed as a prerequisite, and we downloaded and installed the Docker toolbox. Once Docker toolbox is installed, simply open the Docker Quickstart Terminal.app and pull the image you want to run, you can search for the desired image from
https://hub.docker.com
and use the docker run command to run it. Once you have performed your operations, simply commit the changes with the docker commit command.
Here, we have used the -i and -t switches. For interactive processes (such as a shell), you must use -i
-t together in order to a teletype (TTY) for the container process. The-i
-t switches is often written -it.
You can learn more about at https://www.docker.com . To search for images, you can visit https://hub.docker.com . To install Linux meta-packages, you can visit https://www.kali.org/news/kali-linux-metapackages/ .
Change the font size
Change margin width
Change background colour