To use the Kali Linux Docker image, we will do the following commands:
kali@kali:~$ docker pull docker.io/kalilinux/kali-rolling
kali@kali:~$
kali@kali:~$ docker run --tty --interactive kalilinux/kali-rolling
┌──(root㉿e4ae79503654)-[/]
└─#
┌──(root㉿e4ae79503654)-[/]
└─# exit
kali@kali:~$
Please note, that this does not allow for systemd functionality, which would allow access to items such as systemctl. There are ways to get systemd to work with Docker, however they include modifying the Dockerfile and docker run flags. At this time this will not be covered.
Please also note, all the images below do not come with the “default” metapackage. You will need to apt update && apt -y install kali-linux-headless.
To resume an exited container we will complete the following:
kali@kali:~$ docker container list --all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d36922fa21e8 kalilinux/kali-rolling "/bin/bash" 2 minutes ago Exited (0) About a minute ago lucid_heyrovsky
kali@kali:~$
kali@kali:~$ docker start d36922fa21e8
kali@kali:~$
After you execute the following command you will attach to the Docker container, however you must press return once to fully see the prompt.
kali@kali:~$ docker attach d36922fa21e8
┌──(root㉿d36922fa21e8)-[/]
└─#
This will resume the container in whatever state you left it after running the initial docker run command or the last docker start and docker attach sequence.
Finally, if you’re done with the container you can remove it with the following command:
kali@kali:~$ docker rm d36922fa21e8
d36922fa21e8
kali@kali:~$
Podman has very nice documentation on how to install it on various systems. We recommend to follow the official documentation, however for a Debian-based system it is a very simple command:
kali@kali:~$ sudo apt update && sudo apt install -y podman
...
kali@kali:~$
The Kali images are in the containers shortnames list. This allows the functionality of only calling kali-rolling, rather than using the full image name docker.io/kalilinux/kali-rolling. This works if the host system provides an up-to-date shortnames list in /etc/containers/registries.conf.d/shortnames.conf. As we are using Kali Linux, which does, we can utilize this functionality.
To use the Kali Linux Podman image, we will do the following commands:
kali@kali:~$ podman pull kali-rolling
kali@kali:~$
kali@kali:~$ podman run --tty --interactive kali-rolling
┌──(root㉿7df5f0dbe6b7)-[/]
└─#
┌──(root㉿7df5f0dbe6b7)-[/]
└─# exit
kali@kali:~$
Please note, that this does not allow for systemd functionality, which would allow access to items such as systemctl.
Please also note, the images do not come with the “default” metapackage. You will need to apt update && apt -y install kali-linux-headless.
To resume an exited container we will complete the following:
kali@kali:~$ podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7df5f0dbe6b7 docker.io/kalilinux/kali-rolling:latest /bin/bash 2 seconds ago Exited (0) 1 second ago cool_tharp
kali@kali:~$
kali@kali:~$ podman start 7df5f0dbe6b7
kali@kali:~$
After you execute the following command you will attach to the Podman container, however you must press return once to fully see the prompt.
kali@kali:~$ podman attach 7df5f0dbe6b7
┌──(root㉿7df5f0dbe6b7)-[/]
└─#
This will resume the container in whatever state you left it after running the initial podman run command or the last podman start and podman attach sequence.
Finally, if you’re done with the container you can remove it with the following command:
kali@kali:~$ podman rm 7df5f0dbe6b7
7df5f0dbe6b7
kali@kali:~$
设置kail源 vi /etc/apt/sources.list #中科大 deb mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib deb-src mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib #阿里云 deb mirrors.aliyun.com/kali kali-rolling main non-free contrib deb-src mirrors.aliyun.com/kali kali-rolling main non-free contrib #清华大学 deb mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free deb-src mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free #浙大 deb mirrors.zju.edu.cn/kali kali-rolling main contrib non-free deb-src mirrors.zju.edu.cn/kali kali-rolling main contrib non-free #东软大学 deb mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib deb-src mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib #官方源 deb http.kali.org/kali kali-rolling main non-free contrib deb-src http.kali.org/kali kali-rolling main non-free contrib #163 deb mirrors.163.com/debian/ jessie main non-free contrib deb mirrors.163.com/debian/ jessie-updates main non-free contrib deb mirrors.163.com/debian/ jessie-backports main non-free contrib deb-src mirrors.163.com/debian/ jessie main non-free contrib deb-src mirrors.163.com/debian/ jessie-updates main non-free contrib deb-src mirrors.163.com/debian/ jessie-backports main non-free contrib deb mirrors.163.com/debian-secu… jessie/updates main non-free contrib deb-src mirrors.163.com/debian-secu… jessie/updates main non-free contrib