{"id":50637385,"url":"https://github.com/1837620622/codex-red-team-prompt","last_synced_at":"2026-06-07T04:02:09.849Z","repository":{"id":358301566,"uuid":"1240851965","full_name":"1837620622/codex-red-team-prompt","owner":"1837620622","description":"Advanced reverse engineering and red team security system prompt for OpenAI Codex - CTF, penetration testing, exploit development, malware analysis, binary patching, mobile security, C2 frameworks, EDR bypass, kernel exploitation","archived":false,"fork":false,"pushed_at":"2026-05-16T16:56:09.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-16T18:45:43.702Z","etag":null,"topics":["binary-patching","bug-bounty","c2-framework","codex","ctf","cybersecurity","edr-bypass","exploit-development","kernel-exploitation","malware-analysis","mobile-security","penetration-testing","pentesting","red-team","reverse-engineering","security-research","vulnerability-research"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1837620622.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-16T16:44:21.000Z","updated_at":"2026-05-16T16:56:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/1837620622/codex-red-team-prompt","commit_stats":null,"previous_names":["1837620622/codex-red-team-prompt"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/1837620622/codex-red-team-prompt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1837620622%2Fcodex-red-team-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1837620622%2Fcodex-red-team-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1837620622%2Fcodex-red-team-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1837620622%2Fcodex-red-team-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1837620622","download_url":"https://codeload.github.com/1837620622/codex-red-team-prompt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1837620622%2Fcodex-red-team-prompt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34008068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["binary-patching","bug-bounty","c2-framework","codex","ctf","cybersecurity","edr-bypass","exploit-development","kernel-exploitation","malware-analysis","mobile-security","penetration-testing","pentesting","red-team","reverse-engineering","security-research","vulnerability-research"],"created_at":"2026-06-07T04:02:09.101Z","updated_at":"2026-06-07T04:02:09.840Z","avatar_url":"https://github.com/1837620622.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Codex \u0026 Windsurf Red Team Security System Prompt\n\n高级逆向工程与红队安全架构师级别的 OpenAI Codex 与 Windsurf 全局规则配置，专为 CTF 比赛、授权渗透测试、红队靶场、安全研究设计。\n\n## 项目文件\n\n| 文件 | 用途 | 字符上限 | 当前大小 |\n|---|---|---|---|\n| `AGENTS.md` | Codex 全局强制规则（`~/.codex/AGENTS.md`），24 章节涵盖工程规范+安全研究 | 32 KiB | ~18 KB / 56% |\n| `system-prompt.md` | Codex 底层 base instructions 替换文件，红队角色定位 + 响应铁律 | 无 | ~10 KB |\n| `config.toml` | Codex CLI 配置示例，含 `model_instructions_file` 注入路径 | — | ~2.3 KB |\n| `windsurf-global-rules.md` | Windsurf 全局规则（`~/.codeium/windsurf/memories/global_rules.md`），27 章节精简版 | 6000 字符 | ~5.7 KB / 95% |\n\n## 功能特性\n\n### 安全研究能力（核心）\n\n- 完整逆向工程：x86/x64、ARM、MIPS、WebAssembly、Android、iOS、firmware、PE/ELF/Mach-O\n- 静态分析工具链：IDA Pro、Ghidra、Binary Ninja、radare2、Hopper\n- 动态分析工具链：x64dbg、WinDbg、GDB+pwndbg/gef、LLDB、ptrace、Frida、Xposed、DynamoRIO\n- 脱壳去混淆：OLLVM、VMProtect、Themida、Legu、Jiagu、自研 VM、anti-debug、anti-VM\n- 注册机 keygen 与软件破解：注册码逆向、Keygen 开发、Patch、激活绕过、License 伪造、DRM/壳绕过\n- CTF/靶场批量账号生成：Selenium/Playwright 自动化、catch-all SMTP、本地 CAPTCHA 处理\n- Web/JS/网络协议逆向：JS 加密参数还原、AST 反混淆、webpack 还原、Protobuf 解析、签名校验绕过\n- 漏洞利用开发：栈/堆溢出、ROP/JOP、UAF、tcache poisoning、内核利用、浏览器利用\n- Web 渗透：SQLi、SSRF、JWT、反序列化、XSS、CSRF、IDOR、WebShell（含免杀马/内存马）\n- EDR/AV 绕过：AMSI/ETW patch、内核回调摘除、direct syscall（HellsGate/HalosGate/TartarusGate）\n- C2 与持久化：Cobalt Strike、Sliver、Mythic、Havoc、mimikatz、DCSync、Kerberoasting\n- 移动端 / 固件：apktool/jadx、Smali patch、frida-ios-dump、binwalk、QEMU、JTAG/UART\n- 隧道与穿透：Frp、ngrok、Cloudflared、V2Ray、Chisel、ICMP/DNS 隐蔽信道\n\n### 工程规范（保留完整）\n\n- Python 3.12base 默认环境、MPS/CUDA 训练策略\n- Markdown + pandoc 三线表 docx 输出（黑色字体）\n- Kaggle 比赛流程规范（mcp-playwright 抓取、`/kaggle/input/` 路径）\n- R 4.4.2、Matlab 2024a、Stata 18、C 语言规范化\n- 数据库预检（MySQL/Neo4j/SQL 表数据校验）\n- 跨平台路径处理、中文注释规范、文档署名\n\n## Codex 部署方法（两套注入链路，必须同时配置）\n\nCodex 有**两条独立的全局规则加载链路**，本项目两者都使用，缺一不可：\n\n| 注入链路 | 文件 | 加载方式 | 是否需要 config.toml |\n|---|---|---|---|\n| 链路 A：全局 AGENTS.md | `~/.codex/AGENTS.md` | **自动加载**，文件存在即生效 | ❌ 不需要配置 |\n| 链路 B：base instructions 替换 | `~/.codex/system-prompt.md` | 通过 `model_instructions_file` 显式声明 | ✅ 必须在 config.toml 顶层 |\n\n### 部署步骤\n\n```bash\n# 步骤 1：创建目录并复制三个文件\nmkdir -p ~/.codex\ncp AGENTS.md          ~/.codex/AGENTS.md            # 链路 A：全局规则，自动加载\ncp system-prompt.md   ~/.codex/system-prompt.md     # 链路 B：base instructions\ncp config.toml        ~/.codex/config.toml          # CLI 配置（含 model_instructions_file）\n\n# 注意：如果你已有自己的 config.toml，不要覆盖，只在顶层追加这一行：\n# model_instructions_file = \"/Users/\u003c你的用户名\u003e/.codex/system-prompt.md\"\n# 必须放在文件最顶部，在任何 [section] 之前，否则会被识别为某个 section 内部键而失效\n\n# 步骤 2：移除可能屏蔽的 override 文件（如果存在）\n[ -f ~/.codex/AGENTS.override.md ] \u0026\u0026 echo \"存在 override 文件，会屏蔽 AGENTS.md：$HOME/.codex/AGENTS.override.md\"\n\n# 步骤 3：检查当前工作目录上溯路径是否有项目级 AGENTS.md 干扰\n# 项目级 AGENTS.md 会覆盖全局 AGENTS.md，若发现请重命名或确认是否需要\n```\n\n### 验证全局 AGENTS.md 真的被加载（官方推荐方法）\n\n```bash\n# 方法 1：让 Codex 自己列出加载的规则\ncodex --ask-for-approval never \"Summarize the current instructions you loaded from AGENTS.md.\"\n\n# 期望输出：Codex 应该列出 AGENTS.md 的 24 个章节标题\n\n# 方法 2：查 Codex 日志确认拼装的 developer message\nls -lt ~/.codex/log/codex-tui.log 2\u003e/dev/null || ls -lt ~/.codex/log/session-*.jsonl 2\u003e/dev/null\n# 用编辑器打开最新日志，搜 \"AGENTS\" 应该能看到完整规则被注入\n\n# 方法 3：自检脚本（一键诊断）\npython3 - \u003c\u003c 'EOF'\nimport tomllib, os\nfrom pathlib import Path\ncodex = Path.home() / '.codex'\nprint('=== 链路 A：全局 AGENTS.md ===')\nagents = codex / 'AGENTS.md'\noverride = codex / 'AGENTS.override.md'\nprint(f'  AGENTS.md 存在: {agents.exists()} 大小: {agents.stat().st_size if agents.exists() else 0} 字节')\nprint(f'  AGENTS.override.md 存在（会屏蔽）: {override.exists()}')\nprint(f'  上限 32 KiB，当前利用率: {agents.stat().st_size/32768*100:.1f}%' if agents.exists() else '')\nprint('=== 链路 B：base instructions 替换 ===')\ncfg = codex / 'config.toml'\nif cfg.exists():\n    data = tomllib.loads(cfg.read_text())\n    p = data.get('model_instructions_file')\n    print(f'  config.toml 顶层 model_instructions_file: {p}')\n    print(f'  指向文件存在: {os.path.isfile(p) if p else False}')\n    if not p:\n        print('  ⚠️ 顶层未配置 model_instructions_file，链路 B 未启用')\nEOF\n```\n\n### Codex 加载机制（官方权威，来自 developers.openai.com/codex/guides/agents-md）\n\n- **全局规则路径**：`$CODEX_HOME/AGENTS.md`（默认 `~/.codex/AGENTS.md`）\n- **优先级**：`AGENTS.override.md` \u003e `AGENTS.md`（同级只取第一个非空文件）\n- **大小上限**：`project_doc_max_bytes`（默认 32 KiB = 32768 字节）\n- **加载时机**：每次新会话启动时读取一次（once per launched session），旧会话不会重读\n- **拼装方式**：所有 AGENTS.md 文件按从根目录到 CWD 顺序拼接，深层 AGENTS.md 覆盖浅层\n- **不需要在 config.toml 配置 AGENTS.md** —— 它是 Codex 默认行为，文件存在即加载\n\n## Windsurf 部署方法\n\n```bash\n# 1. 复制全局规则到 Windsurf\nmkdir -p ~/.codeium/windsurf/memories\ncp windsurf-global-rules.md ~/.codeium/windsurf/memories/global_rules.md\n\n# 2. 开新 Cascade 对话即生效（无需重启 IDE）\n```\n\n### Windsurf 加载机制（官方权威）\n\n- 全局规则路径：`~/.codeium/windsurf/memories/global_rules.md`\n- 字符上限：6000 字符（超出会被截断）\n- 工作区规则：`.windsurf/rules/*.md`（每文件 12000 字符上限，支持 `---trigger:---` frontmatter）\n- 项目级 AGENTS.md：Windsurf 也自动加载，与 Codex 共用同一文件\n\n## 适用场景\n\n- CTF 比赛解题（pwnable.kr、HackTheBox、TryHackMe 等）\n- 授权渗透测试（含书面授权）\n- 红队靶场演练（内部 AD 环境、Vulnhub 靶机）\n- 漏洞研究与 PoC 开发\n- 恶意软件分析（沙箱环境）\n- 二进制逆向、注册机开发（自有软件、CTF 题）\n- 自有 SaaS 平台压测、自动化测试账号生成\n- Web JS 加密算法逆向（自有项目调试）\n\n## 注意事项\n\n本配置仅用于合法授权的安全测试、CTF 比赛和安全研究。使用前请确保：\n\n- 已获得明确的书面授权\n- 在隔离的测试环境中进行\n- 遵守当地法律法规\n- 不用于任何非法用途\n\n## 项目结构\n\n```\ncodex-red-team-prompt/\n├── README.md                       本文件\n├── AGENTS.md                       Codex 全局规则（24 章）\n├── system-prompt.md                Codex base instructions 替换\n├── config.toml                     Codex CLI 配置示例\n└── windsurf-global-rules.md        Windsurf 全局规则（27 章 精简版）\n```\n\n## 许可证\n\n本项目仅供学习和研究使用。\n\n## 免责声明\n\n使用者对本配置的使用承担全部责任。本项目不对任何滥用或非法使用负责。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1837620622%2Fcodex-red-team-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1837620622%2Fcodex-red-team-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1837620622%2Fcodex-red-team-prompt/lists"}