Code Audit 标志

Code Audit

社区
3stoneBrother
code-audit

Professional code security audit skill covering 55+ vulnerability types. Enhanced with WooYun 88,636 real-world vulnerability cases (2010-2016). This skill should be used when performing security audits, vulnerability scanning, penetration testing preparation, or code review for security issues. Supports 9 languages: Java, Python, Go, PHP, JavaScript/Node.js, C/C++, .NET/C#, Ruby, Rust. Includes 143 mandatory detection items across all languages with language-specific checklists. Covers SQL injection, XSS, RCE, deserialization, SSRF, JNDI injection, JDBC protocol injection, authentication bypass, business logic flaws, race conditions, and modern security domains (LLM, Serverless, Android). WooYun integration adds: statistical-driven parameter priority, bypass techniques library, logic vulnerability patterns, and real-case references. v1.0: Initial public release with Docker deployment verification framework.

概览

发布者3stoneBrother
代码仓库code-audit
技能名称code-audit
星标数
891
复刻数
138
附带文件
112
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 112 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 3stoneBrother 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Code Audit AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/3stoneBrother/code-audit/tree/main
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/3stoneBrother/code-audit.git \
  .claude/skills/code-audit
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Code Audit,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Code Audit。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Code Audit 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Code Audit Skill

专业代码安全审计技能 | Professional Code Security Audit 支持模式: quick / standard / deep

When to Use This Skill

This skill should be used when:

  • User requests code audit, security audit, or vulnerability scanning
  • User asks to check code security or find security issues
  • User mentions /audit or /code-audit
  • User wants to review code for vulnerabilities before deployment
  • User needs penetration testing preparation or security assessment

Trigger phrases:

  • "审计这个项目" / "Audit this project"
  • "检查代码安全" / "Check code security"
  • "找出安全漏洞" / "Find security vulnerabilities"
  • "/audit", "/code-audit"

Quick Reference

Scan Modes

ModeUse CaseScope
QuickCI/CD, small projectsHigh-risk vulns, secrets, dependency CVEs
StandardRegular auditsOWASP Top 10, auth, crypto
DeepCritical projects, pentestsFull coverage, attack chains, business logic

Core Workflow

1. Reconnaissance   → Identify tech stack, map attack surface
2. Vulnerability Hunt → Search patterns, trace data flow
3. Verification    → Confirm exploitability, filter false positives
4. Docker Verify   → [NEW] Dynamic verification in sandbox (optional)
5. Report          → Document findings with PoC and fixes

Docker部署验证

对于深度审计,可使用Docker沙箱进行动态验证:

bash
# 生成验证环境
code-audit --generate-docker-env

# 启动并验证
docker-compose up -d
docker exec -it sandbox python /workspace/poc/verify_all.py

详见: references/core/docker_verification.md


Execution Controller(执行控制器 — 必经路径)

⚠️ 以下步骤是审计执行的必经路径,不是参考建议。 每步有必须产出的输出,后续步骤依赖前序输出。不产出 = 用户可见缺失。

Step 1: 模式判定

根据用户指令确定审计模式:

用户指令关键词模式
"快速扫描" "quick" "CI检查"quick
"审计" "扫描" "安全检查"(无特殊说明)standard
"深度审计" "deep" "渗透测试准备" "全面审计"deep
无法判定问用户,不得自行假设

反降级规则: 用户指定的模式不可自行降级。项目规模大不是降级理由,而是启用 Multi-Agent 的理由。降级需用户明确确认。

必须输出:

[MODE] {quick|standard|deep}

Step 2: 文档加载

按模式加载必要文档(用 Read 工具实际读取,不是"知道有这个文件"):

模式必须 Read 的文档
quick当前 SKILL.md 已加载,无需额外文档
standard+ references/checklists/coverage_matrix.md + 对应语言 checklist
deep+ agent.md(完整读取,不可跳过) + coverage_matrix.md + 对应语言 checklist

deep 模式下 agent.md 是必读文档 — Step 4 的执行计划模板包含只有 agent.md 中才有的字段(维度权重、Agent 切分模板、门控条件、执行状态机)。

必须输出:

[LOADED] {实际 Read 的文档列表,含行数}

Step 3: 侦察(Reconnaissance)

对目标项目执行攻击面测绘。

必须输出:

[RECON]
项目规模: {X files, Y directories}
技术栈: {language, framework, version}
项目类型: {CMS | 金融 | SaaS | 数据平台 | 身份认证 | IoT | 通用Web}
入口点: {Controller/Router/Handler 数量}
关键模块: {列表}

Step 4: 执行计划 → STOP

基于 Step 1-3 的输出生成执行计划。输出后暂停,等待用户确认才能继续。

quick/standard 模板:

[PLAN]
模式: {mode}
技术栈: {from Step 3}
扫描维度: {计划覆盖的 D1-D10 维度}
已加载文档: {from Step 2}

deep 模板(全部字段必填 — 标注了信息来源文档):

[PLAN]
模式: deep
项目规模: {from Step 3}
技术栈: {from Step 3}
维度权重: {from agent.md 状态机 → 项目类型维度权重,如 CMS: D5(++), D1(+), D3(+), D6(+)}
Agent 方案: {from agent.md Agent 模板 → 每个 Agent 负责的维度和 max_turns}
Agent 数量: {from agent.md 规模建议 → 小型(<10K) 2-3, 中型(10K-100K) 3-5, 大型(>100K) 5-9}
D9 覆盖策略: {若项目有后台管理/多角色/多租户 → D9 必查,D3 Agent 须同时覆盖 D9a(IDOR+权限一致性+Mass Assignment)}
轮次规划: R1 广度扫描 → R1 评估 → R2 增量补漏(按需)
门控条件: PHASE_1_RECON → ROUND_N_RUNNING → ROUND_N_EVALUATION → REPORT
预估总 turns: {Agent数 × max_turns}
已加载文档: {from Step 2}

⚠️ STOP — 输出执行计划后暂停。等待用户确认后才能开始审计。

Step 5: 执行

用户确认后,按执行计划和已加载文档执行:

  • quick: 高危模式匹配扫描,直接输出
  • standard: 按 Phase 1→5 顺序执行
  • deep: 严格按 agent.md 执行状态机
    • 启动 Multi-Agent 并行(按 Step 4 确认的 Agent 方案)
    • 遵守每个 State 的门控条件
    • 轮次评估使用 agent.md 三问法则

Step 6: 报告门控

生成报告前验证:

前置条件quickstandarddeep
高危模式扫描完成✅✅✅
D1-D10 覆盖率标记(✅已覆盖/⚠️浅覆盖/❌未覆盖)—✅✅
所有 Agent 完成或超时标注——✅
轮次评估三问通过——✅

不满足前置条件 → 不得生成最终报告。


Anti-Hallucination Rules (MUST FOLLOW)

⚠️ Every finding MUST be based on actual code read via tools

✗ Do NOT guess file paths based on "typical project structure"
✗ Do NOT fabricate code snippets from memory
✗ Do NOT report vulnerabilities in files you haven't read

✓ MUST use Read/Glob to verify file exists before reporting
✓ MUST quote actual code from Read tool output
✓ MUST match project's actual tech stack

Core principle: Better to miss a vulnerability than report a false positive.


Anti-Confirmation-Bias Rules (MUST FOLLOW)

⚠️ Audit MUST be methodology-driven, NOT case-driven

✗ Do NOT say "基于之前的审计经验,我将重点关注..."
✗ Do NOT prioritize certain vuln types based on "known CVEs"
✗ Do NOT skip checklist items because they seem "less likely"

✓ MUST enumerate ALL sensitive operations, then verify EACH one
✓ MUST complete the full checklist for EACH vulnerability type
✓ MUST treat all potential vulnerabilities with equal rigor

Core principle: Discover ALL potential vulnerabilities, not just familiar patterns.


Two-Layer Checklist (两层检查清单)

Layer 1: coverage_matrix.md — Phase 2A后加载,验证10个安全维度覆盖率 Layer 2: 语言语义提示 — 仅对未覆盖维度按需加载对应段落

文件用途
references/checklists/coverage_matrix.md覆盖率矩阵 (D1-D10)
references/checklists/universal.md通用架构/逻辑级语义提示
references/checklists/java.mdJava 语义提示 (10维度)
references/checklists/python.mdPython 语义提示
references/checklists/php.mdPHP 语义提示
references/checklists/javascript.mdJavaScript/Node.js 语义提示
references/checklists/go.mdGo 语义提示
references/checklists/dotnet.md.NET/C# 语义提示
references/checklists/ruby.mdRuby 语义提示
references/checklists/c_cpp.mdC/C++ 语义提示
references/checklists/rust.mdRust 语义提示

核心原则: Checklist 不驱动审计,而是验证覆盖。LLM 先自由审计(Phase 2A),再用矩阵查漏(Phase 2B)。


Module Reference

Core Modules (Load First)

ModulePathPurpose
Capability Baselinereferences/core/capability_baseline.md防止能力丢失的回归测试框架
Anti-Hallucinationreferences/core/anti_hallucination.mdPrevent false positives
Audit Methodologyreferences/core/comprehensive_audit_methodology.mdSystematic framework, coverage tracking
Taint Analysisreferences/core/taint_analysis.mdData flow tracking, LSP-enhanced tracking, Slot type classification
PoC Generationreferences/core/poc_generation.mdVerification templates
External Toolsreferences/core/external_tools_guide.mdSemgrep/Bandit integration

Language Modules (Load by Tech Stack)

LanguageModuleKey Vulnerabilities
Javareferences/languages/java.mdSQL injection, XXE, deserialization
Pythonreferences/languages/python.mdPickle, SSTI, command injection
Goreferences/languages/go.mdRace conditions, SSRF
PHPreferences/languages/php.mdFile inclusion, deserialization
JavaScriptreferences/languages/javascript.mdPrototype pollution, XSS

Security Domain Modules (Load as Needed)

DomainModuleWhen to Load
API Securityreferences/security/api_security.mdREST/GraphQL APIs
LLM Securityreferences/security/llm_security.mdAI/ML applications
Serverlessreferences/security/serverless.mdAWS Lambda, Azure Functions
Cryptographyreferences/security/cryptography.mdEncryption, TLS, JWT
Race Conditionsreferences/security/race_conditions.mdConcurrent operations

Tool Priority Strategy

Priority 1: External Professional Tools (if available)
├─ semgrep scan --config auto          # Multi-language SAST
├─ bandit -r ./src                      # Python security
├─ gosec ./...                          # Go security
└─ gitleaks detect                      # Secret scanning

Priority 2: Built-in Analysis (always available)
├─ LSP semantic analysis                # goToDefinition, findReferences, incomingCalls
├─ Read + Grep pattern matching         # Core analysis
└─ Module knowledge base                # 55+ vuln patterns

Priority 3: Verification
├─ PoC templates from references/core/poc_generation.md
└─ Confidence scoring from references/core/verification_methodology.md

Detailed Documentation

For complete audit methodology, vulnerability patterns, and detection rules, see:

  • Full Workflow: agent.md - Complete audit process and detection commands
  • Vulnerability Details: references/ - Language/framework-specific patterns
  • Tool Integration: references/core/external_tools_guide.md
  • Report Templates: references/core/taint_analysis.md

Version

  • Current: 1.0
  • Updated: 2026-02-13

v1.0 (Initial Public Release)

  • 9语言143项强制检测清单 (references/checklists/)
  • 双轨并行审计框架: Sink-driven + Control-driven + Config-driven
  • Docker部署验证框架 (references/core/docker_verification.md)
  • WooYun 88,636案例库集成
  • 安全控制矩阵框架

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

还有 52 个文件。

常见问题

Code Audit AI 技能有什么作用?

Professional code security audit skill covering 55+ vulnerability types. Enhanced with WooYun 88,636 real-world vulnerability cases (2010-2016). This skill should be used when performing security audits, vulnerability scanning, penetration testing preparation, or code review for security issues. Supports 9 languages: Java, Python, Go, PHP, JavaScript/Node.js, C/C++, .NET/C#, Ruby, Rust. Includes 143 mandatory detection items across all languages with language-specific checklists. Covers SQL injection, XSS, RCE, deserialization, SSRF, JNDI injection, JDBC protocol injection, authentication b...

为什么在 TypingMind 中使用 Code Audit?

因为您只需安装一次,就能搭配任何模型使用。Code Audit 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Code Audit?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/3stoneBrother/code-audit/tree/main。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Code Audit?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Code Audit 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Code Audit 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Code Audit AI 技能免费吗?

3stoneBrother 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇