*ctfcli is a tool to manage Capture The Flag events and challenges.*
ctfcli provides challenge specifications and templates to make it easier to generate challenges of different categories. It also provides an integration with the CTFd REST API to allow for command line uploading of challenges and integration with CI/CD build systems.
ctfcli features tab completion, a REPL interface (thanks to Python-Fire) and plugin support for custom commands.
*WIP: ctfcli is an alpha project and changes will happen. Be sure to pin and read the CHANGELOG when updating.*
ctfcli can be installed with pipx as an executable command:
pipx install ctfcli
Alternatively, you can always install it with pip as a python module:
pip install ctfcli
To install the de of ctfcli directly from the repository you can use:
pip install git+
Ctfcli turns the current folder into a CTF event git repo.
It asks for the base url of the CTFd instance you're working with and an access token.
This will create the .ctf folder with the config file that will specify the URL, access token, and keep a record of
all the challenges dedicated for this event.
Events are made up of challenges.
Challenges can be made from a subdirectory or pulled from another repository.
GIT-enabled challenges are pulled into the event repo, and a reference is kept in the .ctf/config file.
##### Local folder:
##### GIT repository:
##### GIT repository to a specific subfolder:
Installing a challenge will create the challenge in your CTFd instance using the API.
Syncing a challenge will update the challenge in your CTFd instance using the API.
Any changes made in the challenge.yml file will be reflected in your instance.
Deploying a challenge will automatically create the challenge service (by default in your CTFd instance).
You can also use a different deployment handler to deploy the service via SSH to your own server,
or a separate docker registry.
The challenge will also be automatically installed or synced.
Obtained connection info will be added to your challenge.yml file.
a challenge will check if the local of the challenge is the same as one installed in your CTFd instance.
Mirroring a challenge is the reverse operation to syncing.
It will update the local of the challenge with details of the one installed in your CTFd instance.
It will also issue a warning if you have any remote challenges that are not tracked locally.
You can perform operations on all challenges defined in your config by simply skipping the challenge parameter.
ctf challenge installctf challenge syncctf challenge deployctf challenge ctf challenge mirrorctfcli contains pre-made challenge templates to make it faster to create CTF challenges with safe defaults.
Contributions welcome on improving the challenge templates to make CTF challenges better for e!
ctfcli provides a challenge specification (challenge.yml) that outlines the major details of a challenge.
Every challenge generated by or processed by ctfcli should have a challenge.yml file.
The specification format has already been tested and used with CTFd in production events but comments, suggestions, and PRs are welcome on the format of challenge.yml.
ctfcli plugins are essentially additions to the command line interface class modifications. See the plugin documentation page for a simple example.
*ctfcli is an alpha project! The plugin interface is likely to change!*
ctfcli manages git-based challenges by using the built-in git subtree mechanism. While it works most of the time, it's been proven to ha and tends to create problems and merge conflicts.
As an alternative, we're currently experimenting with the git git subrepo extension.
This functionality can be enabled by adding a use_subrepo = True property to the [config] section inside a ctfcli project config.
Subrepo has to be installed separately, and is not backwards compatible with the default subtree.
Once challenges have been added by using either method, they will not work properly if you change it, and you will have to add the challenges again.
开发语言:Python
Star 数:216
该项目属于CTF思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕ctfcli is a tool to manage Capture The Flag events and challenges展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | ctfcli - ctfcli is a tool to manage Capture The Flag events |
| 所属分类 | CTF思路 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 23:46:25 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 399 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |