x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/information-gathering/tools/certgraph.md
View on GitHub# CertGraph
- **Category**: Information Gathering / Certificate Transparency
- **Risk Level**: 🟢 Low
---
## 描述
certgraph 通过爬取证书透明度日志和直接 TLS 连接来映射 SSL/TLS 证书关系。它沿着证书中的 Subject Alternative Names(SANs)按可配置深度递归发现关联域名,构建域名关系图。默认输出文本格式图,也支持 JSON 输出用于程序化处理。适用于发现关联域名、子公司和共享基础设施目标。使用 Go 编写。
## 安装
```bash
sudo apt install certgraph
certgraph -h
# 或通过 Go 安装
go install github.com/lanrat/certgraph@latest
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `<domain>` | 开始图爬取的种子域名(位置参数) |
| `-depth <n>` | 最大爬取深度(默认:5) |
| `-driver <name>` | 证书来源驱动:`http`(默认)、`crtsh`、`google` 或 `smtp` |
| `-json` | 以 JSON 格式输出结果 |
| `-ct-subdomains` | 包含 CT 日志中的子域名 |
| `-cdn` | 包含 CDN 域名(默认排除) |
| `-timeout <seconds>` | TCP 超时时间(秒)(默认:10) |
| `-parallel <n>` | 并行证书获取数量(默认:10) |
| `-save <dir>` | 将证书以 PEM 格式保存到目录 |
| `-details` | 打印详细证书信息 |
| `-dns` | 检查域名 DNS |
| `-verbose` | 详细日志输出 |
## 常用命令
### 场景一:基本证书关系图
```bash
# 生成证书关系图
certgraph example.com
# 限制爬取深度
certgraph -depth 2 example.com
# 将证书以 PEM 格式保存到目录
certgraph -save certs/ example.com
```
### 场景二:驱动选择
```bash
# 使用 crt.sh CT 日志(被动,不直接连接目标)
certgraph -driver crtsh example.com
# 使用直接 HTTP 连接(默认)
certgraph -driver http example.com
# 使用 Google CT 数据
certgraph -driver google example.com
# 查询 SMTP 服务器获取证书
certgraph -driver smtp example.com
```
### 场景三:JSON 输出
```bash
# 以 JSON 格式输出,便于程序化处理
certgraph -json example.com
# 将 JSON 保存到文件
certgraph -json example.com > certgraph_results.json
# JSON 输出带详细证书信息
certgraph -json -details example.com
```
### 场景四:全面发现
```bash
# 包含 CT 日志中的子域名
certgraph -ct-subdomains example.com
# 包含 CDN 域名(默认排除)
certgraph -cdn example.com
# 深度爬取并包含子域名和 CDN
certgraph -depth 3 -ct-subdomains -cdn example.com
```
### 场景五:性能调优
```bash
# 增加并行连接数以加快扫描
certgraph -parallel 20 -timeout 10 example.com
# 详细输出用于调试
certgraph -verbose -depth 2 example.com
```
## 注意事项
1. 默认深度 5 对大型域名可能产生非常大的图。建议从 `-depth 2` 开始,按需增加。
2. `crtsh` 驱动是被动的,不直接连接目标——需要隐蔽操作时使用。
3. `http` 驱动(默认)直接连接每个已发现域名的 443 端口——这会产生对目标可见的流量。
4. CDN 域名(Cloudflare、Akamai 等)默认排除,因为它们在多个不相关站点间共享证书。仅在 CDN 关系具有分析价值时使用 `-cdn`。
5. 使用 `-json` 输出配合 `jq` 进行程序化过滤和与其他工具集成。
---
## 官方参考
- [certgraph(GitHub)](https://github.com/lanrat/certgraph)
- [Kali certgraph](https://www.kali.org/tools/certgraph/)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |