子域名发现的20种方法

admin 2022年6月5日11:07:22评论138 views字数 4906阅读16分21秒阅读模式

No.1

声明

由于传播、利用此文所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,雷神众测以及文章作者不为此承担任何责任。

雷神众测拥有对此文章的修改和解释权。如欲转载或传播此文章,必须保证此文章的完整性,包括版权声明等全部内容。未经雷神众测允许,不得任意修改或者增减此文章内容,不得以任何方式将其用于商业目的。


No.2

为何要介绍这么多工具 & 技术

1.使用的技术越多,就越能发现其他工具找不到的子域名。
2.一些白帽子只推荐了零星的几个工具(Amass,Massdns,Subfinder & Gobuster)


No.3

DNS发现方法

Scraping(抓取)
暴力枚举
Alterations & permutations(换置 & 排序)
在线接口
SSL证书
Certificate Transparency(证书透明)
搜索引擎
Public datasets(公开数据集)
DNS aggregators(DNS聚合器)
Git仓库
内容解析(HTML,JavaScript,文件)
虚拟主机发现
ASN发现
反向解析
区域传送
NSEC3
DNS Cache Snooping(域名缓存侦测)
CSP HTTP首部
SPF记录
Subject Alternate Name (SAN)


No.4

Linux平台工具

AltDNS

工具描述:通过换置&排序技术发现子域名

git clone https://xxx.com/infosec-au/altdns.git
cd altdns
pip install -r requirements.txt
./altdns.py -i subdomains.txt -o data_output -w words.txt -r -s results_output.txt

子域名发现的20种方法


Amass

工具描述:爆破, google, VirusTotal, alt names

go get -u github.com/OWASP/Amass/...
amass -d target.com -o $outfile


Assets-from-spf

工具描述:SPF域名记录

git clone https://xxx.com/yamakira/assets-from-spf.git
pip install click ipwhois
python assets_from_spf.py target.com

子域名发现的20种方法


BiLE-suite

工具描述:HTML解析,反向dns解析

aptitude install httrack
git clone https://xxx.com/sensepost/BiLE-suite.git
perl BiLE.pl target.com


Bing

工具描述:搜索引擎

发现子域名: site:target.com
过滤掉 -site:www.target.com


Censys_subdomain_enum.py

工具描述:提取子域名,从Censys的SSL/TLS证书中收集子域名

pip install censys
git clone https://xxx.com/appsecco/the-art-of-subdomain-enumeration.git
python censys_enumeration.py target.com

子域名发现的20种方法


Cloudflare_enum.py

工具描述:从Cloudflare提取子域名
dns聚合器

pip install censys
git clone https://xxx.com/appsecco/the-art-of-subdomain-enumeration.git
cloudflare_subdomain_enum.py [email protected] target.com


Crt_enum_web.py

工具描述:解析https://crt.sh/页面的子域名

pip install psycopg2
git clone https://xxx.com/appsecco/the-art-of-subdomain-enumeration.git
python3 crtsh_enum_web.py target.com


CTFR

工具描述:滥用证书透明记录

git clone https://xxx.com/UnaPibaGeek/ctfr.git
cd ctfr
pip3 install -r requirements.txt
python3 ctfr.py -d target.com -o $outfile


Dig

工具描述:dns区域传送,dns反向解析,dns解析

dig +multi AXFR target.com
dig +multi AXFR $ns_server target.com


Domains-from-csp

工具描述:从CSP头提取子域名

git clone https://xxx.com/yamakira/domains-from-csp.git
pip install click
python csp_parser.py $URL
python csp_parser.py $URL -r


Knock

工具描述:AXFR, virustotal, 爆破

apt-get install python-dnspython
git clone https://xxx.com/guelfoweb/knock.git
cd knock
nano knockpy/config.json # <- set your virustotal API_KEY
python setup.py install

子域名发现的20种方法


Ldns-walk

工具描述:DNSSEC zone walking

aptitude install ldnsutils
ldns-walk target.com
ldns-walk @nsserver.com target.com

如果DNSSEC NSEC开启,可以获得全部域名。

子域名发现的20种方法


Massdns

工具描述:dns解析

git clone https://xxx.com/blechschmidt/massdns.git
cd massdns/
make
解析域名:/bin/massdns -r lists/resolvers.txt -t AAAA -w results.txt domains.txt -o S -w output.txt
爆破域名:./scripts/subbrute.py wordlist.txt target.com | ./bin/massdns -r lists/resolvers.txt -t A -o S -w output.txt
CT解析:./scripts/ct.py target.com | ./bin/massdns -r lists/resolvers.txt -t A -o S -w output.txt

子域名发现的20种方法


Rapid7 Forward DNS dataset (Project Sonar)

工具描述:来自rapid7 sonar项目的公共数据集

wget https://scans.io/data/rapid7/sonar.fdns_v2/20170417-fdns.json.gz
cat 20170417-fdns.json.gz | pigz -dc | grep ".target.org" | jq`


San_subdomain_enum.py

工具描述:SSL/TLS证书中的SAN获取子域名

git clone https://xxx.com/appsecco/the-art-of-subdomain-enumeration.git
./san_subdomain_enum.py target.com


Second Order

工具描述:第二阶段域名扫描
通过HTML提取子域名

go get xxx.com/mhmdiaa/second-order
cp ~/go/src/xxx.com/mhmdiaa/second-order/config.json ~/go/src/xxx.com/mhmdiaa/second-order/config-subs-enum.json
编辑修改LogCrawledURLs为True
second-order -base https://target.com -config config.json -output target.com


Subbrute

工具描述:子域名爆破

aptitude install python-dnspython
git clone https://xxx.com/TheRook/subbrute.git
单域名:./subbrute.py target.com
多域名:./subbrute.py target1.com target2.com
域名列表:./subbrute.py -t domains.txt


Subfinder

工具描述:VirusTotal, PassiveTotal, SecurityTrails, Censys, Riddler, Shodan, Bruteforce

go get xxx.com/subfinder/subfinder
配置api
/subfinder --set-config VirustotalAPIKey=0x41414141
scraping:./subfinder -d target.com -o $outfile
scraping & 爆破:subfinder -b -d target.com -w $wordlist -o $outfile
仅爆破:./subfinder --no-passive -d target.com -b -w $wordlist -o $outfie

子域名发现的20种方法


Sublist3r

工具描述:接口Baidu, Yahoo, Google, Bing, Ask, Netcraft, DNSdumpster, VirusTotal, Threat Crowd, SSL Certificates, PassiveDNS

git clone https://xxx.com/aboul3la/Sublist3r.git
cd Sublist3r
pip install -r requirements.txt
./sublist3r.py -d target.com -o $outfile
./sublist3r.py -b -d target.com -o $outfile


vhost-brute

工具描述:虚拟主机爆破

aptitude install php-curl
git clone https://xxx.com/gwen001/vhost-brute.git

子域名发现的20种方法


Virtual-host-discovery

工具描述:虚拟主机爆破

git clone https://xxx.com/jobertabma/virtual-host-discovery.git
ruby scan.rb --ip=1.1.1.1 --host=target.com --output output.txt


安全服务部华中大区致力于湖北、河南两地的安全检测和咨询规划业务支撑。团队拥有非常完善的渗透测试、代码审计、应急响应、网络安保的服务体系和技术能力。同时,主要负责区域内常规安全服务、CTF比赛支撑、红蓝对抗业务和DevSecOps体系建设等,致力于打造一个规范、安全、高效、诚信、专业的安全服务团队。


No.5

招聘启事

高级安全服务工程师(郑州)

————————————
岗位职责
1.负责对客户系统进行渗透测试、红队攻击,全面发现被测系统存在的安全问题并提供修复建议;。
2.客户系统出现安全事件时进行应急处置,协助客户修复安全漏洞;
3.负责对客户的系统进行代码审计,通过对源代码检测和分析,找出代码层面存在的漏洞,并提供修复建议;
岗位要求
1.3年以上攻防经验,具备代码审计、APP客户端二进制测试、攻防演练、安全培训、内网渗透等经验;
2.负责安全服务项目实施工作,能独立完成渗透测试、红队服务;
3.具有较好的工作习惯及较强的文档、报告、方案编写能力;
4.具备优秀的沟通协调能力、学习能力、抗压能力;
加分
1.具有安全相关资质者;
2.具有大型SRC漏洞提交经验、获得年度表彰、大型CTF夺得名次者;
3.具有较强的红蓝对抗实战能力。


简历投递至:[email protected]


子域名发现的20种方法

专注渗透测试技术

全球最新网络攻击技术

END

子域名发现的20种方法

原文始发于微信公众号(白帽子):子域名发现的20种方法

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年6月5日11:07:22
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   子域名发现的20种方法http://cn-sec.com/archives/1086615.html

发表评论

匿名网友 填写信息