Skip to content

kCTF Learnings

Quintin edited this page Mar 13, 2023 · 6 revisions

First it is recommended to get used to kctf by running it locally. Follow the instructions here: https://google.github.io/kctf/local-testing.html

Then install the gcloud SDK. On Ubuntu 20.04 I was able to do:

sudo apt-get install apt-transport-https ca-certificates gnupg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-cli google-cloud-sdk-gke-gcloud-auth-plugin kubectl

Follow the guide here: https://google.github.io/kctf/google-cloud.html

Useful Commands

kctf cluster stop Shuts down the current cluster. This takes a while on GCloud.

kctf chal start Use when you are in a challenge directory (e.g. there is a challenge.yaml present) to build the Docker containers and roll out a new version.

kctf chal list Lists all challenges. It finds them by looking for directories with challenge.yaml

kctf cluster create local-cluster --start --type kind Create a local cluster for testing (fast).

kctf cluster create --project <GCloud project ID> --domain-name <name>-codelab.kctf.cloud --start remote-cluster

Clone this wiki locally