Giter Club home page Giter Club logo

ctfsubmitter's Introduction

CTF submitter

While playing ruCTFe 2015 some of our "attack" scripts didn't work as expected, flooding the game infrastructure with invalid flags (sorry guys!). We decided then to write a centralized "flag submit" service with a rest api which would act as a filter and be able to tell us if some of the attack scripts are submitting too many invalid flags. In the end it worked out pretty well! :)

Please keep in mind that this code was written in a hurry, planning to use it locally during ctfs: don't expect it to be (perfect || secure || bug free). If you find a bug, add a new feature please contribute with a pull request. If you like it or use it feel free to drop us a line ;)

stats screenshot

Submitter service

This webservice is responsible for receiving flags, and storing them togheter with statistics inside the DB. Please start this one first to setup the database the first time. The service is based on bottle.py and we used cherrypy for our deploy:

python submitter.py

You will also need an instance of the "worker" which will submit the flags to the game infrastructure:

python worker.py

Requirements

  • bottle
  • pymongo>=3.0

for RuCTFe:

  • pwntools

for iCTF:

  • ictf

It was tested with mongodb 2.6.x

nginx

It is advisable to put an nginx in front of the submitter service, look at nginx_submitter.conf for an example config.

Stats service

you will need another virtualenv since right now motor doesn't wrap pymongo 3

python stats.py

Requirements

  • tornado
  • motor

TODO

  • cleanup and "plugin" handling
  • complete service/team statistics
  • management script
  • tests
  • better log message handling
  • better handling of exceptions
  • blacklist ip/user temporarily if too many wrong flags are submitted
  • rewrite the stats frontend since it's just plain jquery
  • reorganize the code base, and allow the stats service and logger to use a different backend other than mongodb
  • add cold restart button in case of failures of the service
  • add a raw socket interface to submit flags
  • possibly add authentication to use the service not only locally

ctfsubmitter's People

Contributors

conand avatar draane avatar empijei avatar marcof992 avatar ocean1 avatar pogliamarci avatar

Forkers

golim

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.