elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Hacking
| | |-+  Bugs y Exploits
| | | |-+  Script nmap NSE - VMware vCenter Server CVE-2021-21972 - RCE
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Script nmap NSE - VMware vCenter Server CVE-2021-21972 - RCE  (Leído 3,860 veces)
el-brujo
ehn
***
Desconectado Desconectado

Mensajes: 21.590


La libertad no se suplica, se conquista


Ver Perfil WWW
Script nmap NSE - VMware vCenter Server CVE-2021-21972 - RCE
« en: 2 Marzo 2021, 23:22 pm »

Fuente:
https://github.com/alt3kx/CVE-2021-21972

Código
  1. description = [[
  2. VMware vCenter Server CVE-2021-21972 Remote Code Execution Vulnerability
  3.  
  4. This script looks the existence of CVE-2021-21972 based on the following PATH
  5. "/ui/vropspluginui/rest/services/uploadova" trough a POST request and looking in
  6. response body (500) the words "uploadFile",that means the vCenter is avaiable
  7. to accept files via POST without any restrictions
  8.  
  9. Manual inspection:
  10. # curl -i -s -k -X $'GET'
  11. -H $'Host: <target>'
  12. -H $'User-Agent: alex666'
  13. $'https://<target>/ui/vropspluginui/rest/services/getstatus'
  14.  
  15. # curl -i -s -k -X $'GET'
  16. -H $'Host: <target>'
  17. -H $'User-Agent: alex666'$'https://<target>/ui/vropspluginui/rest/services/uploadova'
  18.  
  19. # curl -i -s -k -X $'POST'
  20. -H $'Host: <target>'
  21. -H $'User-Agent: alex666'
  22. -H $'Content-Type: application/x-www-form-urlencoded'
  23. -H $'Content-Length: 0' $'https://<target>/ui/vropspluginui/rest/services/uploadova'
  24.  
  25. References:
  26. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21972'
  27. https://www.vmware.com/security/advisories/VMSA-2021-0002.html
  28. ]]
  29.  
  30. ---
  31. -- @usage
  32. -- nmap -p443 --script CVE-2021-21972.nse <target>
  33. -- @output
  34. -- PORT    STATE SERVICE
  35. -- 443/tcp open  https
  36. -- | CVE-2021-21972:
  37. -- |   VULNERABLE:
  38. -- |   vCenter 6.5-7.0 RCE
  39. -- |     State: VULNERABLE (Exploitable)
  40. -- |     IDs:  CVE:CVE-2021-21972
  41. -- |       The vSphere Client (HTML5) contains a remote code execution vulnerability in a vCenter Server plugin.
  42. -- |       A malicious actor with network access to port 443 may exploit this issue to execute commands with
  43. -- |       unrestricted privileges on the underlying operating system that hosts vCenter Server.
  44. -- |     Disclosure date: 2021-02-23
  45. -- |     References:
  46. -- |_      https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21972
  47.  
  48.  
  49. author = "Alex Hernandez aka alt3kx <alt3kx@protonmail.com>"
  50. license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
  51. categories = {"vuln", "exploit"}
  52.  
  53. local shortport = require "shortport"
  54. local http = require "http"
  55. local stdnse = require "stdnse"
  56. local string = require "string"
  57. local vulns = require "vulns"
  58.  
  59. portrule = shortport.http
  60.  
  61. action = function(host, port)
  62.  
  63.    local vuln = {
  64.        title = "vCenter 6.5-7.0 RCE",
  65.        state = vulns.STATE.NOT_VULN,
  66.        IDS = { CVE = 'CVE-2021-21972' },
  67. description = [[
  68. The vSphere Client (HTML5) contains a remote code execution vulnerability in a vCenter Server plugin.
  69. A malicious actor with network access to port 443 may exploit this issue to execute commands with
  70. unrestricted privileges on the underlying operating system that hosts vCenter Server.]],
  71.  
  72. references = {
  73.           'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-21972'
  74.       },
  75.       dates = {
  76.           disclosure = {year = '2021', month = '02', day = '23'},
  77.       },
  78.  
  79.    }  
  80.  
  81.    local report = vulns.Report:new(SCRIPT_NAME, host, port)
  82.  
  83.    local uri = "/ui/vropspluginui/rest/services/uploadova"
  84.  
  85.    local options = {header={}}
  86.    options['header']['User-Agent'] = "Mozilla/5.0 (compatible; vCenter)"
  87.  
  88.    local response = http.post(host, port, uri)
  89.  
  90.    if ( response.status == 500 ) then
  91.  
  92.    local title = string.match(response.body, "uploadFile")
  93.  
  94.        if (title == "uploadFile") then
  95.         vuln.state = vulns.STATE.EXPLOIT
  96.        else
  97.       vuln.state = vulns.STATE.NOT_VULN
  98.       end
  99.  
  100.    end
  101.  
  102.    return report:make_output (vuln)
  103. end
  104.  
  105.  
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Nmap SSH keyHost Script DUDA
Hacking
Fritos 1 4,580 Último mensaje 29 Agosto 2012, 01:18 am
por peib0l
NMAP NSE subscan en un script
Hacking
ARSET 6 4,222 Último mensaje 15 Enero 2013, 14:41 pm
por it3r
Vmware + Ubuntu Server + no-ip + router encore
Redes
leandromatiasp 0 1,464 Último mensaje 15 Enero 2013, 22:35 pm
por leandromatiasp
Oracle WebLogic Server RCE JNDI - CVE-2021-2109
Bugs y Exploits
el-brujo 0 4,157 Último mensaje 25 Enero 2021, 22:44 pm
por el-brujo
nmap script apache server status
Hacking
daidahan 1 326 Último mensaje Ayer a las 16:18
por CaptainH
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines