/kali-ctf

This repository contains the Kali Linux build for Capture the Flag

Primary LanguageDockerfileApache License 2.0Apache-2.0

Description

This repository contains the Kali Linux build for Capture the Flag.

TL;DR

docker volume create kali-ctf >nul 2>&1 & docker exec -ti ctf "/bin/zsh" 2>nul || docker start ctf >nul 2>&1 && docker attach ctf 2>nul || docker run --privileged -ti --name ctf -v kali-ctf:/var/lib/zerotier/ -p 10122:10122 ghcr.io/niapollab/kali-ctf:master "/bin/zsh"

Build Image

docker build --pull --tag kali-ctf .

Build Volume

docker volume create kali-ctf

Build container

Before starting

If you want to use GUI application inside docker container install Alpine before:

  1. Install Alpine from Microsoft Store or:

    winget install --disable-interactivity alpine
  2. Run Alpine.exe

  3. Open DockerDesktop.exe. Goto Settings -> Resources -> WSL Integration, turn on Alpine support and click Apply & restart.

With GUI support

docker create --privileged -ti --name ctf -v kali-ctf:/var/lib/zerotier/ -p 10122:10122 --mount "type=bind,src=\\wsl.localhost\Alpine\mnt\wslg,dst=/tmp" kali-ctf "/bin/zsh"

Without GUI support

docker create --privileged -ti --name ctf -v kali-ctf:/var/lib/zerotier/ -p 10122:10122 kali-ctf "/bin/zsh"

Configure container

Register your own ZeroTier identity

If you want to use your own local network through ZeroTier register identity. It's need for saving identity context through docker containers:

mkdir -p /var/lib/zerotier && zerotier-one -i generate /var/lib/zerotier/identity.secret /var/lib/zerotier/identity.public && chown zerotier-one:zerotier-one /var/lib/zerotier/*

Make volume accessible for Linux local user

  1. Set a custom rights mask for the volume directory:

    setfacl -d -m g::rwx /<volume directory>
  2. Launch the container with flag --user :$(id -g).

Run container

Run ctf.cmd or use command:

docker start ctf & docker attach ctf