An asset discovery & fingerprinting toolkit in Go
⚠️ 仅限授权安全测试与研究用途。请遵守当地法律法规。
⚠️ For authorized security testing & research only. You are responsible for legal compliance.
- 简介 · Overview
- 功能特性 · Features
- 工作流程 · Workflow
- 输出结果 · Outputs
- 安装与编译 · Install & Build
- 配置文件 · Configuration
- 使用示例 · Usage
- 常见问题 · FAQ / Troubleshooting
- 路线图 · Roadmap
- 致谢 · Credits
- 许可协议 · License
baiyan 是一个用 Go 编写的自动化资产测绘与识别工具,覆盖子域名收集、空间引擎聚合、端口探测、HTTP 识别与指纹识别,并导出一份结构化 Excel 报告。
baiyan is a Go-based automation tool for reconnaissance: subdomain discovery, search-engine aggregation, port scanning, HTTP probing, and fingerprint enrichment, exporting a structured Excel report.
-
子域名枚举 · Subdomain enumeration
subfinder(活跃/全量)ksubdomain字典爆破(同 IP 仅保留一个代表子域名)- 统一清洗:去除
=>、CNAME 链噪声
-
空间引擎聚合 · Search engine aggregation
- FOFA(带缓存):一次查询复用子域名与 URL 结果
- 证书扩展(可选):
cert="domain"拉取新 IP
-
CDN 识别与规避 · CDN detection & avoidance
- CDN 域名:仅对 80/443/8080/8880 做 httpx 探活
- 非 CDN:解析公网 IPv4,进入端口扫描与后续流程
-
端口探测 · Port scanning
- 使用
masscan(全局去重:同一 IP 仅扫描一次)
- 使用
-
HTTP 识别 · HTTP probing
httpx采集status/title/webserver- SNI 友好:优先以“代表域名”探测 IP 的开放端口
-
指纹识别 · Fingerprinting
- 集成
observer_ward(可选) - 自动
-u更新 → 对 URL 列表批量识别 - 清洗 ANSI 颜色码,仅保留指纹名字列表
- 集成
-
报告导出 · Report
- 输出 Excel:子域名 / URL / 端口 / c 段统计 / 互联网 IP / title&指纹识别
Targets (domain/ip/cidr)
│
├─ Subdomains: subfinder(alive/all) + ksubdomain(dict)
│ └─ Clean & dedupe: strip "=>", keep one sub per IP
│
├─ Space engines: FOFA (cached)
│ ├─ Subdomain aggregation
│ └─ URL aggregation
│
├─ CDN decision
│ ├─ CDN: httpx fixed ports (80/443/8080/8880)
│ └─ Non-CDN: public IPv4 → masscan → httpx
│
├─ (optional) cert="domain" → new IPs → masscan+httpx
│
└─ ObserverWard → Excel
生成 result.xlsx,包含以下 Sheet:
result.xlsx includes the following sheets:
- 子域名 / Subdomains —
subdomain - URL —
url,status,title,webserver - 端口 / Ports —
host,port,proto(host可能为代表域名或原始 IP) - c段统计 / /24 Summary —
/24(出现次数 ≥ 3 的 /24 汇总) - 互联网ip统计 / Public IPs —
ip(去重后的公网 IPv4) - title&指纹识别 / Title & Fingerprints —
URL,Title,指纹(如ecology-oa, 泛微-oa e-cology8)
指纹解析会清洗颜色码与状态码,不写入
:443等端口后缀。
- Go 1.20+
- Linux(建议):
masscan需要 root 或CAP_NET_RAW - 有效 FOFA 凭据(如启用)
- 可访问外网下载依赖二进制
git clone <this-repo>
cd baiyan
go build -o asf .- 创建
./bin/并下载:httpx,masscan,subfinder,ksubdomain - 将 绝对路径 的
./bin追加到当前进程PATH - 生成
.install_lock,下次启动跳过下载
如你自备工具或非 Linux/amd64,请自行替换
./bin;删除.install_lock可触发重装。
- 将可执行文件放到:
./lib/ob/observer_ward - 程序会自动执行:
./lib/ob/observer_ward -u && ./lib/ob/observer_ward -f <urlfile> > ./lib/ob/ob_output.txt - 结果写入 Excel 的 title&指纹识别 Sheet
./config/spaceConfig.ini(示例)
[FOFA API]
email = your-email@example.com
key = your-fofa-api-key
fofa_nums = 1000
[Quake API]
x-quaketoken = ; (当前未启用,可留空)
[Quake nums]
quake_nums = 100 ; (当前未启用)其他:
./config/subfinder-config.yaml:subfinder 的 provider 配置./dict/sub.dict:ksubdomain 爆破字典
./asf -f url.txturl.txt 每行一个目标(域名 / IP / CIDR):
example.com
1.2.3.4
10.0.0.0/24
-f string目标清单(必填)-t inthttpx 并发(默认300)--rate intmasscan 速率(默认5000)--fast仅空间引擎 + httpx,只导出 URL--certscan证书扩展(可能误报,谨慎)--timeout duration单目标最大时长(默认15m)-o stringExcel 输出(默认result.xlsx)--debug详细日志
全流程 / Full pipeline
sudo ./asf -f url.txt --certscan --debug快速模式 / FAST mode
./asf -f url.txt --fast自定义扫描速率 / Custom masscan rate
sudo ./asf -f url.txt --rate 10000- 找不到子命令? 首次运行已把
./bin绝对路径加入本进程PATH;若你单独运行子命令,请手动export PATH="$(pwd)/bin:$PATH"。 - masscan 无法运行或无结果? 需要 root 或
CAP_NET_RAW;检查防火墙/丢包与--rate。 - ksubdomain 无输出? 不同版本参数可能差异(
-fvs-w,-rlistvs-r)。本项目默认-f/-rlist。 - Excel 指纹为空或乱码? 我们已清洗 ANSI/状态码;若你的
observer_ward输出格式不同,请开 issue 附样例。
- 集成 Quake 查询
- 目录扫描(可选)
- ObserverWard JSON 直出更完整适配
- 更丰富字段与可视化
- projectdiscovery/subfinder
- projectdiscovery/httpx
- robertdavidgraham/masscan
- ksubdomain
- ObserverWard / observer_ward
第三方工具版权归原作者所有。
本项目的许可证见仓库根目录 LICENSE。
See LICENSE in the repository root for details.
如果你觉得这个项目有用,欢迎 Star ⭐ 与 PR!
If you find it helpful, please consider starring ⭐ the repo and sending PRs.