子域名发现工具subfinder

admin 2024年1月10日10:45:36评论72 views字数 3872阅读12分54秒阅读模式

subfinder是一个子域发现工具,它使用被动在线资源返回网站的有效子域。它具有简单的模块化架构,并针对速度进行了优化。subfinder专为做一件事而构建 - 被动子域枚举,并且它做得非常好。在获得了 APIKEY 后,可进行全方面的被动式子域发现,为渗透测试人员提供服务。

子域名发现工具subfinder

安装

我是使用二进制文件安装的

https://github.com/projectdiscovery/subfinder/releases/tag/v2.6.3

 

子域名发现工具subfinder

下载后解压到本地,然后右键-->“在终端中打开”,就可以在小小的互联网上挖呀挖呀挖了

子域名发现工具subfinder

子域名发现工具subfinder

官方还提供了多种安装方式,可以根据自己的情况选择最适合自己的安装方式

go语言安装

go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest

docker安装

docker pull projectdiscovery/subfinder:latest

源码安装

git clone https://github.com/projectdiscovery/subfinder.git; cd subfinder/v2/cmd/subfinder; go build; mv subfinder /usr/local/bin/; subfinder -version;

 

二进制安装

https://github.com/projectdiscovery/subfinder/releases

用法

subfinder -h
Usage:  ./subfinder [flags]
Flags:INPUT:  -d, -domain string[]  domains to find subdomains for  -dL, -list string     file containing list of domains for subdomain discovery
SOURCE:  -s, -sources string[]           specific sources to use for discovery (-s crtsh,github). Use -ls to display all available sources.  -recursive                      use only sources that can handle subdomains recursively (e.g. subdomain.domain.tld vs domain.tld)  -all                            use all sources for enumeration (slow)  -es, -exclude-sources string[]  sources to exclude from enumeration (-es alienvault,zoomeyeapi)
FILTER:  -m, -match string[]   subdomain or list of subdomain to match (file or comma separated)  -f, -filter string[]   subdomain or list of subdomain to filter (file or comma separated)
RATE-LIMIT:  -rl, -rate-limit int  maximum number of http requests to send per second  -rls value            maximum number of http requests to send per second four providers in key=value format (-rls "hackertarget=10/s,shodan=15/s")  -t int                number of concurrent goroutines for resolving (-active only) (default 10)
UPDATE:   -up, -update                 update subfinder to latest version   -duc, -disable-update-check  disable automatic subfinder update check
OUTPUT:  -o, -output string       file to write output to  -oJ, -json               write output in JSONL(ines) format  -oD, -output-dir string  directory to write output (-dL only)  -cs, -collect-sources    include all sources in the output (-json only)  -oI, -ip                 include host IP in output (-active only)
CONFIGURATION:  -config string                flag config file (default "$CONFIG/subfinder/config.yaml")  -pc, -provider-config string  provider config file (default "$CONFIG/subfinder/provider-config.yaml")  -r string[]                   comma separated list of resolvers to use  -rL, -rlist string            file containing list of resolvers to use  -nW, -active                  display active subdomains only  -proxy string                 http proxy to use with subfinder  -ei, -exclude-ip              exclude IPs from the list of domains
DEBUG:  -silent             show only subdomains in output  -version            show version of subfinder  -v                  show verbose output  -nc, -no-color      disable color in output  -ls, -list-sources  list all available sources
OPTIMIZATION:  -timeout int   seconds to wait before timing out (default 30)  -max-time int  minutes to wait for enumeration results (default 10)
  • -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 显示详细输出

示例

挖掘hackerone.com的子域名

subfinder.exe -d hackerone.com

子域名发现工具subfinder

使用API

subfinder的强大之处在于可以使用大量API,使用API需要注册其帐号,获取 APIKEY,然后调用即可。

https://www.virustotal.com/gui/home/upload

https://community.riskiq.com/

http://securitytrails.com/

https://censys.com/

https://binaryedge.io/

https://www.shodan.io/

https://urlscan.io/

例如,先获取 shodan 的 APIKEY:

进入 shodan 官网:https://www.shodan.io/ 并登录。进入“我的账户”:

子域名发现工具subfinder

获取 APIKEY:

子域名发现工具subfinder

然后,创建文件: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.220sources:  - archiveis  - binaryedge  - bufferover  - censys  - certspotter  - certspotterold  - commoncrawl  - crtsh  - digicert  - dnsdumpster  - entrust  - googleter  - hackertarget  - ipv4info  - passivetotal  - securitytrails  - shodan  - sitedossier  - threatcrowd  - threatminer  - urlscan  - virustotal  - waybackarchivebinaryedge: []censys: []certspotter: []passivetotal: []securitytrails: []shodan: []urlscan: []virustotal: []

 

将 APIKEY 填入【】中并保存,运行:

subfinder.exe -config config.yaml -d example.com

 

显示详细信息,使用 -v 即可,将逐一输出程序运行检测的所有域名:

subfinder.exe -d example.com -v

 

 

原文始发于微信公众号(AI与网安):8.8k Star 一款趁手的子域名发现工具subfinder

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年1月10日10:45:36
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   子域名发现工具subfinderhttp://cn-sec.com/archives/2380705.html

发表评论

匿名网友 填写信息