Coder Social home page Coder Social logo

xctf

A simple CTF platform written in go. An ode to the illustrious CTFd.

We just ran a competition for 200 high schoolers in person using this framework.

Have ideas about what should go in here? Come talk to us on Discord!

Currently in alpha.

Goals

  • Simple: Capture only the basics of what a CTF competition needs in a single binary.
  • Extendable: A well documented API to allow for creativity and variety of competitions.

Development

Tech Stack

xctf is developed with:

  • Go: This is used for the server.
    • Reasoning: This was chosen to make development and deployment easy and consistent. While Python or Javascript would be more approachable languages to more people, Go's types and tools are more conducive for xctf being extendable. Additionally, plugins for CTFg, written in any language, are made possible through projects such as this.
  • React: This is used for client.
    • Reasoning: This was chosen because using React has the best libraries and support by the community. While we prefer other frameworks, React's ecosystem is simply unmatched. If you are not familiar with React, the tutorial should teach you all you need to know.

Running Locally

Server

Run this command to start the backend:

go run main.go

Plugins

Under development. Python is the only plugin currently. Read the README for more information.

Backups

To have automatic backups with sqlite, run minio:

docker run -t -p 9000:9000 -p 9090:9090 -v PATH:/mnt/data -v "$(pwd)/deploy/minio/config:/etc/config.env" -e "MINIO_CONFIG_ENV_FILE=/etc/config.env" --rm quay.io/minio/minio server --console-address ":9090"

Open up http://localhost:9090, login with minio:minio123, and create the bucket xctf.

Web site

Run this command to start the frontend:

npm run dev

Build the client for production:

npm run build

Protoc Generation

go generate ./...

Adding a challenge

Written in go
  1. Update Challenge message to include the new challenge.
  2. Run go generate ./...
  3. Implement the challenge in the Handle method.
Written in python
  1. Update PythonChallenge message to include the new challenge.
  2. Run go generate ./...
  3. Implement the challenge in the Generate method.

CTFg's Projects

ctfg icon ctfg

A simple CTF platform written in go.

wiki icon wiki

A wiki for all things CTF.

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.