DEV Community

Cover image for Kali Linux Inside Docker
bob.ts for Leading EDJE

Posted on • Edited on

Kali Linux Inside Docker

Kali Linux

I went to a talk recently on security. Kali Linux was mentioned and I started looking at what this meant.

I was thinking of setting up a machine to explore when a co-worker mentioned building a Docker Container with Kali Linux inside it. With some quick searching I found that they already had Kali Linux dockerized ... I settled on the "ROLLING" version.

THIS ARTICLE IS INTENDED PRIMARILY FOR MYSELF.

Here are the abbreviated notes I put together ...

From ... Kali Containers Docker

Docker Installation and Update

$ docker pull kalilinux/kali-rolling

$ docker run -ti --rm -v /Users/bob.fornal/Projects/pentest/root:/root -v /Users/bob.fornal/Projects/pentest/postgres:/var/lib/postgresql kalilinux/kali-rolling /bin/bash

# apt-get update && apt-get install metasploit-framework

The steps from this point forward should be re-run each time you start Kali Linux in this Docker Container (the run command below).

# apt update

# apt upgrade

# apt dist-upgrade

# apt autoremove

# apt clean

Tooling (that I still need to explore in more detail)

# msfconsole

Commit Changes from Update Above

Image Information

$ docker ps -l

$ docker images -a

Commit Commands

$ docker commit [id] kalilinux/kali-rolling

$ docker run -t -i kalilinux/kali-rolling /bin/bash

Conclusion

These notes are kind of rough and based on much of my exploration. They will be updated as I learn more or change the process.


Smart EDJE Image

Top comments (2)

Collapse
 
instinct profile image
Instinct

But, will all the functionalities of Kali Linux be avaiable inside a docker container?

I think there would be problems with the networking.

Collapse
 
rfornal profile image
bob.ts

I haven’t explored in depth. I did find one or two minor things that didn’t like the setup; generally related to GUI ... but, so far no issues with features. Additionally, networking seems to work fine. I may change that opinion over time ... seems good for now.