ispectr3/subdomain-enumerator
GitHub: ispectr3/subdomain-enumerator
一款基于 Bash 的子域名枚举工具,通过 crt.sh 证书透明度查询和字典暴力枚举结合并行 DNS 解析来快速发现目标域名的子域名。
Stars: 0 | Forks: 0
# 子域名枚举工具



## 功能
- **Certificate Transparency** — 查询 crt.sh 以发现 SSL/TLS 证书中注册的子域名
- **Brute Force** — 使用可自定义的 wordlist 进行枚举(包含具有 500 多个常见子域名的 wordlist)
- **并行 DNS 解析** — 使用 `xargs` 和可配置的 threads 以提高速度
- **彩色输出** — 绿色表示已找到,红色表示未找到
- **导出** — 将结果保存为 TXT 和 CSV 格式
- **依赖检查** — 检查是否已安装所有必需的工具
- **3 种模式** — `brute`、`crt` 或 `all`(两者兼有)
## 前置条件
```
# Debian/Ubuntu
sudo apt install dnsutils curl findutils
# macOS (使用 Homebrew)
brew install bind curl findutils
```
## 安装说明
```
git clone https://github.com/kaique/subdomain-enumerator.git
cd subdomain-enumerator
chmod +x subdomain-enumerator.sh
```
## 使用说明
```
# 基本用法 — 所有方法
./subdomain-enumerator.sh -d example.com
# 仅使用 Certificate Transparency (crt.sh)
./subdomain-enumerator.sh -d example.com -m crt
# 使用自定义 wordlist 进行 brute force
./subdomain-enumerator.sh -d example.com -m brute -w minha_wordlist.txt
# 使用 20 个 threads 并保存结果
./subdomain-enumerator.sh -d example.com -t 20 -o resultados.txt
# 所有选项
./subdomain-enumerator.sh -d example.com -m all -w wordlists/common.txt -t 15 -o output.txt
```
### Flags
| Flag | 描述 | 默认值 |
|------|-----------|--------|
| `-d` | 目标域名(必填) | — |
| `-w` | wordlist 路径 | `wordlists/common.txt` |
| `-o` | 输出文件 | — |
| `-t` | threads 数量 | `10` |
| `-m` | 模式:`brute`、`crt`、`all` | `all` |
| `-h` | 显示帮助 | — |
## 项目结构
```
subdomain-enumerator/
subdomain-enumerator.sh # Script principal
wordlists/
common.txt # Wordlist com 500+ subdomínios comuns
README.md
LICENSE
.gitignore
```
## 工作原理
### 1. Certificate Transparency (crt.sh)
查询 [crt.sh](https://crt.sh) 的公开 API,该 API 会索引所有已颁发的 SSL/TLS 证书。证书通常会在 Subject Alternative Name (SAN) 字段中包含子域名。
### 2. 使用 Wordlist 进行 Brute Force
将 wordlist 中的每个单词与目标域名组合(例如:`admin.example.com`),并使用 `dig` 检查该子域名是否能通过 DNS 解析。
### 3. 并行 DNS 解析
利用 `xargs -P` 同时执行多个 DNS 查询,显著加快了处理速度。
## 免责声明
## 许可证
本项目采用 [MIT](LICENSE) 许可证。
标签:Bash, DNS解析, GitHub, 子域名枚举, 实时处理, 应用安全, 开源项目, 系统安全, 系统独立性, 进程管理