Skip to content

4T-24/CTFd-Instancier-Plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

4T$'s CTFd Instancier

Plugin that connects to an Instancier compatible API in order to instanciate challenges on CTFd. If the CTF is team based, instances will be per team. The plugin is should be placed in i_challenges.

Installation

  • To install clone this repository to the CTFd/plugins folder.
  • Rename the cloned repository into i_challenges.
  • Add the following values as environment variables or edit CTFd/config.py to add the following entries:
  • 4TS_INSTANCER_BASE_URL: The base URI leading to your Instancier API
  • 4TS_INSTANCER_TOKEN: A secret token to communicate with the Instancier API.

Instancier API

slug is defined when creating an instanciated challenge, the instancier api should know this slug beforehand. instance_id can be the user_id or the team_id depending on the CTFd gamemode.

  • GET /api/v1/{slug}/{instance_id} : Get the current status
  • POST /api/v1/{slug}/{instance_id} : Trigger instanciation, response is the status
  • DELETE /api/v1/{slug}/{instance_id} : Trigger deletion, response is the status

The API must response with this following schema :

{
    "status": "Stopped / Starting / Stopping / Running",
    "servers": [
        {
            "kind": "http",
            "host": "cdsfj.com"
        },
        {
            "kind": "tcp",
            "host": "cdsfj.com",
            "port": "5656"
        }
    ]
}

port is only set for tcp challenges. http challenges are served with https.

Note

The plugin does not support different base path. API routes must be served strictly at the routes above.

About

A CTFd plugin to instanciate per team / per user instances.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published