A photo of Mitesh Shah

Mitesh Shah

Linux Enthusiast
System Administrator

Email Skype Github Twitter Google+ Resume Hire Me Keybase LinkedIn Stackoverflow


Overview

Kali Linux and Metasploit With Docker

Install Required Softwares

$ brew cask install dockertoolbox

NOTE!: Make sure you have installed HomeBrew on your system, If you don’t have HomeBrew installed then Click Here to Install HomeBrew

Create Virtual Machine

$ docker-machine create -d virtualbox kali

Export Environment Variables

$ eval "$(docker-machine env kali)"

Setting up a Kali Linux Docker Image

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

Update Kali Linux & Install Metasploit & Other Kali Linux Tools

$ apt-get update && apt-get upgrade

# Install Metasploit Framework
$ apt-get install metasploit

Save the Docker Container

  • To commit(save) changes to your image and continue off where you left next time.
  • First exit your image and get the container id.

Get Docker Container ID

$ docker ps -a
CONTAINER ID        IMAGE                         COMMAND             CREATED             STATUS                          PORTS               NAMES
da943d018ded        kalilinux/kali-linux-docker   "/bin/bash"         10 minutes ago      Exited (0) About a minute ago                       lonely_pas

Save Docker Container ID to An Image Name

# docker commit CONTAINER_ID YOUR_IMAGE_NAME
$ docker commit da943d018ded kali
b6655a1aa241cab87e339cdbc0fc7a81f2791a389e377b445ebd1004f181aff2

Start The Saved Docker CONTAINER

# docker run -t -i YOUR_IMAGE_NAME /bin/bash
$ docker run -t -i kali /bin/bash

Remove Docker Image

$ docker rm $(docker ps -aq)




Post Navigation