Creosote 是我们针对 CVE-2007-4559 所描述的 tarfile 漏洞而提出的扫描解决方案。该工具会递归遍历指定目录并搜索 Python 文件。当工具发现 Python 文件时,会扫描其中是否使用了 tarfile 模块,然后将代码解析为 AST 以查找存在漏洞的代码。
Creosote 将所有发现的漏洞归为 3 大类:
要运行 Creosote,你只需将目录传递给它:
python3 creosote.py <directory to scan>
Creosote 可同时在 Linux、macOS 和 Windows 上运行。该工具已在 Python 3.9 及更高版本上完成测试。