DepFuzzer 是一个用于发现依赖混淆(dependency confusion)或项目所有者邮箱可被接管问题的工具。
/!\ 此工具要求 Python >= 3.10 /!\
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip3 install -r requirements.txt
或者你也可以使用 Docker 镜像:
$ docker build -t depfuzzer:latest .
$ docker run --rm -it -v "$PWD":/host depfuzzer
该工具可用于扫描文件夹,以查找声明了依赖关系的特定文件,例如:
package.jsonrequirements.txtpython3 main.py --provider pypi --path ~/Documents/Projets/MyProject/
此外,该工具还可用于扫描某个特定的依赖:
python3 main.py --provider pypi --dependency requests:0.1.0
请注意,该工具使用了一个名为 deps.dev 的第三方服务,你可能需要配置代理才能访问它。
______ ______
| _ \ | ___|
| | | |___ _ __ | |_ _ _ ___________ _ __
| | | / _ \ '_ \| _| | | |_ /_ / _ \ '__|
| |/ / __/ |_) | | | |_| |/ / / / __/ |
|___/ \___| .__/\_| \__,_/___/___\___|_|
| |
|_|
usage: main.py [-h]
--provider {npm,pypi,cargo,go,maven,gradle,rubygems,nuget,all}
(--path PATH | --dependency DEPENDENCY)
[--print-takeover]
[--output-file OUTPUT_FILE]
[--check-email]
Dependency checker
options:
-h, --help show this help message and exit
--provider {npm,pypi,cargo,go,maven,gradle,rubygems,all}
--path PATH Path to folder(s) to analyze
--dependency DEPENDENCY
Specify the name of one dependency to check. If you specify the version,
please use ':' to separate name and version.
--print-takeover Don't wait the end of the script to display takeoverable modules
--output-file OUTPUT_FILE
File where results will be stored
--check-email Check if the email's owner of the dependency exists. Might be longer to
analyze.
如果你发现了 Bug 或有任何想法,欢迎在本项目上提交 issue!
此工具并非旨在找出项目中所有的依赖混淆问题。此外,由于解析 requirements 文件的复杂性,该工具已知会产生误报。
在采取行动之前,请务必手动检查其是否可被利用。
请注意,实际利用此漏洞可能会产生无法控制的副作用,请务必小心。
如果该工具被用于恶意目的,Synacktiv 概不负责,该工具仅用于教育目的。
本项目采用 MIT 许可证授权 - 详情请参阅 LICENSE 文件。