
社区版 Nuclei 模板,一个简单的工具,让你可以将社区提供的所有 Nuclei 模板集中在一个地方。
go install -v github.com/xm1k3/cent/v2@latest
安装后运行 cent init,使用你可在此处找到的配置文件来初始化 cent。
Flags:
--config string config file (default is .config/cent/.cent.yaml)
-r, --by-repo Group templates by repository (use with -k)
-C, --console Print console output
-k, --keep-folders Keep templates organized in folders by category
-p, --path string Root path to save the templates (default "cent-nuclei-templates")
-t, --threads int Number of threads to use when cloning repositories (default 10)
-T, --timeout int Timeout in minutes for each git clone (default 2)
cent -h
cent check -h
cent init -h
cent update -h
cent summary -h
cent validate -h
cent version
将所有社区模板克隆并插入到 cent-nuclei-templates 文件夹中
cent -p cent-nuclei-templates
输出示例:
cent started
[CLONED] https://github.com/projectdiscovery/nuclei-templates
[CLONED] https://github.com/0xSojalSec/nuclei-templates-4
[CLONED] https://github.com/0xPugazh/my-nuclei-templates
[CLONED] https://github.com/0xSojalSec/my-nuclei-templates-1
[CLONED] https://github.com/0x727/ObserverWard
[CLONED] https://github.com/0xAwali/Blind-SSRF
[CLONED] https://github.com/0x727/ObserverWard_0x727
[CLONED] https://github.com/0xAwali/Virtual-Host
[CLONED] https://github.com/0xSojalSec/Nuclei-Templates-API-Linkfinder
...
...
...
cent finished, you can find all your nuclei-templates in cent-nuclei-templates
使用 -k 标志保留每个仓库的内部文件夹结构:
cent -p cent-nuclei-templates -k
这将创建一个类似如下的文件夹结构:
cent-nuclei-templates/
cves/
CVE-2021-1234.yaml
vulnerabilities/
template.yaml
others/
uncategorized-template.yaml
没有源仓库子文件夹的模板会被放在 others/ 中。
使用 -k -r 可按源仓库对模板进行分组:
cent -p cent-nuclei-templates -k -r
cent-nuclei-templates/
projectdiscovery/nuclei-templates/
cves/
CVE-2021-1234.yaml
vulnerabilities/
template.yaml
user/repo-name/
others/
custom-template.yaml
summary 命令提供有关你的 nuclei 模板集合的详细统计信息:
# Display summary in table format
cent summary
# Display summary in JSON format
cent summary --json
# Limit number of tags displayed (default: 25)
cent summary --limit 10
# Search for specific data in summary
cent summary --search cve
cent summary --search wordpress
cent summary --search critical
# Update summary data
cent summary update
# Update with custom path
cent summary update -p /path/to/templates
=== NUCLEI TEMPLATES SUMMARY ===
+-------------------+-------+
| METRIC | COUNT |
+-------------------+-------+
| Total Templates | 3249 |
| CVE Templates | 3821 |
| Invalid Templates | 1 |
| Valid Templates | 3248 |
+-------------------+-------+
=== SEVERITY DISTRIBUTION ===
+----------+-------+
| SEVERITY | COUNT |
+----------+-------+
| CRITICAL | 582 |
| HIGH | 877 |
| MEDIUM | 877 |
| LOW | 63 |
| INFO | 744 |
+----------+-------+
=== TOP TAGS ===
+---------------+-------+
| TAG | COUNT |
+---------------+-------+
| cve | 1909 |
| xss | 569 |
| wordpress | 487 |
| lfi | 459 |
| wp-plugin | 450 |
+---------------+-------+
{
"metrics": {
"total_templates": 3249,
"cve_templates": 3821,
"invalid_templates": 1,
"valid_templates": 3248
},
"severity_distribution": {
"CRITICAL": 582,
"HIGH": 877,
"MEDIUM": 877,
"LOW": 63,
"INFO": 744
},
"tags": {
"cve": 1909,
"xss": 569,
"wordpress": 487
},
"last_updated": "2024-01-15 14:30:25"
}
如果你通过添加新文件夹更新了 cent.yaml 文件
exclude-dirs:
- ...
- dns
- ...
只需执行:
cent update -p cent-nuclei-templates -d
cent 将自动删除 cent-nuclei-templates 中所有 dns 文件夹,而无需克隆所有 GitHub 仓库。
输出示例:
[D][-] Dir removed cent-nuclei-templates/dns
[D][-] Dir removed cent-nuclei-templates/dns/subdomain
exclude-files 同理:
cent update -p cent-nuclei-templates -f
# Initialize with default configuration
cent init
# Initialize with custom URL
cent init --url https://example.com/config.yaml
# Overwrite existing configuration
cent init --overwrite
# Check if configuration file exists
cent init check
# Check if all template repositories are accessible
cent check
# Remove inaccessible repositories from config
cent check --remove
一旦 cent 配置正确,你就可以使用 Nuclei 进行扫描。
示例
nuclei -u https://example.com -t ./cent-nuclei-templates -tags cve
nuclei -l urls.txt -t ./cent-nuclei-templates -tags cve
有关 Nuclei 的更多文档,请参见此处。
你需要在 .config/cent/.cent.yaml 中配置 cent 参数。
# Directories to exclude
exclude-dirs:
- .git
# Files to exclude
exclude-files:
- README.md
- .gitignore
- .pre-commit-config.yaml
- LICENSE
# Add github urls (simple format)
community-templates:
- https://github.com/projectdiscovery/nuclei-templates
- https://github.com/other/repo
# Extended format: pin a repo to a specific commit
- url: https://github.com/user/repo
commit: abc123f
# Extended format: per-repo exclude
- url: https://github.com/user/repo2
exclude:
- "workflows/"
- "fuzzing/"
这两种格式可以在同一个配置文件中混合使用。当指定了 commit 时,cent 将克隆完整的仓库并检出该特定提交,而不是使用浅克隆。每个仓库的 exclude 会过滤掉该特定仓库中匹配的路径。
免责声明:本工具的开发者不对社区如何使用其中收集的开源模板负责。这些模板未经 Project Discovery 验证,按原样提供。
Cent 依据 Apache-2.0 许可证分发。
| 命令 |
|---|
| 描述 |
|---|
| check | 检查模板仓库是否仍然可用 |
| init | 初始化 cent 配置文件 |
| summary | 打印 nuclei 模板的详细摘要 |
| update | 更新你的仓库 |
| validate | 校验模板,如果模板无效则将其从文件夹中删除 |
| version | 打印 cent 版本 |