Communitygithub.com

代碼審計

用於授權原始碼安全審查及 SAST 工作流程,包含 Semgrep、CodeQL 模式、危險 API 搜尋與修復驗證。

代碼審計 是什麼?

此技能專為授權的原始碼安全審查設計,支援白盒審計、PR 差異安全審查等場景。它整合了 Semgrep、CodeQL、Bandit、gosec 等多種 SAST 工具,能自動掃描危險 API、注入點、鑑權缺失與加密誤用等安全問題。工作流程包含威脅建模、自動掃描、人工驗證(必備),並產出包含位置、資料流、PoC 與修復建議的報告。此技能專注於自有程式碼邏輯的安全,與供應鏈安全、API 安全等技能分工明確,支援多語言與平台。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/zhaoxuya520/reverse-skill/tree/main/skills/code-audit

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

原始碼安全審計

立即行動(讀完後立刻執行)

  1. NOW:讀取 ../field-journal/precedent-pentest.md 或代碼審計授權
  2. NOW:確認有原始碼/倉庫存取權限(無原始碼二進位 → 轉 RE skill)
  3. NOW:明確語言棧與範圍(目錄/服務/PR diff)
  4. NEXT:tool-index;semgrep 等
  5. ACT:威脅建模草圖 → 自動掃描 → 人工驗證

適用場景

  • 白盒審計、PR/差分安全審查
  • Semgrep / CodeQL / Bandit / gosec 等 SAST
  • 危險 API、注入點、鑑權缺失、加密誤用
  • 與 supply-chain-security/ 分工:本 skill 偏自有程式碼邏輯,供應鏈偏依賴與管道

工作流

1. 範圍與威脅模型

□ 信任邊界:使用者輸入、檔案、反序列化、SSRF、鑑權中介軟體
□ 高價值資產:鑑權、支付、管理端、金鑰處理

2. 自動掃描

semgrep --config auto .
# 或專案規則包
semgrep --config p/owasp-top-ten .

3. 人工驗證(必備)

□ 每個 SAST 命中:可達性?可利用性?誤報?
□ 鑑權:IDOR/越權、缺校驗、錯誤的多租戶隔離
□ 注入:SQL/命令/範本/LDAP
□ 加密:硬編碼金鑰、ECB、自訂 crypto

4. 產出

Finding:位置 + 資料流 + PoC + 修復建議
可選 ATT&CK / CWE 編號

工具鏈

工具語言/場景
Semgrep多語言快速規則
CodeQL深資料流(GitHub)
BanditPython
gosec / staticcheckGo
SpotBugs / FindSecBugsJava

參考

  • references/sast-review-checklist.md
  • ../supply-chain-security/ ../api-security/ ../llm-security/(Agent 代碼)

路由上下文

上游: MASTER R26
角色: ops/role-map.md cae
下游: 依賴漏洞 → supply-chain;執行時驗證 → pentest-tools

任務完成自檢

  • 是否人工驗證而非只貼掃描器輸出?
  • 是否包含修復建議?
  • 是否限定在授權倉庫範圍?
  • Checklist?

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing.

apk-reverse

在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。

attack-chain

Use for authorized multi-stage attack-path planning and orchestration when a task spans reconnaissance, initial access, privilege escalation, lateral movement, or impact assessment. Route single-stage tasks directly to their specialist skill.

binary-diff

|

binary-ninja-reverse

Use for authorized binary analysis in Binary Ninja, including HLIL/MLIL/LLIL inspection, strings/imports/exports, cross-references, types, patch review, Python API automation, and optional Binary Ninja MCP or localhost HTTP integration.

browser-automation

|

browser-extension-reverse

Use for authorized reverse engineering of browser extensions (Chrome/Firefox) including manifest analysis, background workers, and extension-based credential or traffic logic recovery.

case-review

Reviews a reverse-skill case package for scope readiness, Evidence to Finding to Path traceability, work item coverage, timeline references, and optional artifact hash integrity before report handoff.

cloud-k8s

Use for authorized cloud, container, and Kubernetes security assessment including metadata SSRF, IAM misconfig, container escape paths, and cluster RBAC review.

ctf-sandbox

Thin PRIMARY for CTF / AWD / 靶场 multi-type orchestration. Hands off to the sidecar CTF-Sandbox-Orchestrator. Use when the user says CTF, AWD, 靶场, or 比赛题 and no more specific pwn/APK/IDA route already won.

database-security

Use for authorized database security assessment covering PostgreSQL/MySQL/MSSQL/Mongo/Redis exposure, authz, UDF/command paths, and misconfiguration review.

diagram-generator

generate, refine, validate, and render diagrams from natural language, notes, code snippets, schemas, tables, or existing diagram source. use for flowcharts, swimlanes, sequence diagrams, state diagrams, er diagrams, class diagrams, architecture/c4-style diagrams, dependency graphs, gantt charts, mind maps, user journeys, sankey-style flows, org charts, network graphs, and other visual models. supports mermaid by default, graphviz dot for complex graph layout, plantuml for uml-heavy engineering diagrams, and svg output when direct markup is more reliable.

digital-forensics

Use for authorized digital forensics including memory dumps, disk timelines, PCAP investigation, artifact triage, and IR evidence preservation.

docs-generator

|

dotnet-reverse

.NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp* 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy MCP。不用于纯 native 二进制(走 reverse-engineering / ida-reverse)。

edr-bypass-re

|

email-security

Use for authorized email security review including phishing analysis, header authentication (SPF/DKIM/DMARC), BEC patterns, and mailbox token abuse research.

firmware-pentest

|

ghidra-reverse

Use for free/open reverse engineering with Ghidra (headless or GUI), including decompile, cross-refs, and optional Ghidra MCP workflows when IDA is unavailable.

go-rust-reverse

Use for reverse engineering stripped Go and Rust binaries including runtime recognition, pclntab/moduel data recovery, panic strings, and idiomatic decompilation recovery.

相關技能