Skip to main content

青少年CTF Flag 生成工具

Project description

青少年CTF FLAG生成器

一个专为青少年CTF竞赛设计的FLAG生成工具,支持多种FLAG生成方式,界面美观易用。

功能特性

🔑 FLAG生成方式

  1. 基于UUID生成 (随机型)

    • 自动生成唯一的UUID
    • 格式:flag{uuid}
    • 适用于需要唯一标识符的场景
  2. 基于MD5生成 (哈希型)

    • 自动生成随机的MD5
    • 格式:flag{md5_hash}
  3. 基于语义化字符串 (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

使用方法

  1. 启动程序

    python main.py
    
  2. 选择功能

    • 使用方向键选择菜单选项
    • 按回车确认选择
  3. 生成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生成方式

  1. module/flag_generator.py 中添加新的生成函数
  2. flag_generator_menu() 函数中添加菜单选项
  3. 更新主菜单调用

示例代码结构

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进行反馈。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flag_generation_assistant-0.1.3.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flag_generation_assistant-0.1.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file flag_generation_assistant-0.1.3.tar.gz.

File metadata

File hashes

Hashes for flag_generation_assistant-0.1.3.tar.gz
Algorithm Hash digest
SHA256 94ecf898480a8bcf2690d4a06273906a1d7db66ebd7761302f7ecccfea477129
MD5 0a6cd6193fa2c274ab98a95b238152ba
BLAKE2b-256 652e66a112b6172a21dbe2bda92241c0349b2378c22f8ff11d9d4a3c074c6ab9

See more details on using hashes here.

Provenance

The following attestation bundles were made for flag_generation_assistant-0.1.3.tar.gz:

Publisher: python-publish.yml on qsnctf/flag_generation_assistant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flag_generation_assistant-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for flag_generation_assistant-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b86b094190d18b089b905c50ecb03acedf9532ca6cb6b2e195f0ddc6d75651f9
MD5 60315ccc4c45652041dcb8a6f9b0664c
BLAKE2b-256 8e5353784abad17fc40fd34a78ece69d6cd042fe7bb51968a3e8a1452373ea99

See more details on using hashes here.

Provenance

The following attestation bundles were made for flag_generation_assistant-0.1.3-py3-none-any.whl:

Publisher: python-publish.yml on qsnctf/flag_generation_assistant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page