TyrusRC/custom-nuclei-templates
GitHub: TyrusRC/custom-nuclei-templates
一组基于行为特征的 Nuclei 自定义检测模板,通过框架结构和不变性行为而非单一 CVE 指纹来覆盖上游模板库的检测空白。
Stars: 0 | Forks: 0
# custom-nuclei-templates
[](https://github.com/TyrusRC/custom-nuclei-templates/actions/workflows/validate.yml)
[](LICENSE)
[](templates/)
[](https://github.com/projectdiscovery/nuclei)
常青的**漏洞类别/家族检测**模板 —— 这些模式可以捕获同一类别中*未来*的 CVE,而不是单个已命名的 CVE。旨在填补上游 [nuclei-templates](https://github.com/projectdiscovery/nuclei-templates) 和 [nuclei-templates-ai](https://github.com/projectdiscovery/nuclei-templates-ai) 集合中的空白。
## 为什么需要漏洞类别检测?
上游一旦发布特定 CVE 的模板,其指纹就很容易过时。此处的每个模板都依赖于**攻击者可见的行为**或**框架稳定的响应结构**(HAL `_links`、propertySources、route_id、JWKS 结构、HTTP 状态码差异等)—— 而不是厂商品牌字符串或版本标记。相同的 matcher 可在同一家族的下一个变种中重复生效。
示例:
- `http-cl0-desync-probe` 依赖于**状态结构不变性**(流水线化跟进时的 200/404 差异)—— 无论哪个厂商,只要存在 CL.0 漏洞的 FE/BE 对就会触发。
- `jwt-none-algorithm-accepted` 依赖于**金丝雀验收**,即使用带有 `nuclei-jwt-canary` sub 声明的 `alg:none` JWT —— 只要验证器省略了算法校验就会触发。
- `spring-actuator-heapdump-exposed` 依赖于 **HPROF 魔术字节** + `Content-Disposition: attachment*heapdump` —— 无论版本横幅如何,只要存在 Spring Boot 堆转储就会触发。
## 安装
```
git clone https://github.com/TyrusRC/custom-nuclei-templates.git
```
需要 [nuclei](https://github.com/projectdiscovery/nuclei) 扫描器 —— 已测试 `v3.4.7+` 版本。
## 使用
```
# 使用完整 custom 集扫描单个目标
nuclei -u https://target.example.com -t custom-nuclei-templates/templates/
# 按 custom tag 过滤(每个 template 都带有 'custom')
nuclei -u https://target.example.com -t custom-nuclei-templates/templates/ -tags custom
# 按 category 划分范围
nuclei -u https://target.example.com -t custom-nuclei-templates/templates/vulnerabilities/
nuclei -u https://target.example.com -t custom-nuclei-templates/templates/cloud/
# 按 severity 划分范围
nuclei -u https://target.example.com -t custom-nuclei-templates/templates/ -severity critical,high
```
每个模板的第一行都以 `# gap: ` 开头,用于记录其填补的上游空白。
## 分类
| 目录 | 数量 | 覆盖范围 |
|---|---|---|
| [`cloud/`](templates/cloud/) | 14 | AWS / GCP / Azure / Kubernetes 配置错误和未授权攻击面(IMDS、kubelet、etcd、匿名 API、OpenAPI 发现、ECR、S3、Cloud Run、Lambda、OPA Gatekeeper 绕过) |
| [`exposures/`](templates/exposures/) | 88 | Spring Boot actuator、Elasticsearch、Jenkins、Prometheus `/api/v1/targets`、Alertmanager、GraphQL、WEB-INF、`.git`/`.svn`、环境文件、开发工具、Envoy admin、OpenTelemetry zPages、Vault seal-status、Grafana Loki / Tempo、Linkerd dataplane、ArgoCD applications、Nomad jobs、Boundary auth-methods、Tekton PipelineRuns、Spinnaker applications、Istio Pilot debug、Flux CD HelmReleases、Crossplane Providers、LangServe Runnable、vLLM model list、n8n workflows、Backstage catalog、Kestra flows、Pulsar tenants、APISIX admin、Trino cluster、Druid coordinator、Redpanda brokers、Dify console、Flowise chatflows、Doris FE、InfluxDB v2 buckets、QuestDB `/exec`、Kafka Connect、Apache Pinot、SigNoz services、Milvus REST API (CVE-2026-26190)、MCP streamable-http `tools/list`、Grafana MCP SSE handshake、llama.cpp `/props`+`/slots` prompt 泄露、Open WebUI `/api/config` OAuth 泄露、PraisonAI `/agents` (CVE-2026-44338)、Argo CD `/api/v1/settings` 过度泄露、Next.js 生产环境 source maps、Supabase PostgREST schema 发现、Firebase RTDB 浅读取、PocketBase 匿名 collections、Hasura 匿名 introspection、Directus public-role collections、Vite dev-server ping、SvelteKit `__data.json` server-loader 泄露、Spring Boot Admin (codecentric) aggregator、gRPC server reflection、WireMock `__admin/mappings`、Open Policy Agent `/v1/policies`、Chrome DevTools Protocol `/json/version`、Velero K8s backups、Apache ZooKeeper AdminServer |
| [`misconfigurations/`](templates/misconfigurations/) | 38 | CORS、安全标头、OWASP WSTG、默认凭据、h2c upgrade、JWKS 对称密钥、GraphQL 字段建议、OAuth PKCE plain / implicit / password-grant 公开、OAuth 动态客户端注册、基于 HTTP 的 OAuth jwks_uri、匿名 OIDC userinfo、CSP 实际被禁用、CSP frame-ancestors 宽松设置、Service Worker root-scope、ASP.NET ViewState MAC 被禁用、OIDC discovery 不安全签名算法 (alg=none/HS256/PKCE-plain)、JWKS 弱 RSA 模数 / alg=none / 公开对称密钥 |
| [`takeovers/`](templates/takeovers/) | 9 | 子域接管指纹(Heroku、Netlify、Shopify 等) |
| [`vulnerabilities/`](templates/vulnerabilities/) | 41 | 主动行为类别探测 —— SSTI(主动算术 + 错误引擎 + 布尔错误差异 + `.zxy.zxy` polyglot Vladko312 2026 + Handlebars helper-execution + Liquid `times` 过滤器)、SQL 注入报错(MySQL/Postgres/MSSQL/Oracle/SQLite/DB2/Sybase)、OS 命令注入时间盲注、JWT kid 路径遍历、CRLF、SSRF/IMDS、开放重定向(URL / Referer / 通配符 redirect_uri)、JWT alg-none、NoSQL 操作符注入、XPath / LDAP 注入报错泄露、PHP unserialize 报错泄露、WebDAV PROPFIND 列表、XXE、原型污染、Milvus /expr RCE (CVE-2026-26190)、host-header 密码重置投毒、请求走私家族(CL.TE、CL.0、CSD、host-header 混淆、来自 PortSwigger 2025 的 Expect-header 0.CL 泄露)、Web 缓存欺骗、通过未加索引的 X-Forwarded-Host 进行 Web 缓存中毒、路径规范化鉴权绕过(`..;/`、`%2f`、`%2e%2e`)、GraphQL 深度递归 `__type` introspection DoS、GraphQL 别名过载放大、Next.js RSC Flight 反序列化 (CVE-2025-66478)、h2c 明文 upgrade 走私(Bishop Fox 类别)、JSONP 回调标识符注入 (XSSI)、SAML RelayState 开放重定向、Ollama 匿名推理(主动金丝雀)、LiteLLM 匿名补全(主动金丝雀) |
## 检测范式
| 层级 | 依据特征 | 示例 |
|---|---|---|
| **行为** | 金丝雀回显、响应结构不变性、解析器差异状态码 | JWT 金丝雀 sub、原型污染 `nucleiPollute`、CL.0 跟进 404 |
| **框架结构** | 跨版本保持不变的 API 契约 | HAL `_links`、Spring `propertySources`、K8s `NamespaceList` |
| **魔术字节 / 标准格式** | 文件格式不变性 | HPROF `JAVA PROFILE 1.0.2`、JSON Web Key Set 结构 |
| **严重性准则** | 仅在未授权 RCE、内存中机密泄露、源码披露、接管、鉴权绕过、cluster-admin RBAC 时判定为 `critical` | 严重性检查强制要求说明理由的关键词(见 [`scripts/severity-lint.sh`](scripts/severity-lint.sh)) |
我们**避免**使用的特征:
- 厂商品牌字符串(`Powered by Foo 1.2.3`)
- 将版本横幅(`Server: Apache/2.4.41`)作为主要检测依据
- 特定 CVE-ID 的路径(`/vuln-2024-xxxxx`)
- 容易在文档/调试页面上误报的松散 `contains(both)` 匹配
## 开发
```
make help # list targets
make validate # nuclei -validate -t templates/
make lint # yamllint
make severity-lint # flag critical without justifying keyword
make template-meta-lint # enforce # gap line / id / author / tags
make test # bats unit tests
make ci # all of the above
make index # rebuild docs/upstream-index/ from both upstream repos
make check-dup ID= # confirm an id is not already upstream
make stats # counts by category and severity
```
新模板必须:
1. 通过 `make check-dup ID=` 与上游两个仓库进行**去重**(首先使用 `make index` 重建索引)。
2. **以行为为依据**,而不是厂商品牌字符串或单个 CVE 标记。
3. **通过 `make ci`**(validate + yamllint + severity-lint + meta-lint + bats)。
4. 第一行以 `# gap: ` 开头。
5. 使用 `custom` 标签加上一个类别标签(`vulnerabilities`、`misconfig`、`cloud`、`exposure`、`takeover`)。
严重性校准是强制执行的 —— `critical` 要求在描述中包含属于 `unauth.*rce`、`in-memory secret`、`heap dump`、`source disclosure`、`account takeover`、`auth bypass`、`cluster-admin`、`arbitrary command` 等家族的关键词。有关完整的正则表达式,请参阅 [`scripts/severity-lint.sh`](scripts/severity-lint.sh)。
## CI
每次向 `main` 分支的推送 / PR 都会通过 [`.github/workflows/validate.yml`](.github/workflows/validate.yml) 运行完整的流水线:
- `yamllint` 语法检查
- `nuclei -validate` 语义检查
- `severity-lint` 校准检查
- `template-meta-lint` 元数据规范检查
- `bats` 去重脚本单元测试
## 许可证
[Apache 2.0](LICENSE)。
## 致谢
- [ProjectDiscovery](https://github.com/projectdiscovery) —— 感谢其提供的 `nuclei` 扫描器以及本仓库所补充的上游模板生态系统
- [PortSwigger Research](https://portswigger.net/research) —— 感谢其为 desync 家族模板提供支持的请求走私、反同步、JWT 和缓存中毒研究
- [OWASP WSTG](https://owasp.org/www-project-web-security-testing-guide/) —— 感谢其为配置错误探测提供的方法论
- [Reversec Labs](https://labs.reversec.com/) —— 感谢其进行的 OPA Gatekeeper 绕过研究
## 商标
"Nuclei" 和 "nuclei-templates" 是 [ProjectDiscovery](https://projectdiscovery.io) 的项目。所有引用仅用于指代目的和互操作性。
标签:Google, Nuclei, 主机安全, 密码管理, 应用安全, 插件系统, 规则模板