青少年CTF FLAG生成器
一个专为青少年CTF竞赛设计的FLAG生成工具,支持多种FLAG生成方式,界面美观易用。
功能特性
🔑 FLAG生成方式
-
基于UUID生成 (随机型)
- 自动生成唯一的UUID
- 格式:
flag{uuid} - 适用于需要唯一标识符的场景
-
基于MD5生成 (哈希型)
- 自动生成随机的MD5
- 格式:
flag{md5_hash}
-
基于语义化字符串 (L33t变体)
- 支持L33t Sp34k转换
- 字符替换规则:
- A → 4
- B → 8
- E → 3
- G → 6
- L → 1
- O → 0
- S → 5
- T → 7
- Z → 2
- I → !
- 格式:
flag{l33t_text} - 适用于需要趣味性和可读性的FLAG
🎨 界面特色
- 使用
rich库实现彩色终端输出 - 使用
questionary提供交互式菜单 - 支持中文界面,操作简单直观
- 美观的ASCII艺术标题
安装要求
Python版本
- Python 3.7+
PIP安装
pip install flag-generation-assistant
运行
flag_generation_assistant
flag
flag_generator
依赖包
pip install rich questionary
使用方法
-
启动程序
python main.py -
选择功能
- 使用方向键选择菜单选项
- 按回车确认选择
-
生成FLAG
- 根据提示输入相应内容
- 程序会自动生成并显示FLAG
项目结构
Flag Generator/
├── main.py # 主程序入口
├── config.yml # 配置文件
├── README.md # 项目说明
└── module/ # 功能模块
├── qsnctf_welcome.py # 欢迎界面模块
└── flag_generator.py # FLAG生成器核心模块
配置说明
config.yml
title: 青少年CTF工具示例
version: 1.0.0
flag_format: "flag{.*}"
title: 程序标题version: 版本号flag_format: FLAG格式正则表达式
开发说明
添加新的FLAG生成方式
- 在
module/flag_generator.py中添加新的生成函数 - 在
flag_generator_menu()函数中添加菜单选项 - 更新主菜单调用
示例代码结构
def generate_flag_custom():
"""自定义FLAG生成函数"""
# 实现生成逻辑
pass
def flag_generator_menu():
# 添加菜单选项
choices = [
"🔑 根据UUID生成FLAG",
"🔒 根据MD5生成FLAG",
"💬 根据语义化字符串生成FLAG",
"🆕 自定义生成方式", # 新增选项
"⬅️ 返回主菜单"
]
# 添加处理逻辑
使用示例
UUID FLAG生成
生成的FLAG: flag{123e4567-e89b-12d3-a456-426614174000}
MD5 FLAG生成
输入的文本: hello world
MD5哈希值: 5eb63bbbe01eeed093cb22bb8f5acdc3
生成的FLAG: flag{5eb63bbbe01eeed093cb22bb8f5acdc3}
L33t Sp34k FLAG生成
原始字符串: HELLO WORLD
L33t Sp34k转换: H3LL0 W0RLD
生成的FLAG: flag{H3LL0 W0RLD}
贡献指南
欢迎提交Issue和Pull Request来改进这个项目!
许可证
本项目采用MIT许可证。
联系方式
如有问题或建议,请通过项目Issue进行反馈。
Metadata
Release files for flag-generation-assistant 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flag_generation_assistant-0.1.4.tar.gz | 6.2 kB | With provenance | Details for flag_generation_assistant-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flag_generation_assistant-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for flag_generation_assistant-0.1.4-py3-none-any.whl |
Total release size: 14.0 kB
Release files / flag_generation_assistant-0.1.4.tar.gz
| Download URL | flag_generation_assistant-0.1.4.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b6ae64fe10366e05e4f566e3a95c102ccaa38467952e2747149b0b1677d3d45
|
|
BLAKE2b-256 checksum How to use checksums |
23053e014ad66c96f82b818b6763b6b24db68f6ce3ea4da86e9792f4049dee1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.
Transparency logRelease files / flag_generation_assistant-0.1.4-py3-none-any.whl
| Download URL | flag_generation_assistant-0.1.4-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c07057e49377908e87f292810e47b1c648acefd5a1402054e7f90af9a7b5e13
|
|
BLAKE2b-256 checksum How to use checksums |
3bb862a865b3ac2fd04cb4644753bd11d3a3b0175287b54efda0ac8be8577361
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.
Transparency logSecurity for flag-generation-assistant 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for flag_generation_assistant-0.1.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.