/HostCTF

🚀 Highly-performant & customizable CTF platform written from scratch in 🦀 Rust + Axum

Primary LanguageRustMIT LicenseMIT

HostCTF

🚀 Highly-performant & customizable CTF platform written from scratch in 🦀 Rust + Axum



Compilation and Deployment

If you want to run everything from a single machine, you can go inside of the "single-binary-host" directory and

Compile & Deploy: cargo run --release

By default the app will start on 0.0.0.0 interface and port 3000.

Another option for deployment is a separate backend and frontend. Here you can mix and match backends and frontends withing this repository (the API is consistent between those).

  • backend-fast - Compile & Deploy: cargo run --release
  • frontend-plain - Compile & Deploy: cargo run --release
  • frontend-sveltekit - Deploy on a hosting provider like Vercel or Compile & Deploy: npm run build && npm run preview

Customization

To customize CTF looks/branding - modify the template files inside the templates directory in either: single-binary-host/templates or frontend-plain/templates. Or modify the frontend-sveltekit/src/app.html file.

To add/modify CTF challenges - modify the challenges.json file in either single-binary-host/challenges.json or backend-fast/challenges.json (you can also put files in the static directory for hosting when using frontend-sveltekit or single-binary-host)

Screenshots

Main page Challenges subpage Scoreboard subpage

Directory structure

  • single-binary-host - Contains a all-in-one HostCTF implementation which does server-side rendering from a single binary
  • backend-fast - Contains the "fast" (based on a custom in-memory, commit on write) version of the HostCTF backend
  • frontend-plain - Contains a plain html/css/js version of the HostCTF frontend (connects to a HostCTF backend)
  • frontend-sveltekit - Contains a sveltekit rewrite of the plain HostCTF frontend (connects to a HostCTF backend)

Note

This project is a rewrite of my previous CTF platform - LuaCTF - hence the nearly exact copy of the frontend.

License

This project is licensed under the MIT license