资产发现之垂直关联
2023-4-24 14:45:51 Author: www.secpulse.com(查看原文) 阅读量:51 收藏

免责声明:文章中涉及的方法仅对您有权访问的目标执行枚举,我对读者的任何行为概不负责,由用户承担全部法律及责任。

垂直关联 — 从根域查找子域的过程。这是挖掘漏洞赏金的第二步,第一步从上一篇水平关联开始,了解的资产越多,您可以攻击的资产就越多,通过扩大攻击面,您更有可能发现漏洞。

我找到几种查找子域名的方法:

工具被动查找子域名

测试的工具:

  • Anubis

  • Amass

  • Subfinder

  • TheHarvester

  • OneForAll

  • BBOT

测试规则:

目标:tesla.com

免费API,不用任何付费的API。

在同一台VPS上进行测试,每个工具单独运行。

Subfinder

subfinder -domain tesla.com -all -t 100

https://github.com/projectdiscovery/subfinder

版本:v2.5.7 (18 三月 2023)

子域:616

运行时间:30 秒

oneforall

python oneforall.py --target tesla.com --req False run

https://github.com/shmilylty/OneForAll

版本:v0.4.5 (10 七月 2022)

子域:424

运行时间:1 分 55 秒

theHarvester

python theHarvester.py --domain tesla.com --dns-lookup --dns-brute --source anubis,baidu,bevigil,binaryedge,bing,bingapi,bufferoverun,censys,certspotter,crtsh,dnsdumpster,duckduckgo,fullhunt,github-code,hackertarget,hunter,intelx,omnisint,otx,pentesttools,projectdiscovery,qwant,rapiddns,rocketreach,securityTrails,sublist3r,threatcrowd,threatminer,urlscan,virustotal,yahoo,zoomeye

https://github.com/laramies/theHarvester

版本:v4.2.0 (14 八月 2022)

子域:627

运行时间:4 分 4 秒

Anubis

anubis -t tesla.com

https://github.com/jonluca/Anubis

版本:v1.1.3 (10 一月 2023)

子域:536

运行时间:31 秒

amass

amass enum -passive -d tesla.com -src

https://github.com/OWASP/Amass

版本:v3.22.2 (21 三月 2023)

子域:692

运行时间:4 分 36 秒

Bbot

bbot -t tesla.com -f subdomain-enum -c modules.massdns.max_resolvers=5000

https://github.com/blacklanternsecurity/bbot

版本:v1.0.5.1331 (10 三月 2023)

子域:452

运行时间:6 分 20 秒

六个工具发现的子域名数量结果

六个工具发现子域名所用的时间

最终结果对比

工具主动查找子域名

对于主动爆破子域名,最为重要的是字典,这将在下面会提到。首先我们先来测试一下常用爆破子域名的工具。

测试的工具:

  • Fuzzdomain

  • Wfuzz

  • Gobuster

  • Ksubdomain

  • Altdns

  • Amass

测试规则:

目标:baidu.com

固定使用1300的子域名字典。

在同一台VPS上进行测试,每个工具单独运行。

Fuzzdomain

版本:v3.22.2 (21 三月 2023)

子域:242

运行时间:1 分 10 秒

Wfuzz

wfuzz -c -u “http://baidu.com/“ -H “Host:FUZZ.baidu.com” -w 1300.txt

版本:v3.1.0 (21 六月 2020)

子域:55

运行时间:1 分 40 秒

Gobuster

版本:v3.1.0 (20 二月 2023)

子域:175

运行时间:3 分 20 秒

gobuster dns -d baidu.com -w 1300.txt

Ksubdomain

版本:v0.7 (12 一月 2021)

子域:349

运行时间:32 秒

ksubdomain-d baidu.com -f 1300.txt

Altdns

版本:v1 ( 2021)

子域:240

运行时间:4分32 秒

altdns -i 1.txt -w 1300.txt -o 2.txt -r -s 11.txt

Amass

版本:v3.22.2 (21 三月 2023)

子域:214

运行时间:3 分 36 秒

amass enum -active -brute -d baidu.com -w 1300.txt

六个工具发现的子域名数量结果

六个工具发现子域名所用的时间

最终结果

字典

新子域的开发和部署是动态的,它们会随着时间的推移而变化, 我们的字典应该同样动态地反映这一点。为了保持最新状态,我们可以使用惊人的commonspeak2数据集。

https://github.com/assetnote/wordlists

可以使用以下命令一次下载所有单词列表:

wget -r --no-parent -R "index.html*" https://wordlists-cdn.assetnote.io/data/ -nH

字典占用空间达到了接近七个G

在线网站

https://otx.alienvault.com/api/v1/indicators/domain/baidu.com/url_list?limit=10000&page=1

https://quake.360.net

https://hunter.qianxin.com

https://chaziyu.com/tesla.com/

https://fofa.info/

https://developers.facebook.com/tools/ct?step_size=30&query=baidu.com

https://crt.sh/?q=baidu.com

搜索引擎

https://www.bing.com/

https://www.baidu.com

https://www.google.com.hk/

https://duckduckgo.com/

https://search.yahoo.com/

https://www.webcrawler.com/

https://www.dogpile.com

到目前为止,你便拥有一个包含多个子域名的列表,完成水平与垂直关联后,我们便为寻找漏洞以及指纹识别奠定了良好的基础。

本文作者:网络安全之旅

本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/199499.html


文章来源: https://www.secpulse.com/archives/199499.html
如有侵权请联系:admin#unsafe.sh