
whathost 是一款高性能侦察工具,专为安全专业人员、渗透测试人员和漏洞赏金猎人设计。它通过 SSL/TLS 证书检查和 DNS PTR 查询快速将 IP 地址解析为主机名,为安全评估提供全面的主机枚举能力。
SSL/TLS 证书枚举
:8443、:8080)DNS PTR 查询
性能优化
输出灵活性
可靠性
go install gitlab.com/bountrix/whathost@latest
git clone https://gitlab.com/bountrix/whathost.git
cd whathost
go build -o whathost
sudo mv whathost /usr/local/bin/whathost
whathost -version
从文件快速扫描:
whathost -i targets.txt
从 stdin 管道输入:
cat ips.txt | whathost
使用 100 个工作线程进行高速扫描:
whathost -i targets.txt -t 100
用于干净输出的静默模式:
whathost -i targets.txt -silent | sort -u
仅 SSL 枚举(跳过 DNS):
whathost -i targets.txt -skip-dns -t 200
仅 DNS,使用自定义解析器:
whathost -i targets.txt -skip-ssl -r 8.8.8.8 -p 53
带统计信息的 JSON 输出:
whathost -i targets.txt -json -stats -dedupe > results.json
带延迟的限速扫描:
whathost -i targets.txt -delay 100ms -timeout 15
为虚拟主机自定义 SNI:
whathost -i targets.txt -sni example.com -insecure
详细调试:
whathost -i targets.txt -v -stats
完整侦察工作流:
cat targets.txt | whathost -t 100 -dedupe -timestamp -o results.txt -stats
| 标志 | 别名 | 描述 |
|---|---|---|
-i | 包含 IP 的输入文件(默认:stdin) | |
-o | 结果输出文件(默认:stdout) | |
-json | 以 JSON 格式输出结果 | |
-silent | -s | 静默模式 - 仅输出主机名 |
-timestamp | 为结果添加 RFC3339 时间戳 |
| 标志 | 别名 | 描述 |
|---|---|---|
-t | -threads | 并发工作线程数(默认:32) |
-delay | 请求之间的延迟(例如 100ms、1s) | |
-timeout | HTTP 客户端超时时间(秒)(默认:10) |
| 标志 | 别名 | 描述 |
|---|---|---|
-r | -resolver | 自定义 DNS 解析器 IP 地址 |
-p | DNS 解析器端口(默认:53) | |
-protocol | DNS 协议:udp 或 tcp(默认:udp) | |
-dns-timeout | DNS 查询超时时间(秒)(默认:5) | |
-skip-dns | 跳过 DNS PTR 查询 |
| 标志 | 描述 |
|---|---|
-sni | 覆盖 SSL 连接的 SNI 主机名 |
-insecure | 跳过 TLS 证书验证(默认:true) |
-skip-ssl | 跳过 SSL 证书检查 |
| 标志 | 别名 | 描述 |
|---|---|---|
-dedupe | 对输出中的主机名去重 | |
-stats | 完成时显示详细统计信息 | |
-v | -verbose | 详细输出并包含调试信息 |
-banner | 启动时显示 ASCII 横幅 | |
-version | 显示版本信息 |
[SSL-SAN] 143.43.221.133 -> example.com
[SSL-CN] 143.43.221.133 -> example.org
[DNS-PTR] 143.43.221.133 -> host.example.com
[SSL-SAN] 143.43.221.133:8443 -> api.example.com
{
"type": "SSL-SAN",
"ip": "143.43.221.133",
"hostname": "example.com",
"source": "certificate"
}{
"type": "SSL-CN",
"ip": "143.43.221.133",
"hostname": "example.org",
"source": "certificate"
}{
"type": "DNS-PTR",
"ip": "143.43.221.133",
"hostname": "host.example.com",
"source": "dns"
}{
"type": "SSL-SAN",
"ip": "143.43.221.133",
"hostname": "api.example.com",
"port": "8443",
"source": "certificate"
}
example.com
example.org
host.example.com
api.example.com
╔════════════════════════════════════════════╗
║ Statistics Report ║
╠════════════════════════════════════════════╣
║ Total IPs processed: 250 ║
║ SSL hostnames found: 487 ║
║ DNS PTR records: 198 ║
║ Unique hostnames: 623 ║
║ Failed checks: 12 ║
║ Time elapsed: 45.3s ║
║ Processing rate: 5.52 IPs/s ║
╚════════════════════════════════════════════╝
cat ip-ranges.txt | whathost -silent -dedupe | httprobe
whathost -i scope-ips.txt -stats -o discovered-hosts.txt
whathost -i company-ips.txt -json -dedupe > asset-inventory.json
cat ct-log-ips.txt | whathost -skip-dns -t 200 -silent
whathost -i targets.txt -skip-ssl -r 1.1.1.1 -v
iptohost 支持多种输入格式:
# Plain IPs
192.168.1.1
10.0.0.1
# IPs with ports
192.168.1.1:8443
10.0.0.1:9000
# CIDR ranges (each IP should be on its own line)
192.168.1.1
192.168.1.2
192.168.1.3
# Comments (lines starting with #)
# Production servers
192.168.1.100
# Staging servers
192.168.1.200
# HTTP(S) URLs (protocol will be stripped)
https://192.168.1.1
http://10.0.0.1:8080
与 subfinder 和 httpx 结合使用:
subfinder -d example.com -silent | httpx -silent | whathost -silent | sort -u
通过管道传递给 nuclei 进行漏洞扫描:
cat targets.txt | whathost -silent -dedupe | nuclei -t cves/
使用 massdns 进行链式调用:
cat subdomains.txt | massdns -r resolvers.txt -o S -w - | awk '{print $3}' | whathost
导出为 CSV:
whathost -i targets.txt -json | jq -r '[.ip,.hostname,.type] | @csv'
whathost -i massive-list.txt -t 500 -timeout 5 -dns-timeout 3
whathost -i targets.txt -t 10 -delay 500ms -timeout 20
whathost -i targets.txt -t 20 -timeout 30 -dns-timeout 10 -dedupe -stats
欢迎贡献!请随时提交 Pull Request。
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。
INTELEON404 - @inteleon404 BOUNTRIX - @BOUNTRIX
项目链接:https://gitlab.com/bountrix/whathost