{"id":16890438,"url":"https://github.com/jedevc/mini-ctf-tool","last_synced_at":"2025-03-20T07:38:05.470Z","repository":{"id":53123774,"uuid":"188659505","full_name":"jedevc/mini-ctf-tool","owner":"jedevc","description":"Quick and easy tool to manage the challenges for a CTF :monkey:","archived":false,"fork":false,"pushed_at":"2021-04-09T10:36:09.000Z","size":95,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T13:52:28.617Z","etag":null,"topics":["ctf","hacking"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jedevc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-26T08:44:03.000Z","updated_at":"2024-05-04T03:05:59.000Z","dependencies_parsed_at":"2022-09-10T15:21:00.894Z","dependency_job_id":null,"html_url":"https://github.com/jedevc/mini-ctf-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fmini-ctf-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fmini-ctf-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fmini-ctf-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fmini-ctf-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedevc","download_url":"https://codeload.github.com/jedevc/mini-ctf-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244572678,"owners_count":20474504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ctf","hacking"],"created_at":"2024-10-13T17:03:08.770Z","updated_at":"2025-03-20T07:38:05.451Z","avatar_url":"https://github.com/jedevc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini CTF tool\n\nMini CTF tool is a quick and easy tool to manage the challenges for a CTF in\na controlled, automated fashion.\n\nIt cleanly handles challenge creation and deployment scripts as well as\nintegrating with the [CTFd](https://github.com/CTFd/CTFd) platform as a\nscoreboard.\n\n## Installation\n\nSimply copy the `ctftool.py` script into the root directory of your CTF\nchallenge directory.\n\nThe script depends on:\n\n- colorama\n- requests\n- pyyaml\n\nTo install all of the dependencies:\n\n    $ pip3 install colorama requests pyyaml\n    \n### Upgrading\n\nTo upgrade your existing installation (and overwrite the existing script):\n\n    $ ./ctftool.py upgrade\n\n## Usage\n\nCtftool automatically detects `challenge.json` and `challenge.yaml` files in\nthe `challenges/` directory.\n\n    $ mkdir -p challenges/demo\n    $ cat \u003c\u003c EOF \u003e challenges/demo/challenge.yaml\n    name: demo\n    category: web\n    description: \u003e\n        Just a demonstration challenge!\n    flags:\n    - \"FLAG{demo}\"\n    files:\n    - flag.txt\n    points: 50\n    EOF\n\nList all challenges:\n\n    $ ./ctftool.py list\n    [web] demo - challenges/demo/challenge.yaml\n\nValidate all challenge configs:\n\n    $ ./ctftool.py validate\n\nUpload the challenges to CTFd:\n\n    $ ./ctftool upload https://demo.ctf.io -u USERNAME -p PASSWORD\n\n## Documentation\n\nFields:\n\n- `name`\n\n  Name of the challenge. Must be unique and stable over time.\n\n- `display`\n\n  Display name of the challenge. This corresponds to the CTFd challenge name.\n  Must be unique and stable over time (otherwise you'll get challenge\n  duplication).\n\n- `category`\n\n  The \"type\" of challenge. This corresponds to CTFd categories, and\n  challenges will be shown grouped into these categories.\n\n- `description`\n\n  Plain text description of the challenge, may include some arbitrary HTML.\n\n- `generate`\n\n  Map containing filenames as keys and a string command to generate that file\n  as a value.\n\n  The command is executed with the current working directory as the directory\n  of the challenge file.\n\n- `clean`\n\n  Remove all generated files.\n\n- `points`\n\n  How many points the challenge is worth\n\n- `flags`\n\n  A list of strings that are valid flag submissions.\n\n  If the flag starts and ends with a `/`, e.g. `/FLAG{demo}/`, the internal\n  parts will be interpreted as a regex.\n\n- `files`\n\n  A list of files that should be uploaded to CTFd as part of the challenge.\n\n  The path to the file should be relative to the directory of the\n  corresponding challenge file.\n\n- `hints`\n  \n  A dictionary which contains the hints and the associated costs.\n\n  | field  | type                             | description                                                                                        |\n  | :----- | :------------------------------- | :------------------------------------------------------------------------------------------------- |\n  | cost   | int                              | the 'cost' of the hint to the CTF user                                                             |\n  | text   | string                           | plain text hint to the user, describing how to approach the challenge (but not give any solutions) |\n\n- `state`\n\n  One of 'visible' or 'hidden' if present. Represents whether the challenge\n  should be shown to participants or not on CTFd.\n\n- `deploy`\n\n  | field  | type                             | description                                        |\n  | :----- | :------------------------------- | :------------------------------------------------- |\n  | docker | bool                             | should deploy this challenge as a docker container |\n  | ports  | [{internal, external, protocol}] | list of port mappings into the container           |\n\nNote that while ctftool interprets all of the above fields, it will not give\nwarnings/errors on unknown fields. This means that you can use any additional\nkeys for your own purposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedevc%2Fmini-ctf-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedevc%2Fmini-ctf-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedevc%2Fmini-ctf-tool/lists"}