Skip to content

Commit

Permalink
update:readmd.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tttturtle-russ authored and mudongliang committed Dec 29, 2023
1 parent 054c329 commit 5baef1f
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,32 @@ Deploy a pwn.college dojo instance!

## Details

The pwn.college dojo infrastructure is based on [CTFd](https://github.com/CTFd/CTFd).
The pwn.hust.college dojo infrastructure is based on [CTFd](https://github.com/CTFd/CTFd).
CTFd provides for a concept of users, challenges, and users solving those challenges by submitting flags.
From there, this repository provides infrastructure which expands upon these capabilities.

The pwn.college infrastructure allows users the ability to "start" challenges, which spins up a private docker container for that user.
The pwn.hust.college infrastructure allows users the ability to "start" challenges, which spins up a private docker container for that user.
This docker container will have the associated challenge binary injected into the container as root-suid, as well as the flag to be submitted as readable only by the the root user.
Users may enter this container via `ssh`, by supplying a public ssh key in their profile settings, or via vscode in the browser ([code-server](https://github.com/cdr/code-server)).
The associated challenge binary may be either global, which means all users will get the same binary, or instanced, which means that different users will receive different variants of the same challenge.

## Dependencies

The only dependency to run the infrastructure is docker, which can be installed with:

```sh
curl -fsSL https://get.docker.com | /bin/sh
```

## Setup

First, clone the repository:

```sh
git clone https://github.com/HUSTSeclab/dojo/ /opt/dojo
```

Now, build the container:

```sh
docker build -t pwncollege/dojo .
curl -fsSL https://get.docker.com | /bin/sh
DOJO_PATH="./dojo"
git clone https://github.com/HUSTSeclab/dojo.git "$DOJO_PATH"
docker build -t pwncollege/dojo "$DOJO_PATH"
docker run --privileged -d -v "${DOJO_PATH}:/opt/pwn.college:shared" -p 22222:22 -p 8080:80 -p 10443:443 --name dojo pwncollege/dojo
```

Finally, run the infrastructure which will be hosted on domain `my.domain.college` with:

```sh
docker run --privileged -d -v /opt/dojo:/opt/pwn.college:shared -p 22222:22 -p 8080:80 -p 10443:443 --name dojo pwncollege/dojo
```
**You can setup dojo using [setup.sh](https://github.com/HUSTSeclab/dojo/blob/hustsec_dev/setup.sh)**

> [!NOTE]
> This command would map ports(22, 80, 443) in the container to the corresponding ports(22222, 8080, 10443) on the Docker host.
> If these ports are bound, especially Port 22, you can disable these processes or modify the mapping ports.

This will run the initial setup, including building the challenge docker image.
If you want to build the full 70+ GB challenge image, you can add `-e DOJO_CHALLENGE=challenge` to the docker args.
Note, however, that docker environment variables only affect the initial setup, after which `./data/config.env` should be modified instead.
Expand Down Expand Up @@ -76,4 +61,4 @@ We love Pull Requests! 🌟
Have a small update?
Send a PR so everyone can benefit.
For more substantial changes, open an issue to ensure we're on the same page.
Together, we make this project better for all! 🚀
Together, we make this project better for all! 🚀

0 comments on commit 5baef1f

Please sign in to comment.