有关js的信息收集
工具1.
抓取网页的所以js文件-JS_Scrapper
使用方法
python3 JS_Scrapper.py --path path.txt
工具2.
JS文件信息收集工具-LinkFinder
使用方法
python3 linkfinder.py -i http://... -o result.html
└─# python3 linkfinder.py -i http://.js -o cli
下载不了模块
这时考虑是网速的原因,这时采用国内的镜像源来加速
pip install 包名-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

0x01 LinkFinder介绍
LinkFinder是一个Python脚本,旨在发现JavaScript文件中的端点及其参数。这样,渗透测试人员和Bug猎手就可以在他们正在测试的网站上收集新的,隐藏的端点。导致新的测试环境,可能包含新的漏洞。它通过将jsbeautifier for python与相当大的正则表达式结合使用来实现。正则表达式由四个小的正则表达式组成。这些负责查找:
完整网址(https://example.com/)
绝对URL或点分URL(/*或../)
带有至少一个斜杠(text/test.php)的相对URL
相对网址,不带斜线(test.php)
输出以HTML或纯文本形式给出
0x02 安装
2.1 手动安装
克隆到本地安装
LinkFinder支持Python 3。
$ git clone https://github.com/GerbenJavado/LinkFinder.git
$ cd LinkFinder
$ python setup.py install
解决依赖关系
pip3 install -r requirements.txt
2.2 Docker一键安装
创建docker镜像
docker build -t linkfinder
运行docker
docker run --rm -v $(pwd):/linkfinder/output linkfinder -i http://example.com/1.js -o /linkfinder/output/output.html
确保使用的``/linkfinder/output` 路径在你的输出路径,
0x03 使用方法
3.1 参数解释
Short Form Long Form Description
-i –input 输入一个URL,文件或者文件夹,js文件必须要以.js后缀结尾
-o –output 默认是以html的结果输出,也可以使用命令行的形式输出
-r –regex 使用正则快速的筛选我们需要的信息 (e.g. ^/api/)
-d –domain Toggle to use when analyzing an entire domain. Enumerates over all found JS files.
-b –burp Toggle to use when inputting a Burp ‘Save selected’ file containing multiple JS files
-c –cookies Add cookies to the request
-h –help show the help message and exit
3.2 使用示例
在在线JavaScript文件中查找端点并将HTML结果输出到results.html的最基本用法:
python linkfinder.py -i https://example.com/1.js -o results.html
CLI / STDOUT输出(不使用jsbeautifier,这使其非常快):
python linkfinder.py -i https://example.com/1.js -o cli
分析整个域及其JS文件:
python linkfinder.py -i https://example.com -d
打p输入(在目标中选择要保存的文件,右键单击,然后Save selected items将该文件作为输入):
python linkfinder.py -i burpfile -b
枚举JavaScript文件的整个文件夹,同时查找以/ api /开头的端点,最后将结果保存到results.html中:
python linkfinder.py -i 'Desktop/*.js' -r ^/api/ -o results.html
0x04 使用截图
转载自 madcoding’s blog!
https://www.mad-coding.cn/2019/12/23/JS文件信息收集工具-LinkFinder/#0x00-前言

浙公网安备 33010602011771号