Source Code Organization

From b01lers

Organizing Source Code

All (more or less) challenges should have the following top level directories. For this example, assume we have a challenge called chal.

Inside the chal directory, we should have:

  • dist
  • solve
  • src
  • deploy

dist

The dist directory contains everything the players receive. It should _not_ have the flag in it anywhere! If the players get to download it, it goes here. dist should also contain a file description.md that looks like this:

Title: chal

Difficulty: wizard

Author: novafacing

Description: crack this!!!

solve

The solve directory should contain everything needed to solve a challenge. This should at minimum be a solve.md file describing in as much detail as is appropriate ow to solve the challenge from start to finish. It can also contain scripts and other utilities for solving.

src

This directory should contain all source code as well as anything else required to build (this may be dockerfiles, etc). This should be all your .py or .c source files, your makefile, any libraries, etc.

deploy

This directory is for remote challenges only (usually, pwn and web, sometimes crypto). This should have all the docker build stuff you need to spin up the challenge. If you run docker-compoe up in this directory, the challenge should start!