Weblogic漏洞之弱口令、任意文件读取、上传shell

转载自:https://blog.****.net/qq_29647709/article/details/84930879

弱口令

环境启动后,访问http://192.168.1.15:7001/console/login/LoginForm.jsp,即为weblogic后台。
本环境存在弱口令可以直接登录:

Weblogic漏洞之弱口令、任意文件读取、上传shell

weblogic常用弱口令:

1.  Oracle - WebLogic
Method    HTTP
User ID    system
Password    password
Level    Administrator
Doc    
Notes    Login located at /console

2.  Oracle - WebLogic
Method    HTTP
User ID    weblogic
Password    weblogic
Level    Administrator
Doc    
Notes    Login located at /console

3.  Oracle - WebLogic
Version    9.0 Beta (Diablo)
User ID    weblogic
Password    weblogic
Doc    

4.  Oracle - WebLogic Process Integrator
Version    2.0
User ID    admin
Password    security
Doc    

5.  Oracle - WebLogic Process Integrator
Version    2.0
User ID    joe
Password    password
Doc    

6.  Oracle - WebLogic Process Integrator
Version    2.0
User ID    mary
Password    password
Doc    

7.  Oracle - WebLogic Process Integrator
Version    2.0
User ID    system
Password    security
Doc    

8.  Oracle - WebLogic Process Integrator
Version    2.0
User ID    wlcsystem
Password    wlcsystem
Doc    

9.  Oracle - WebLogic Process Integrator
Version    2.0
User ID    wlpisystem
Password    wlpisystem
Doc    
任意文件读取漏洞的利用
假设不存在弱口令,如何对weblogic进行渗透?
本环境前台模拟了一个任意文件下载漏洞,访问http://192.168.1.15:7001/hello/file.jsp?path=/etc/passwd可见成功读取passwd文件

Weblogic漏洞之弱口令、任意文件读取、上传shell

那么,该漏洞如何利用?
读取后台用户密文与**文件
weblogic密码使用AES(老版本3DES)加密,对称加密可解密,只需要找到用户的密文与加密时的**即可。这两个文件均位于base_domain下,名为SerializedSystemIni.dat和config.xml,在本环境中为./security/SerializedSystemIni.dat和./config/config.xml(基于当前目录/root/Oracle/Middleware/user_projects/domains/base_domain)。
**获取
SerializedSystemIni.dat是一个二进制文件,所以一定要用burpsuite来读取,用浏览器直接下载可能引入一些干扰字符。在burp里选中读取到的那一串乱码,右键copy to file就可以保存成一个文件:
Weblogic漏洞之弱口令、任意文件读取、上传shell

密文获取
config.xml是base_domain的全局配置文件,所以乱七八糟的内容比较多,找到其中的的值,即为加密后的管理员密码,不要找错了:

Weblogic漏洞之弱口令、任意文件读取、上传shell

解密密文

Weblogic漏洞之弱口令、任意文件读取、上传shell

可见,解密后和预设的密码一致,说明成功。

后台上传webshell

获取到管理员密码后,登录后台。点击锁定并编辑

Weblogic漏洞之弱口令、任意文件读取、上传shell

点击左侧的部署,可见一个应用列表:

Weblogic漏洞之弱口令、任意文件读取、上传shell

点击安装,选择“上载文件”:

Weblogic漏洞之弱口令、任意文件读取、上传shell

上传war包。值得注意的是,我们平时tomcat用的war包不一定能够成功,你可以将你的webshell放到本项目的web/hello.war这个压缩包中,再上传。上传成功后点下一步。

填写应用名称:

Weblogic漏洞之弱口令、任意文件读取、上传shell

继续一直下一步,最后点完成。

Weblogic漏洞之弱口令、任意文件读取、上传shell

最后访问执行shell:
http://192.168.1.15:7001/test3693/