Git Product home page Git Product logo

thmrooms's Introduction

TryHackMe Kubernetes CTF Room Builder

This project is meant to reliably build, test, and deploy a Kubernetes CTF room for TryHackMe.

Description

In 2023 I participated in the TryHackMe Advent of Code Side Quest challenge. I was inspired to take some ideas and concepts there-in and build a way to scalably produce Kubernetes equivalent content to deploy to their platform. What follows is an attempt to do just that.

Getting Started

ssh -l ubuntu <ip> # First time is required to set host fingerprints properly
python3 -m venv .venv
. .venv/bin/activate
pip install ansible
ansible-playbook -i inventory -K -k -u ubuntu base/ansible/k8scluster.yml
#Do things to the host
ansible-playbook -i inventory -K -k -u ubuntu sample-room/ansible/sample-room.yml
#Test room for intended paths
ansible-playbook -i inventory -K -k -u ubuntu base/ansible/pre-deploy.yml

The 50,000 ft view, low system usage and full capabilities of a K8s cluster.

All Up

An example layout of where this project aims to enable a room maker to inject vulnerabilities to be found. This can be made to be very very deep, or very shallow depending on needs. The default outset assumes the VM will largely be off-limits to the user, and they will be sandboxed into the cluster containers while having network access to any internal services.

Level Flow

Dependencies

  • Python
  • Fresh install of Ubuntu 20.04

One K8S Interface

Functional Flow

Base

This folder is responsible for all base components to be deployed into a Ubuntu VM. It sets up QoL, Docker, KubernetesInDocker, ingress-nginx, and a local registry to enable the platform to be airgapped. This can be modified to include additional vulnerabilities by customizing the KinD node images or by adding additional components to the base playbook.

This also includes pre-deploy scripts to clean the system before deploying to THM, a final step to optimize the system, clean dangling log files, and mount user activity to /dev/null.

Sample Room

This room is a basic conceptual room that is not deployed to THM. It is just a proof of concept to show how a room can be built and deployed to THM. It is not meant to be a real room, but rather an example with which to test this project.

thmrooms's People

Contributors

tokugero avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.