子域名发现
做子域名发现有很多方法,最原始的一种就是跑字典。有几个工具可以试试
- Knockpy:
- Sublist3r:
- SubBrute
- OneForAll
- ESD
- SubdomainBrute
- subfinder
补充子域名
还可以使用一些工具来补充子域名,像搜索就是可以的。
1.搜索引擎
- google,百度,bing
site:target.com -site:www.target.com
- fofa, zoomeye,shodan
- 快速收集资产用他们
- whois和反查whois
- 域名备案
2.利用证书透明度收集子域
(1)crtsh:https://crt.sh/
(2)facebook:https://developers.facebook.com/tools/ct
(3)entrust:https://www.entrust.com/ct-search/
(4)certspotter:https://sslmate.com/certspotter/api/
(5)spyse:https://spyse.com/search/certificate
(6)censys:https://censys.io/certificates
(7)google: https://google.com/transparencyreport/https/ct/
3.域传送
1.dig命令
如dig @ns2.xxx.com xxx.com axfr
ns2.xxx.com为提供数据的服务器,xxx.com为要传输的关键字,axfr为区域传输选项。
注意:一般情况下,DNS服务器都配置正确,关闭了dns传输或设置了白名单,漏洞利用成功的概率较低。
4.站点配置文件
1. crossdomain.xml文件
直接访问crossdomain.xml路径
2. sitemap文件
注意:文件往往不存在,即使存在,域名信息也不够多不够完全。
直接访问sitemap.xml、sitemap.txt、sitemap.html、sitemapindex.xml、sitemapindex.xml路径
5.检查内容安全策略
1.手动抓包获取
HTTP header的Content-Security-Policy属性
2.Python的Requests获取
import requests
res = requests.post(url=url, headers=headers, data=data, allow_redirects=False)
if not res.headers[‘Content-Security-Policy’]:
print(“There is no Content-Security-Policy in the header”)
else:
# 处理主体代码
6.利用DNS查询收集子域
SRV记录: 添加服务记录服务器服务记录时会添加此项,SRV记录了哪台计算机提供了哪个服务。格式为:服务的名字.协议的类型(例如:example-server.tcp)。
以下命令枚举给定域名的SRV记录:
nmap –script dns-srv-enum.nse –script-args “dns-srv-enum.domain=’google.com'”
7.利用DNS数据集收集子域
利用DNS记录公开数据收集
★(1)ip138:https://site.ip138.com/{domain}/domain.htm
★(2)百度云观测:http://ce.baidu.com/index/getRelatedSites?site_address={domain}
★(3)hackertarget:https://hackertarget.com/find-dns-host-records/
(4)riddler:https://riddler.io/search?q=pld:{domain}
(5)bufferover:https://dns.bufferover.run/dns?q={domain}
★(6)dnsdb:https://dnsdb.io/zh-cn/search?q={domain}
(7)ipv4info:http://ipv4info.com/
(8)robtex:https://www.robtex.com/dns-lookup/
(9)chinaz:https://alexa.chinaz.com/
★(10)netcraft:https://searchdns.netcraft.com/
(11)dnsdumpster:https://dnsdumpster.com/
(12)sitedossier:http://www.sitedossier.com/
★(13)findsubdomains:https://findsubdomains.com/
8.利用威胁情报平台数据收集子域
(1) https://otx.alienvault.com/api/v1/indicators/domain/{domain}/{section}
{section}指其他指令动作,可参考Docs关于API的使用说明。
https://otx.alienvault.com/api/v1/indicators/domain/qq.com/url_list
(2) https://community.riskiq.com/search/{domain}/subdomains
(3) https://x.threatbook.cn/nodev4/domain/{domain}
API:https://api.threatbook.cn/v3/domain/sub_domains
(4) https://www.threatminer.org/domain.php?q={domain}
(5) https://www.virustotal.com/ui/domains/{domain}/subdomains
或者https://www.virustotal.com/gui/domain/{domain}/relations
(6) https://pentest-tools.com/information-gathering/find-subdomains-of-domain#
https://scans.io/study/sonar.rdns_v2
https://opendata.rapid7.com/
9.信息泄露
- 信息泄露
网站管理页 - 文件泄漏
crossdomain.xml
robots.txt - Git仓库泄露
- 从流量中分析提取
扩充子域名
我们还需要寻找子域名的子域名,有的时候可能需要5,6层的子域名,这里也有一些工具可以使用
清理子域名
我们需要判断一个子域是不是活跃的,是不是有内容,不可能一个一个去判断,也是需要工具来做。最常见的方法就是使用工具打开之后截图。
工具推荐:
- EyeWitness https://github.com/FortyNorthSecurity/EyeWitness
- Grab Them All (这是一个Firefox的插件)
- Aquatone
- Webscreenshot
参考资源:
- 红蓝对抗之域名搜集方法总结 https://security.tencent.com/index.php/blog/msg/161
- 子域名探测方法大全 https://xz.aliyun.com/t/8652
[…] Day014:Recon之子域名发现 […]
赞赞