关于route-detect
route-detect是一款功能强大的Web应用程序路由安全扫描工具,该工具可以帮助广大研究人员在Web应用程序路由中轻松识别和检测身份认证漏洞和授权漏洞。
Web应用程序HTTP路由中的身份认证(authn)和授权(authz)漏洞是目前最常见的Web安全问题,下列行业标准也足以突出证明了此类安全问题的严重性:
支持的Web框架
当前版本的route-detect支持下列Web框架:
工具安装
由于该工具使用Python开发,因此我们首先需要在本地设备上安装并配置好Python环境。
接下来,广大研究人员可以直接使用下列命令将该项目源码克隆至本地:
git clone https://github.com/mschwager/route-detect.git
或者直接使用pip工具安装最新版本的route-detect:
$ python -m pip install --upgrade route-detect
安装完成后,我们可以使用下列命令检测route-detect是否安装成功:
$ echo 'print(1 == 1)' | semgrep --config $(routes which test-route-detect) -
Scanning 1 file.
Findings:
/tmp/stdin
routes.rules.test-route-detect
Found '1 == 1', your route-detect installation is working correctly
1┆ print(1 == 1)
Ran 1 rule on 1 file: 1 finding.
工具使用
route-detect提供了routes命令并使用semgrep来搜索路由信息。
使用which子命令可以将semgrep指向正确的Web应用程序规则:
$ semgrep --config $(routes which django) path/to/django/code
使用viz子命令可以在浏览器中可视化查看路由信息:
$ semgrep --json --config $(routes which django) --output routes.json path/to/django/code
$ routes viz --browser routes.json
如果你不确定目标Web应用程序所使用的框架,可以使用all ID检索和查看:
$ semgrep --json --config $(routes which all) --output routes.json path/to/code
如果你有自己自定义的authn或authz逻辑,可以拷贝route-detect的规则:
$ cp $(routes which django) my-django.yml
我们还可以根据需求修改并运行规则:
$ semgrep --json --config my-django.yml --output routes.json path/to/django/code
$ routes viz --browser routes.json
工具运行截图
许可证协议
本项目的开发与发布遵循BSD-3-Clause开源许可证协议。
项目地址
route-detect:
https://github.com/mschwager/route-detect