This guide details how to get a kali linux docker container set up with the full kali linux tool suite. It can be
There might be a better way of doing this, but this is pretty rock solid and just requires docker and zsh
kali
starts and attaches to the already existing docker container
re-kali
(re)creates the container using docker compose
de-kali
deletes ALL existing kali instances
You can use a simple docker rm to remove individual instances
- Docker pull the kali linux image
- Start the docker container like normal with an interactive bash shell
- Run
sudo apt install kali-linux-large
to download the kali tool suite (~11 GB) - IMPORTANT: Setup a new account (I called mine
kali
, creative I know) with the SAME uid and gid as your host user otherwise you'll get issues with permissiones on shared volumes. - ALSO: Set a password for both your
root
andkali
accounts. Make sure to add your new user to the sudo group - Exit out and stop the container. Then use
docker commit
to save the container volume as an image - In your home directory, create a kali folder and put the
docker-compose.yml
inside there - Copy the aliases into your
.zshrc
file then usesource ~/.zshrc
or restart your terminal - Call
re-kali
thenkali
and you should have a kali container to start failing at HTB machines with!
If your fancy you can also set the new users home directory as the volume directory but that requires a bit of fiddling with moving all current files intop the data
folder, modifying the compose file and finally re-committing the image again