//這里github官方指令打錯了 這個需要python3支持 所以這里直接把正確的指令改過來就不需要去GITHUB上去確認了
# JSFinder
JSFinder is a tool for quickly extracting URLs and subdomains from JS files on a website.
JSFinder是一款用作快速在網站的js文件中提取URL,子域名的工具。
提取URL的正則部分使用的是[LinkFinder](https://github.com/GerbenJavado/LinkFinder)
Blog:[https://threezh1.github.io/](https://threezh1.github.io/)
## [](https://github.com/Threezh1/JSFinder#%E7%94%A8%E6%B3%95)用法
* **簡單爬取**
`python JSFinder.py -u http://www.mi.com`
這個命令會爬取[http://www.mi.com](http://www.mi.com/)這單個頁面的所有的js鏈接,并在其中發現url和子域名
返回示例:
~~~
url:http://www.mi.com
Find 50 URL:
http://api-order.test.mi.com
http://api.order.mi.com
http://userid.xiaomi.com/userId
http://order.mi.com/site/login?redirectUrl=
...已省略
Find 26 Subdomain:
api-order.test.mi.com
api.order.mi.com
userid.xiaomi.com
order.mi.com
...已省略
~~~
* **深度爬取**
`python3 JSFinder.py -u http://www.mi.com -d`
深入一層頁面爬取JS,時間會消耗的更長。
建議使用-ou 和 -os來指定保存URL和子域名的文件名。 例如:
`python3 JSFinder.py -u http://www.mi.com -d -ou mi_url.txt -os mi_subdomain.txt`
* **批量指定URL/指定JS**
指定URL:
`python3 JSFinder.py -f text.txt`
指定JS:
`python3 JSFinder.py -f text.txt -j`
可以用brupsuite爬取網站后提取出URL或者JS鏈接,保存到txt文件中,一行一個。
指定URL或JS就不需要加深度爬取,單個頁面即可。
* **其他**
\-ou 指定文件名保存URL鏈接 例:
`python3 JSFinder.py -u http://www.mi.com -ou mi_url.txt`
\-os 指定文件名保存子域名 例:
`python3 JSFinder.py -u http://www.mi.com -os mi_subdomain.txt`
* **注意**
url 不用加引號
url 需要http:// 或 https://
指定JS文件爬取時,返回的URL為相對URL
指定URL文件爬取時,返回的相對URL都會以指定的第一個鏈接的域名作為其域名來轉化為絕對URL。
* **截圖**
實測簡單爬取:
[](https://camo.githubusercontent.com/d4d90ad97565b4cc509309bebe61935e42b95511/68747470733a2f2f692e6c6f6c692e6e65742f323031392f30362f31302f3563666534376436643831316134393833332e6a7067)
[](https://camo.githubusercontent.com/3ea373de1ef265d0440fa2eb96ec3b500ccafda7/68747470733a2f2f692e6c6f6c692e6e65742f323031392f30362f31302f3563666534376436633133613839363537382e6a7067)
實測深度爬取:
[](https://camo.githubusercontent.com/84e0112fc252472ab8bfc232f25ca3fa5428dfac/68747470733a2f2f692e6c6f6c692e6e65742f323031392f30362f31302f3563666534653466306663356631323830382e6a7067)
[](https://camo.githubusercontent.com/5f65063a5236616a2e72e5e1e455ca6fc9f5eed7/68747470733a2f2f692e6c6f6c692e6e65742f323031392f30362f31302f3563666534653465653661303037333639302e6a7067)
~~~
http://www.oppo.com
URL:4426 個
子域名:24 個
http://www.mi.com
URL:1043 個
子域名:111 個
http://www.jd.com
URL:3627 個
子域名:306 個
~~~