Subfinder
一个子域发现工具,可通过使用被动的在线资源来发现网站的有效子域。它具有简单的模块化架构,并针对速度进行了优化。subfinder 仅用于做一件事,那就是被动子域枚举。
在获得了 APIKEY 后,可进行全方面的被动式子域发现,为渗透测试人员提供服务。
特征✨
- 模块化架构
- 速度快、轻量级资源
- 丰富的被动源(截至目前已有26个源)
- 支持集成 Stdin和 stdout
- 多种输出格式
安装❗
项目地址:https://github.com/projectdiscovery/subfinder
使用版本:v2.2.4
环境:win10
直接安装需 go1.13+ 才能成功安装!
Docker 一键部署
先拉取官方镜像。
docker pull ice3man/subfinder
运行:
docker run -it ice3man/subfinder
提示没有提供输入列表,运行命令后面接参数指令即可,例如:
docker run -it ice3man/subfinder -h
显示帮助菜单。
- -config API密钥等的配置文件
- -d 查找子域
- -dL 包含要枚举的域列表的文件
- -exclude-sources 清单中要排除的来源清单
- -max-time 等待枚举结果的分钟数(默认为10)
- -nC 不要在输出中使用颜色
- -nW 从输出中删除通配符和失效子域
- -o 输出到指定文件(可选)
- -oD 将枚举结果写入指定目录(可选)
- -oI 以Host,IP格式写入输出
- -oJ 以JSON行格式写入输出
- -r 以逗号分隔的要使用的解析程序列表
- -rL 包含要使用的解析器列表的文本文件
- -silent 仅显示输出中的子域
- -sources 用逗号分隔的来源列表
- -t 用于解析的并发 goroutine 的数量(默认为10)
- -timeout 超时时间(默认为30)
- -v 显示详细输出
Windows 下还可以自己下载 exe 文件运行。
下载地址:https://github.com/projectdiscovery/subfinder/releases
运行方式:cmd 跳转到其相同目录,然后:(例如命令 -h)
subfinder-windows-amd64.exe -h
使用 API
需要注册其帐号,获取 APIKEY,然后调用即可。说得有点啰嗦,直接看下面的操作吧。
例如,先获取 shodan 的 APIKEY:
进入 shodan 官网:https://www.shodan.io/ 并登录。进入“我的账户”:
获取 APIKEY:
然后,创建文件:config.yaml
demo:
resolvers:
- 1.1.1.1
- 1.0.0.1
- 8.8.8.8
- 8.8.4.4
- 9.9.9.9
- 9.9.9.10
- 77.88.8.8
- 77.88.8.1
- 208.67.222.222
- 208.67.220.220
sources:
- archiveis
- binaryedge
- bufferover
- censys
- certspotter
- certspotterold
- commoncrawl
- crtsh
- digicert
- dnsdumpster
- entrust
- googleter
- hackertarget
- ipv4info
- passivetotal
- securitytrails
- shodan
- sitedossier
- threatcrowd
- threatminer
- urlscan
- virustotal
- waybackarchive
binaryedge: []
censys: []
certspotter: []
passivetotal: []
securitytrails: []
shodan: []
urlscan: []
virustotal: []
将 APIKEY 填入【】中并保存,运行:
subfinder-windows-amd64.exe -config config.yaml -d example.com
使用测试
以 example.com 为例。
查子域:
subfinder-windows-amd64.exe -d example.com
或 docker 下使用:
docker run -it ice3man/subfinder -d example.com
显示详细信息,使用 -v 即可,将逐一输出程序运行检测的所有域名:
subfinder-windows-amd64.exe -d example.com -v