如何使用JSubFinder從網頁JS代碼中尋找到敏感信息
VSole2022-10-31 18:45:10
關于JSubFinder
JSubFinder是一款基于Golang開發的敏感信息搜索工具,根據給定的URL地址,廣大研究人員可以輕松使用JSubFinder來尋找目標網站頁面&JavaScript中隱藏的子域名和敏感信息。
該工具利用了Go的高性能特性,并支持處理大量數據,而且可以輕松與其他工具連接成工作流。
工具下載
該工具基于Go開發,因此我們首先需要在本地設備上安裝并配置好Go環境。接下來,廣大研究人員就可以直接使用下列命令來安裝JSubFinder了:
go get github.com/ThreatUnkown/jsubfinderwget https://raw.githubusercontent.com/ThreatUnkown/jsubfinder/master/.jsf_signatures.yaml && mv .jsf_signatures.yaml ~/.jsf_signatures.yaml
工具使用
搜索-根據給定的URL地址搜索子域名和敏感信息
$ jsubfinder search -h
Execute the command specified
Usage:
JSubFinder search [flags]
Flags:
-c, --crawl 啟用爬蟲功能
-g, --greedy 檢測目標URL的所有文件和JavaScript代碼
-h, --help 查看搜索功能幫助信息
-f, --inputFile string 包含目標域名的文件路徑
-t, --threads int 設置需要使用的線程數量(默認為5)
-u, --url strings 需要檢測的目標URL
Global Flags:
-d, --debug 啟用調試模式,日志將存儲在log.info中
-K, --nossl 跳過SSL證書驗證(默認為true)
-o, --outputFile string 輸出文件的存儲路徑及文件名
-s, --secrets 檢測結果中的敏感信息,例如API密鑰等
--sig string 設置敏感數據的簽名位置
-S, --silent 不向控制臺終端打印數據
搜索功能使用樣例
$ jsubfinder search -u www.google.com $ jsubfinder search -f file.txt $ echo www.google.com | jsubfinder search $ echo www.google.com | httpx --silent | jsubfinder search$ apis.google.com ogs.google.com store.google.com mail.google.com accounts.google.com www.google.com policies.google.com support.google.com adservice.google.com play.google.com
啟用敏感信息搜索功能
--secrets=“”選項將把工具檢測到的敏感信息存儲到secrets.txt文件中:
$ echo www.you*tube.com | jsubfinder search --secrets="" www.you*tube.com you*tubei.you*tube.com payments.you*tube.com 2Fwww.you*tube.com 252Fwww.you*tube.com m.you*tube.com tv.you*tube.com music.you*tube.com creatoracademy.you*tube.com artists.you*tube.com Google Cloud API Key <redacted> found in content of https://www.you*tube.com Google Cloud API Key <redacted> found in content of https://www.you*tube.com Google Cloud API Key <redacted> found in content of https://www.you*tube.com Google Cloud API Key <redacted> found in content of https://www.you*tube.com Google Cloud API Key <redacted> found in content of https://www.you*tube.com Google Cloud API Key <redacted> found in content of https://www.you*tube.com
高級使用樣例
$ echo www.google.com | jsubfinder search -crawl -s "google_secrets.txt" -S -o jsf_google.txt -t 10 -g
參數解釋:
-crawl:使用默認爬蟲爬取目標URL頁面;
-s:啟用JSubFinder 的敏感信息搜索功能;
-S:不向控制臺終端打印數據;
-o:將輸出結果保存到指定文件;
-t:使用10個線程;
-g:搜索每個URL中的JavaScript;
代理使用
該工具支持使用TLS MitM啟用上流HTTP代理,該特性將提供以下功能:
1、實時瀏覽網站,JSubFinder將實時搜索子域名和敏感信息;
2、支持將JSubFinder運行在其他服務器以實現均衡負載;
$ JSubFinder proxy -h
Execute the command specified
Usage:
JSubFinder proxy [flags]
Flags:
-h, --help 查看代理幫助信息
-p, --port int 代理監聽的端口(默認為8444)
--scope strings 指定多個URL地址,用逗號分隔,例如www.google.com,www.netflix.com
-u, --upstream-proxy string 上游代理地址 ,例如http://127.0.0.1:8888(默認為"http://127.0.0.1:8888")
Global Flags:
-d, --debug 啟用調試模式,日志將存儲在log.info中
-K, --nossl 跳過SSL證書驗證(默認為true)
-o, --outputFile string 輸出文件的存儲路徑及文件名
-s, --secrets 檢測結果中的敏感信息,例如API密鑰等
--sig string 設置敏感數據的簽名位置
-S, --silent 不向控制臺終端打印數據
代理使用樣例
$ jsubfinder proxy Proxy started on :8444 Subdomain: out.reddit.com Subdomain: www.reddit.com Subdomain: 2Fwww.reddit.com Subdomain: alb.reddit.com Subdomain: about.reddit.com