arkanzasfeziii/SecurityQuestAcademy

GitHub: arkanzasfeziii/SecurityQuestAcademy

一个游戏化的互动式网络安全培训平台,通过 7 个主题任务和 700 个实践挑战帮助学习者从零基础逐步掌握网络安全技能。

Stars: 0 | Forks: 0

# SecurityQuestAcademy ## 这是什么 SecurityQuestAcademy 是一个互动式的游戏化培训平台,通过实践挑战来教授网络安全。没有幻灯片。没有选择题。你将编写真实的 Python exploit,输入真实的 Cisco IOS 命令,编写真实的 Bash 脚本,并构建真实的攻击 payload —— 所有这一切都在一个带有进度跟踪、排名和成就的基于 terminal 的游戏引擎中进行。 7 个任务游戏。每个 100 级。总共 700 个挑战。从零基础新手到专家。 ## 7 个任务 | # | 任务 | 领域 | 你将构建的内容 | |---|---|---|---| | 1 | **CyberQuest** | Python 与 Linux 安全 | 用于网络、加密、系统安全、取证、网页抓取、恶意软件分析的 Python 脚本 | | 2 | **BashQuest** | Bash 与 Shell 安全 | 文件操作、文本处理、pipes/redirects、regex、进程管理、自动化脚本 | | 3 | **WindowsQuest** | Windows 与 PowerShell | CMD 命令、PowerShell cmdlets、registry、services、Active Directory、Group Policy、取证 | | 4 | **CiscoQuest** | Cisco IOS 与网络 | CLI 导航、interface 配置、路由 (OSPF/BGP/EIGRP)、交换 (VLANs/STP)、ACLs、VPNs、NAT | | 5 | **CryptoQuest** | 密码学 | Caesar/Vigenere/Enigma、AES/DES、RSA/ECC/Diffie-Hellman、SHA/HMAC、TLS 握手、PKI、后量子 | | 6 | **ReverseQuest** | 逆向工程 | Binary/hex、x86 汇编、ELF/PE 解析、GDB 调试、IDA/Ghidra、anti-debug、缓冲区溢出、ROP | | 7 | **WebHackQuest** | Web 安全与渗透测试 | HTTP 解析、XSS、SQLi、SSRF、SSTI、IDOR、JWT 攻击、OAuth 绕过、GraphQL、反序列化 | ## 挑战如何运作 每个任务根据领域使用三种执行引擎之一: ### Python 引擎 — 编写并执行 CyberQuest、CryptoQuest、ReverseQuest 和 WebHackQuest 会提出一个问题,并期望你编写一个能产生正确输出的 Python 函数。你的代码将被执行并针对断言进行测试。 ``` LEVEL 1: Caesar Cipher — Encrypt Category: CLASSICAL | Points: 10 Description: The Caesar cipher shifts each letter by a fixed number. Julius Caesar used a shift of 3. Challenge: Write caesar_encrypt(text, shift) that encrypts uppercase letters only. Example: caesar_encrypt('HELLO', 3) → 'KHOOR' >>> def caesar_encrypt(text, shift): >>> result = '' >>> for c in text: >>> if c.isupper(): >>> result += chr((ord(c) - ord('A') + shift) % 26 + ord('A')) >>> else: >>> result += c >>> return result >>> done ✅ Correct! Level complete! +10 points! ``` ### Cisco 引擎 — 输入命令 CiscoQuest 会提供一个网络场景,并期望你输入准确的 Cisco IOS 命令。接受缩写(例如用 `conf t` 代替 `configure terminal`)。 ``` LEVEL 5: Save Configuration You've made changes to the running-config. Save them so they survive a reload. Router# copy running-config startup-config ✅ Correct! Level complete! ``` ### Bash 引擎 — 在你的系统上执行 BashQuest 和 WindowsQuest 挑战会在沙盒 shell 中运行你的命令,并将输出与预期结果进行比较。 ``` LEVEL 12: Count Lines in a File bash$ wc -l < /etc/passwd ✅ Correct! Level complete! ``` ## 进阶系统 ### 排名 每个任务有 21 个反映你专业水平的排名。当你完成关卡时,你的排名会随之更新: ``` Level 1-4 Script Newbie → Just starting Level 5-9 Code Cadet → Learning the basics Level 10-14 Terminal Rookie → Getting comfortable ... Level 50-54 Exploit Developer → Creating exploits ... Level 90-94 Cyber Samurai → Master of all domains Level 95-99 Elite Guardian → Protecting the digital realm Level 100 Legendary Hacker → The ultimate achievement ``` ### 成就 里程碑徽章会在你达到关卡阈值时解锁 —— 每个任务完成 5、10、25、50、75 和 100 个关卡。 ### 进度持久化 每完成一个关卡后,进度会自动保存到 `~/.{quest}_save.json`。可以随时关闭和重新打开 —— 你的排名、积分、已完成的关卡和成就都会持续存在。 ## 架构 ``` main.py ← Academy launcher — game selection menu │ ├── games/ │ ├── base.py ← Shared engine: progress, ranks, achievements, │ │ 3 execution engines (Python/Cisco/Bash), │ │ level display, save/load │ │ │ ├── ciscoquest.py ← 100 Cisco IOS levels (cisco engine) │ ├── cryptoquest.py ← 100 Cryptography levels (python engine) │ ├── reversequest.py ← 100 Reverse Engineering levels (python engine) │ ├── webhackquest.py ← 100 Web Security levels (python engine) │ │ │ ├── cyberquest.py ← Launcher → standalone/Cyberquest.py │ ├── bashquest.py ← Launcher → standalone/Bashquest.py │ └── windowsquest.py ← Launcher → standalone/Windowsquest.py │ └── standalone/ ├── Cyberquest.py ← 100 Python & Linux Security levels ├── Bashquest.py ← 100 Bash & Shell levels └── Windowsquest.py ← 100 Windows & PowerShell levels ``` 4 个集成的任务(Cisco、Crypto、Reverse、WebHack)共享 `base.py` 的游戏循环、执行引擎和进度基础设施。3 个独立的任务(Cyber、Bash、Windows)拥有各自自包含的引擎,并具备相同的功能集。 ## 按领域划分的关卡覆盖范围 ### CyberQuest (100 个关卡) `Python 基础` → `数据结构` → `文件 I/O` → `网络 (sockets, HTTP)` → `系统安全` → `密码学基础` → `网页抓取` → `取证` → `恶意软件分析` → `漏洞利用开发` ### BashQuest (100 个关卡) `导航与文件` → `文本处理 (grep/sed/awk)` → `pipes 与 redirects` → `regex` → `脚本基础` → `进程管理` → `权限与安全` → `网络命令` → `系统管理` → `自动化工作流` ### WindowsQuest (100 个关卡) `CMD 基础` → `文件操作` → `PowerShell 简介` → `cmdlets 与 pipeline` → `registry 编辑` → `services 与进程` → `Active Directory` → `Group Policy` → `安全与取证` → `高级自动化` ### CiscoQuest (100 个关卡) `CLI 模式 (User/Priv/Global)` → `interface 配置` → `静态路由` → `VLANs 与 trunking` → `STP` → `OSPF` → `EIGRP` → `BGP` → `ACLs` → `NAT/PAT` → `VPN/IPsec` → `设备加固` → `QoS` ### CryptoQuest (100 个关卡) `Caesar/ROT13` → `Vigenere/Playfair` → `Enigma 模拟` → `XOR` → `DES/3DES` → `AES (ECB/CBC/CTR/GCM)` → `RSA` → `Diffie-Hellman` → `ECC` → `SHA/HMAC` → `PBKDF2/bcrypt/Argon2` → `TLS 握手` → `PKI/X.509` → `后量子` ### ReverseQuest (100 个关卡) `Binary/hex 转换` → `x86 寄存器与指令` → `stack frames 与调用约定` → `ELF/PE 格式解析` → `GDB 命令` → `静态分析 (IDA/Ghidra)` → `动态分析` → `anti-debugging` → `unpacking` → `缓冲区溢出` → `ROP chains` → `格式化字符串` → `恶意软件分析` → `fuzzing` ### WebHackQuest (100 个关卡) `HTTP 请求解析` → `URL/HTML 编码` → `cookies 与 sessions` → `XSS (反射型/存储型/DOM)` → `SQL injection (报错/盲注/UNION)` → `CSRF` → `SSRF` → `文件上传/包含` → `SSTI` → `IDOR` → `JWT 攻击` → `OAuth 绕过` → `GraphQL` → `反序列化` → `竞态条件` → `CSP 绕过` ## 用法 ``` # 安装 dependencies pip install -r requirements.txt # 启动 Academy — 从菜单中选择任意 quest python main.py ``` 启动器会显示一个游戏选择菜单。选择一个任务编号 (1-7) 即可开始。 在每个任务内: - **继续旅程** — 从你当前的关卡开始玩 - **查看统计** — 查看排名、积分、已完成的关卡 - **跳转关卡** — 重玩任何已完成的关卡 - **成就** — 查看已解锁的徽章 - **重置进度** — 重新开始 在关卡中: - 输入 `hint` 获取提示 - 输入 `skip` 跳过(不获得积分) - 输入 `done` 提交你的代码(Python 引擎) ## 输出 ``` ╔═══════════════════════════════════════════════════════════════════╗ ║ ███████╗███████╗ ██████╗ ██╗ ██╗██████╗ ██╗████████╗██╗ ██╗║ ║ ██╔════╝██╔════╝██╔════╝ ██║ ██║██╔══██╗██║╚══██╔══╝╚██╗ ██╔╝║ ║ ███████╗█████╗ ██║ ██║ ██║██████╔╝██║ ██║ ╚████╔╝ ║ ║ ╚════██║██╔══╝ ██║ ██║ ██║██╔══██╗██║ ██║ ╚██╔╝ ║ ║ ███████║███████╗╚██████╗ ╚██████╔╝██║ ██║██║ ██║ ██║ ║ ║ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ║ ║ Q U E S T A C A D E M Y ║ ╚═══════════════════════════════════════════════════════════════════╝ ── SELECT YOUR QUEST ── ╭──────┬──────────────────┬────────────────────────────────────┬──────────┬──────────────────────────────────────────╮ │ # │ Game │ Description │ Levels │ Topics │ ├──────┼──────────────────┼────────────────────────────────────┼──────────┼──────────────────────────────────────────┤ │ 1 │ 🖥️ CyberQuest │ Python & Linux Security │ 100 │ Linux, Python, Networking, System... │ │ 2 │ 🐚 BashQuest │ Bash Scripting & Shell Security │ 100 │ Bash, Shell Scripting, Automation... │ │ 3 │ 🪟 WindowsQuest │ Windows Security & PowerShell │ 100 │ PowerShell, Active Directory... │ │ 4 │ 🌐 CiscoQuest │ Cisco IOS Networking & Security │ 100 │ Routing, Switching, ACLs, VPNs... │ │ 5 │ 🔐 CryptoQuest │ Cryptography Classical to Modern │ 100 │ Classical Ciphers, AES, RSA, TLS... │ │ 6 │ 🔍 ReverseQuest │ Reverse Engineering & Malware │ 100 │ x86 ASM, ELF/PE, GDB, IDA... │ │ 7 │ 🕸️ WebHackQuest │ Web App Security & Pentesting │ 100 │ XSS, SQLi, SSRF, SSTI, JWT... │ ╰──────┴──────────────────┴────────────────────────────────────┴──────────┴──────────────────────────────────────────╯ Enter the number of the quest you want to play, or Q to quit. ``` ## 涵盖的主题 ``` Offensive Security Defensive Concepts Infrastructure ───────────────── ────────────────── ────────────── XSS / SQLi / SSRF Input validation Cisco IOS SSTI / IDOR / CSRF Cookie security flags OSPF / BGP / EIGRP JWT forging CSP / CORS policy VLANs / ACLs / NAT Buffer overflow Password hashing VPN / IPsec ROP chains TLS/PKI Active Directory Format string exploits AES-GCM / RSA padding Group Policy Malware reverse eng. Anti-debugging detection PowerShell remoting Binary exploitation Secure coding patterns Registry hardening ``` ## 要求 - Python 3.8+ - 支持 Unicode 的 terminal(用于 UI) - 依赖项:`rich`、`pycryptodome`、`cryptography`、`bcrypt`、`argon2-cffi` ``` pip install -r requirements.txt ```
标签:AI合规, CISA项目, IP 地址批量处理, OPA, 云资产清单, 安全教育, 应用安全, 漏洞修复, 知识库安全, 网络安全培训, 逆向工具, 逆向工程, 靶场