好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

TurboMail邮件系统任意文件读取漏洞(需管理权限

TurboMail邮件系统处理日志文件时未对文件路径进行判断,导致可读取服务器上的任意文件。

邮件后台管理进行[WEB日志查看]时存在任意文件读取 漏洞 。

漏洞代码位于TomcatLogAjax.class,其中getLog函数读取web服务器日志文件的源代码实现如下: publicstatic void getLog(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ MailSession ms = WebUtil.getms(request,response); if (ms == null) { AjaxUtil.ajaxFail(request, response,"info.nologin", null); return; } UserInfo userinfo = ms.userinfo; if (userinfo == null) { AjaxUtil.ajaxFail(request, response,"info.loginfail", null); return; } String logPath = getLogPath(); String subType =WebUtil.getParameter(request, true, "subType"); if ((subType != null) &&("getLogList".equals(subType))) { getLogList(request, response, logPath); return; } StringsLogFile = WebUtil.getParameter(request, true, "logFile"); …/此处省略N行 try{ FiletempFile = new File(logPath + SysConts.FILE_SEPARATOR + sLogFile); //漏洞点,直接拼接 if (!tempFile.exists()) { AjaxUtil.ajaxFail(request, response,"info.ajax.fail", null); return; } bb.clear(); fis = new RandomAccessFile(tempFile,"r"); if (bReverse) { long lFileLen = fis.length(); fis.seek(lFileLen); bsLine = ReadLineInput.RReadLine(fis, false,lo, bb, temp_bs); } else { bsLine = ReadLineInput.ReadLine(fis,false, lo, bb, temp_bs); } getLog函数在处理用户传递的参数logFile时未进行安全路径的检测导致可以使用进行读取服务器上的任意文件。

使用邮箱管理员账号登陆邮箱管理后台,进行邮件[日志查看],选择[web服务器日志]

 

 

http请求包如下:  

使用burpsuit修改http请求包的logFile参数为 windows /win.ini:  

可以发现已经成功读取服务器上的文件:  

测试下读取c:/boot.ini:  

 

修复方案:

禁止读取的文件名包含/和\

查看更多关于TurboMail邮件系统任意文件读取漏洞(需管理权限的详细内容...

  阅读:64次