Kali Docker environment configuration

Kali Docker environment configuration

https://www.kali.org/docs/containers/official-kalilinux-docker-images/
Kali provides official Kali Docker images , updated weekly on Docker Hub. Therefore, you can easily build your own Kali container based on the images we provide. We provide a number of different mirrors to suit your needs as best as possible, using different source branches and carrying different variants of Kali Linux.
Note that none of the images below come with a "default" metapackage . You need to execute apt update && apt -y install kali-linux-headless.
Here is a quick overview of the various mirrors available (see our branch pages for more details). First are the ones you might want to use:

  • kalilinux/kali-rolling is the main mirror you'll probably want to use, tracking the continuously updated kali-rolling package repository, just like the default mirror.
  • kalilinux/kali-last-release is built from the kali-last-snapshot repository, it keeps track of the latest version release (e.g. 2019.4, 2020.1, etc.) and won't get any updates until the next release.

The following are the steps to download the kalilinux/kali-rolling image, configure the apt source, and download the metapackage:

docker pull kalilinux/kali-rolling:latest
docker run -itd --name kali kalilinux/kali-rolling /bin/bash
docker exec -it kali /bin/bash

# 替换apt源
cat > /etc/apt/sources.list << EOF
deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main non-free contrib
deb-src [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main non-free contrib
EOF

# 可选内容,用于存在代理的环境
# https://askubuntu.com/questions/1095266/apt-get-update-failed-because-certificate-verification-failed-because-handshake
# 使用socks5h协议的代理则可省略该步骤
# touch /etc/apt/apt.conf.d/99verify-peer.conf \
# && echo >>/etc/apt/apt.conf.d/99verify-peer.conf "Acquire { https::Verify-Peer false }"

apt update && apt -y install kali-linux-headless

Guess you like

Origin blog.csdn.net/bigbaojian/article/details/129787008