Shannon 如何配置 exploit: false 只做漏洞分析而不执行真实利用?
【免费下载链接】shannonShannon is an AI pentester for web applications and APIs. It analyzes your source code, identifies attack vectors, and executes real exploits to prove vulnerabilities before they reach production.项目地址: https://gitcode.com/GitHub_Trending/shan/shannon
Shannon 是一个针对 Web 应用和 API 的 AI 渗透测试工具,默认会执行真实的利用(exploitation)阶段来证明漏洞。如果你只想让 Shannon 分析源代码和运行中的应用、产出漏洞分析报告,而不实际执行利用,可以在配置文件中设置exploit: "false"跳过利用阶段。适用前提与你正常运行 Shannon 相同:已准备好 Docker、Node.js 18+ 和 AI 提供商凭据,且只针对自己拥有或已获得明确授权的目标环境运行。
exploit 配置项的含义
在示例配置 example-config.yaml 中,该配置项默认被注释掉,说明其默认值为"true":
# Skip the exploitation phase (optional, default: "true") # exploit: "false"配置文件 JSON Schema 对exploit的定义也确认了这一点:
"exploit": { "type": "string", "enum": ["true", "false"], "description": "Whether to run the exploitation phase (default true). Set false to run only analysis." }两点值得注意:
- 值必须是字符串形式的
"true"或"false",不是布尔量; - Schema 的
anyOf条件允许配置文件只包含exploit一个字段,因此你不需要为了跳过利用阶段而写一整套认证配置。
创建配置并启动分析-only 扫描
配置文档给出的操作流程是:复制示例配置,修改后通过-c参数传给start命令。
cp configs/example-config.yaml ./my-app-config.yaml在生成的./my-app-config.yaml中,把exploit一行改为启用状态:
description: "Next.js e-commerce app on PostgreSQL. Local dev environment; .env files contain local-only credentials." # Skip the exploitation phase. exploit: "false"如果目标需要登录,再补充authentication部分;不需要认证的公开应用可以省略。然后按 配置文档 的命令启动:
# npx 模式 npx @keygraph/shannon start -u https://example.com -r /path/to/repo -c ./my-app-config.yaml# 源码构建模式 ./shannon start -u https://example.com -r /path/to/repo -c ./my-app-config.yaml其中-u是运行中的应用地址,-r是目标源代码仓库路径,-c指向你的配置文件。npx @keygraph/shannon setup交互式向导只负责凭据配置,不处理配置文件,两者互不替代。
分析-only 运行与完整运行在报告上的区别
设置exploit: "false"后,报告结构和评分维度都会变化。配置文档 的 Report Options 表格说明了这些差异:
| 配置项 | 生效条件 |
|---|---|
min_severity | 仅当exploit为"true"时生效,过滤低于该严重程度的发现 |
min_confidence | 仅当exploit为"false"时生效,过滤低于该置信度的发现 |
sarif | 生成 SARIF 2.1.0 日志,要求exploit: "true" |
文档对此的解释是:每个发现只携带一种评级——被利用过的发现按 severity 评级,纯分析发现按 confidence 评级。设置不适用的阈值会被忽略,并且 Shannon 会记录一条警告日志,指明应该改用哪一个。
因此在exploit: "false"的运行中:
- 报告过滤应使用
report.min_confidence(可选值low、medium、high),而不是min_severity; - 即使写了
report.sarif: "true"也不会生成report.sarif。分析-only 运行的发现按置信度评级、不产生严重度,SARIF 的level字段无内容可填,所以sarif在exploit为"false"时被直接忽略。
验证运行结果
扫描完成后,Shannon 把结果写入本地 workspace,最终报告为Security-Assessment-Report.md。可以通过报告内容确认利用阶段确实被跳过,判断依据来自报告渲染实现 report-renderer.ts:
- 报告元信息中包含
- Exploitation: disabled(完整运行则显示enabled); - 发现部分的标题从完整运行的 "Successfully Exploited Vulnerabilities" 变为 "Identified Vulnerabilities",章节名从 "Exploitation Evidence" 变为 "Findings";
- 报告开头带有固定的免责说明,明确本次未运行利用:
> Exploitation was not run for this assessment. Each finding documents a vulnerability > identified through analysis; impact is assessed rather than demonstrated, and no live > exploitation steps or proof of impact are included.看到这三处,即可确认本次运行是纯分析模式。
限制与注意事项
- 安全文档 强调 Shannon 不是被动扫描器,其利用代理会主动执行攻击、可能修改应用状态;
exploit: "false"跳过的正是这一阶段。但即使如此,仍只针对自己拥有或获得明确书面授权的环境运行。 - 完整运行通常耗时约 1 到 1.5 小时,LLM API 成本随模型定价、目标复杂度和并发度变化;Shannon 官方仅支持 Claude 模型,替代模型可能不完整或不稳定。
- 跳过利用阶段不等于报告没有验证要求:安全文档 指出最终报告仍可能包含支持不足或不准确的细节,人工复核仍是必要步骤。
- 如果需要同时限制漏洞类别,可与
vuln_classes组合使用,例如vuln_classes: [injection, xss]只运行列出的类别;这两项相互独立,vuln_classes省略时默认运行全部五个类别。
【免费下载链接】shannonShannon is an AI pentester for web applications and APIs. It analyzes your source code, identifies attack vectors, and executes real exploits to prove vulnerabilities before they reach production.项目地址: https://gitcode.com/GitHub_Trending/shan/shannon
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考