/cybersecurity-skills-zh:performing-subdomain-enumeration-with-subfinderfrom cybersecurity-skills-zh
Enumerates subdomains for a target domain using ProjectDiscovery's Subfinder passive reconnaissance tool, mapping the attack surface during security assessments.
Ships in cybersecurity-skills-zh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest)$HOME/.config/subfinder/provider-config.yaml 中的提供商配置文件# 安装 subfinder
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
# 验证安装
subfinder -version
# 配置 API 密钥以获得更好的结果
mkdir -p $HOME/.config/subfinder
cat > $HOME/.config/subfinder/provider-config.yaml << 'EOF'
shodan:
- YOUR_SHODAN_API_KEY
censys:
- YOUR_CENSYS_API_ID:YOUR_CENSYS_API_SECRET
virustotal:
- YOUR_VT_API_KEY
securitytrails:
- YOUR_ST_API_KEY
chaos:
- YOUR_CHAOS_API_KEY
EOF
# 单域名枚举
subfinder -d example.com -o subdomains.txt
# 从文件枚举多个域名
subfinder -dL domains.txt -o all_subdomains.txt
# 使用所有被动源(较慢但更彻底)
subfinder -d example.com -all -o subdomains_all.txt
# 静默模式,用于管道传输到其他工具
subfinder -d example.com -silent | httpx -silent -status-code
# 仅使用特定源
subfinder -d example.com -s crtsh,virustotal,shodan -o filtered.txt
# 排除特定源
subfinder -d example.com -es github -o results.txt
# 启用递归子域名枚举
subfinder -d example.com -recursive -o recursive_subs.txt
# 匹配特定模式
subfinder -d example.com -m "api,dev,staging" -o matched.txt
# 速率限制以避免 API 节流
subfinder -d example.com -rate-limit 10 -t 5 -o rate_limited.txt
# JSON 输出用于程序化处理
subfinder -d example.com -oJ -o subdomains.json
# 带来源信息输出
subfinder -d example.com -cs -o subdomains_with_sources.txt
# 按域名收集结果到目录
subfinder -dL domains.txt -oD ./results/
# 将 subfinder 输出管道传输到 httpx 进行实时验证
subfinder -d example.com -silent | httpx -silent -status-code -title -tech-detect -o live_hosts.txt
# 检查特定端口
subfinder -d example.com -silent | httpx -ports 80,443,8080,8443 -o web_services.txt
# 解析 IP 地址
subfinder -d example.com -silent | dnsx -a -resp -o resolved.txt
# 与 nuclei 链接进行漏洞扫描
subfinder -d example.com -silent | httpx -silent | nuclei -t cves/ -o vulns.txt
# 与 amass 结合进行综合枚举
subfinder -d example.com -o subfinder_results.txt
amass enum -passive -d example.com -o amass_results.txt
cat subfinder_results.txt amass_results.txt | sort -u > combined_subdomains.txt
# 对发现的主机截图
subfinder -d example.com -silent | httpx -silent | gowitness file -f - -P screenshots/
| 概念 | 定义 |
|---|---|
| 被动枚举(Passive Enumeration) | 在不直接查询目标 DNS 服务器的情况下发现子域名 |
| 证书透明度(Certificate Transparency) | 揭示子域名名称的 SSL/TLS 证书公共日志 |
| DNS 聚合(DNS Aggregation) | 从多个被动 DNS 数据库收集子域名数据 |
| 递归枚举(Recursive Enumeration) | 发现子域名的子域名以实现更深层覆盖 |
| 源提供商(Source Providers) | 为子域名情报查询的外部 API 和数据库 |
| CNAME 记录 | 可能揭示额外基础设施的规范名称记录 |
| 通配符 DNS(Wildcard DNS) | 为任何子域名查询返回结果的 DNS 配置 |
| 工具 | 用途 |
|---|---|
| Subfinder | 主要的被动子域名枚举引擎 |
| httpx | 用于验证活跃子域名的 HTTP 探测工具 |
| dnsx | DNS 解析和验证工具包 |
| Nuclei | 用于发现主机的基于模板的漏洞扫描器 |
| Amass | 具有主动/被动模式的互补子域名枚举工具 |
| gowitness | 用于视觉侦察的 Web 截图工具 |
| Shodan | 用于子域名情报的全网扫描数据库 |
| crt.sh | 证书透明度日志搜索引擎 |
## 子域名枚举报告
- **目标域名**:example.com
- **发现子域名总数**:247
- **活跃主机**:183
- **唯一 IP 地址**:42
- **使用的源**:crt.sh、VirusTotal、Shodan、SecurityTrails、Censys
### 发现的子域名
| 子域名 | IP 地址 | 状态码 | 技术 |
|-----------|-----------|-------------|------------|
| api.example.com | 10.0.1.5 | 200 | Nginx, Node.js |
| staging.example.com | 10.0.2.10 | 403 | Apache |
| dev.example.com | 10.0.3.15 | 200 | Express |
### 修复建议
- 删除已停用子域名的 DNS 记录
- 调查 CNAME 指向未认领服务的子域名
- 限制对开发和演示环境的访问
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub killvxk/cybersecurity-skills-zh --plugin cybersecurity-skills-zh735 skills in this plugin
/acquiring-disk-image-with-dd-and-dcfldd使用 dd 和 dcfldd 创建取证级逐位磁盘镜像,通过哈希验证保持证据完整性。/analyzing-active-directory-acl-abuse使用 ldap3 检测 Active Directory 中危险的 ACL 配置错误,识别 GenericAll、WriteDACL 和 WriteOwner 等滥用路径/analyzing-android-malware-with-apktool使用 apktool 进行反编译、jadx 恢复 Java 源码、androguard 进行权限分析,对 Android APK 恶意软件样本执行静态分析,包括清单检查和可疑 API 调用检测。Other plugins' skills for the same job