通過收集子域名資訊來進行滲透是目前常見的一種手法。 子域名資訊收集可以通過手工,也可以通過工具,還可以通過普通及漏洞搜尋引擎來進行分析。 在挖SRC漏洞時,子域名資訊的收集至關重要!
子域名探測可以幫我們發現滲透測試中更多的服務,這将增加發現漏洞的可能性 查找一些使用者上較少,被人遺忘的子域名,其上運作的應用程式可能會使我們發現關鍵漏洞 通常,同一組織的不同域名/應用程式中存在相同的漏洞 子域名中的常見資産類型一般包括辦公系統,郵箱系統,論壇,商城等,其他管理系統,網站管理背景等較少出現在子域名中
https://crt.sh/ https://censys.io/ https://transparencyreport.google.com/https/certificates https://dnsdumpster.com/ https://hackertarget.com/find-dns-host-records/ https://x.threatbook.cn/ https://www.virustotal.com/gui/home/search https://phpinfo.me/domain/ https://site.ip138.com/baidu.com/domain.htm https://www.t1h2ua.cn/tools/ http://tool.chinaz.com/subdomain/ https://spyse.com/site/not-found?q=domain%3A"github"&criteria=cert
Layer子域名爆破機 Layer是windows下的一款子域名探測工具,其工作原理是利用子域名字典進行爆破,使用簡單容易上手。![]()
子域名探測方法大全
Amass 工具描述:爆破, google, VirusTotal, alt names go get -u github.com/OWASP/Amass/... amass -d target.com -o $outfile 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![]()
子域名探測方法大全
•Google intitle=公司名稱 過濾掉 -site:www.target.com 我們可以在Google搜尋中使用 site:運算符來查找一個域的所有子域名 谷歌還額外支援減号運算符 site:*.wikimedia.org -www -store -jobs -uk 以排除我們不感興趣的子域名![]()
子域名探測方法大全
•Bing Bing搜尋引擎也支援一些進階搜尋運算符。 與Google一樣,Bing也支援site:運算符,可以幫助您檢查除Google搜尋之外的其他結果。 發現子域名: site:target.com •百度 •鐘馗之眼 https://www.zoomeye.org/ site=域名 •FOFA https://fofa.so/ 文法:domain=”baidu.com” 提示:以上方法無需爆破,查詢速度快,需要快速收集資産時可以優先使用,後面再用其他方法補充。
SSL/TLS證書
證書透明度(Certificate Transparency)是證書授權機構的一個項目,證書授權機構會将每個SSL/TLS證書釋出到公共日志中。 一個SSL/TLS證書通常包含域名、子域名和郵件位址。 查找某個域名所屬證書的最簡單的方法就是使用搜尋引擎搜尋一些公開的CT日志。
線上查詢: https://developers.facebook.com/tools/ct/ https://google.com/transparencyreport/https/ct/
CTFR 工具描述:濫用證書透明記錄 git clone https://xxx.com/UnaPibaGeek/ctfr.git cd ctfr pip3 install -r requirements.txt python3 ctfr.py -d target.com -o $outfile
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![]()
子域名探測方法大全
Cloudflare_enum.py 工具描述:從Cloudflare提取子域名 dns聚合器 cloudflare_subdomain_enum.py [email protected] target.com
Crt_enum_web.py 工具描述:解析https://crt.sh/頁面的子域名 pip install psycopg2 python3 crtsh_enum_web.py target.com
San_subdomain_enum.py 工具描述:SSL/TLS證書中的SAN擷取子域名 ./san_subdomain_enum.py target.com
SAN(Subject Alternate Name)主題備用名稱,主題備用名稱證書簡單來說,在需要多個域名,将其用于各項服務時,可使用SAN證書。 允許在安全證書中使用subjectAltName字段将多種值與證書關聯,這些值被稱為主題備用名稱。名稱可包括:IP位址、DNS名稱等。
工具描述:SSL/TLS證書中的SAN擷取子域名 如上。
有些項目收集了全網際網路範圍内的掃描資料,并将其提供給研究人員和安全社群。 該項目釋出的資料集是子域名資訊的寶庫。 雖然在這個龐大的資料集中找到子域名就像大海撈針,但卻值得我們去一試。
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`
Forward DNS(https://scans.io/study/sonar.fdns_v2) 資料集作為Project Sonar的一部分釋出。 資料格式是通過gzip壓縮的JSON檔案。 我們可以解析資料集以查找給定域名的子域名。 資料集很大(壓縮後:20+GB,壓縮前:300+GB) Command to parse & extract sub-domains for a given domain $ curl -silent https://scans.io/data/rapid7/sonar.fdns_v2/20170417-fdns.json.gz | pigz -dc | grep ".icann.org" | jq![]()
子域名探測方法大全
資料聚合網站 threatcrowd https://scans.io/study/sonar.rdns_v2 https://opendata.rapid7.com/
•資訊洩露 首先找到目标站點,在官網中可能會找到相關資産(多為辦公系統,郵箱系統等),關注一下頁面底部,也許有管理背景等收獲。 •檔案洩漏 crossdomain.xml(跨域政策檔案cdx) robots.txt •Git倉庫洩露 •從流量中分析提取
BiLE-suite 工具描述:HTML解析,反向dns解析 aptitude install httrack git clone https://xxx.com/sensepost/BiLE-suite.git perl BiLE.pl 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
線上查詢: VirusTotal(https://www.virustotal.com/) ViewDNS(https://viewdns.info/) DNSdumpster(https://dnsdumpster.com/) Threatcrowd(https://www.threatcrowd.org/)
工具描述:HTML解析,反向dns解析 如上。
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![]()
子域名探測方法大全
域傳送是一種DNS事務,DNS伺服器将其全部或部分域檔案的副本傳遞給另一個DNS伺服器。 如果未安全地配置域傳輸送,則任何人都可以對指定名稱的伺服器啟動域傳送并擷取域檔案的副本。 根據設計,域檔案包含有關域和儲存在域中的大量主機資訊。
Windows: 1.nslookup指令進入互動式shell 2.server指令 參數設定查詢将要使用的DNS伺服器 3.ls指令列出某個域中的所有域名
Linux: Dig 工具描述:dns區域傳送,dns反向解析,dns解析 dig +multi AXFR target.com dig +multi AXFR $ns_server target.com
cloudflare_subdomain_enum.py [email protected][4] target.com
域名緩存偵測(DNS Cache Snooping)技術 在企業網絡中,通常都會配置DNS伺服器,為網絡内的主機提供域名解析服務。 這些DNS不僅解析自己的私有域名,還會用遞歸方式,請求公網的DNS解析第三方域名,如baidu.com之類。 為了提升性能,通常會使用緩存記錄,記錄解析過的域名,尤其是第三方域名。 域名緩存偵測(DNS Cache Snooping)技術就是向這些伺服器發送域名解析請求,但要求不使用遞歸模式。 這樣DNS隻能解析私有域名和緩存中儲存的域名。 借助該項技術,滲透測試人員就知道哪些域名是否被過請求過。 例如,測試人員可以送出某安全軟體更新所使用的域名,如果有記錄,說明該網絡使用該種安全軟體。
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![]()
子域名探測方法大全
由于DNSSEC處理不存在域名的方式,您可以"周遊"DNSSEC域并枚舉該域中的所有域名。 您可以從這裡(https://info.menandmice.com/blog/bid/73645/Take-your-DNSSEC-with-a-grain-of-salt) 了解有關此技術的更多資訊。
Ldns-walk 工具描述:DNSSEC zone walking, 如果DNSSEC NSEC開啟,可以獲得全部域名。 aptitude install ldnsutils ldns-walk target.com ldns-walk @nsserver.com target.com 如果DNSSEC NSEC開啟,可以獲得全部域名。![]()
子域名探測方法大全
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
SPF是通過域名的TXT記錄來進行設定的,SPF記錄列出了所有被授權代表域名發送電子郵件的主機
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![]()
子域名探測方法大全
vhost-brute 工具描述:虛拟主機爆破 aptitude install php-curl git clone https://xxx.com/gwen001/vhost-brute.git![]()
子域名探測方法大全
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
通過域名查詢到 ASN,再通過 ASN 查詢到所屬的所有 ip 範圍
目前最好的解決方式是通過先擷取一個絕對不存在域名的響應内容,再周遊擷取每個字典對應的子域名的響應内容,通過和不存在域名的内容做相似度比對,來枚舉子域名,但這樣的實作是以犧牲速度為代價 •https://www.freebuf.com/news/133873.html •https://xz.aliyun.com/t/5509
https://github.com/shmilylty/OneForAll 工具也有很多厲害的,平時我一般使用 OneForALL + ESD + JSfinder 來進行搜集,(ESD 可以加載 layer 的字典,很好用)
https://github.com/aboul3la/Sublist3r - 強大的快速子域枚舉工具 評分: 🌟🌟🌟🌟🌟 | 程式設計語言: Python 2.x/3.x | 仍在維護: ✔️
https://github.com/guelfoweb/knock - Knock子域名擷取,可用于查找子域名接管漏洞 評分: 🌟🌟🌟🌟🌟 | 程式設計語言: Python 2.x | 仍在維護: ✔️
https://github.com/yanxiu0614/subdomain3 - 一款便捷高效的子域名爆破工具 評分: 🌟🌟🌟🌟🌟 | 程式設計語言: Python 3.x | 仍在維護: ✔️
https://github.com/caffix/amass - Go語言開發的子域名枚舉工具 評分: 🌟🌟🌟🌟🌟 | 程式設計語言: Go | 仍在維護: ✔️
https://github.com/Ice3man543/subfinder - 繼承于Sublist3r項目的子產品化體系結構,一個強勁的子域名枚舉工具 評分: 🌟🌟🌟🌟🌟 | 程式設計語言: Go | 仍在維護: ✔️
https://github.com/janniskirschner/horn3t - 帶有網頁截圖功能的子可視化域名枚舉工具 評分: 🌟🌟🌟🌟🌟 | 程式設計語言: Python 3.x | 仍在維護: ✔️
https://github.com/lijiejie/subDomainsBrute - Lijiejie開發的一款使用廣泛的子域名爆破枚舉工具 評分: 🌟🌟🌟🌟🌟 | 程式設計語言: Python 2.x | 仍在維護: ✖️
https://github.com/ring04h/wydomain - 豬豬俠開發的一款域名收集全面、精準的子域名枚舉工具 評分: 🌟🌟🌟🌟🌟 | 程式設計語言: Python 2.x | 仍在維護: ✖️
https://github.com/LangziFun/LangSrcCurise
https://www.freebuf.com/sectool/198396.html
https://mp.weixin.qq.com/s/m8ucI1bDxILM8wLU6pLmoQ https://xz.aliyun.com/t/3478 https://blog.csdn.net/qq_39293438/article/details/104829825