仓库地址:https://github.com/llm-sec/transformer-hacker
transformer相关漏洞武器化,方便利用漏洞,目前支持功能:
rce的checkpoint,通过检查点进行命令执行TODO
前置依赖:
克隆仓库到本地:
git clone git@github.com:llm-sec/huggingface-hacker.git
安装依赖库:
# 如果要让poc.py能够运行,安装的transformers版本要是4.37.2之前的
pip install transformers==4.37.2
pip install tensorflow
运行main.py查看使用说明:
python main.py --help
生成带有命令执行的checkpoint,制定模型名称和要执行的命令:
python main.py --directory ./rce-checkpoint --model bert-base-uncased --command 'open /System/Applications/Calculator.app'
生成的payload文件夹如下:

对于漏洞原理的解读请移步此文章:
huggingface/transformers RCE漏洞分析(CVE-2024-3568)
扫码加入大模型安全交流群:
如群二维码过期,可以加我个人微信,发送【大模型安全】拉你进群:
7 commits
Python
97.0%
Dockerfile
2.2%
仓库地址:https://github.com/llm-sec/transformer-hacker
transformer相关漏洞武器化,方便利用漏洞,目前支持功能:
rce的checkpoint,通过检查点进行命令执行TODO
前置依赖:
克隆仓库到本地:
git clone git@github.com:llm-sec/huggingface-hacker.git
安装依赖库:
# 如果要让poc.py能够运行,安装的transformers版本要是4.37.2之前的
pip install transformers==4.37.2
pip install tensorflow
运行main.py查看使用说明:
python main.py --help
生成带有命令执行的checkpoint,制定模型名称和要执行的命令:
python main.py --directory ./rce-checkpoint --model bert-base-uncased --command 'open /System/Applications/Calculator.app'
生成的payload文件夹如下:

对于漏洞原理的解读请移步此文章:
huggingface/transformers RCE漏洞分析(CVE-2024-3568)
扫码加入大模型安全交流群:
如群二维码过期,可以加我个人微信,发送【大模型安全】拉你进群:
7 commits
Python
97.0%
Dockerfile
2.2%