
Exploit in Python per la vulnerabilità di escape della sandbox vm2 CVE-2023-30547. Genera un payload JSON codificato in base64 per aprire una shell inversa da ambienti sandbox Node.js vulnerabili.
vm2 è un sandbox che può eseguire codice non fidato con moduli built-in di Node whitelistati. Esiste una vulnerabilità nella sanificazione delle eccezioni di vm2 per le versioni fino alla 3.9.16, che consente agli attaccanti di sollevare un'eccezione host non sanificata all'interno di handleException() che può essere usata per uscire dal sandbox ed eseguire codice arbitrario nel contesto dell'host. Questa vulnerabilità è stata corretta nella versione 3.9.17 di vm2. Non ci sono workaround noti per questa vulnerabilità. Si consiglia agli utenti di aggiornare.
Codice Python per il PoC in https://gist.github.com/leesh3288/381b230b04936dd4d74aaf90cc8bb244. Usato in Codify HTB.
usage: exploit.py [-h] [-u URL] [-p PORT] [-i IP]
description: Opens a reverse shell from a vm2 vulnerable website using a base64-encoded payload in JSON format
options:
-h, --help show this help message and exit
-u URL, --url URL HTTP address of the destination website
-p PORT, --port PORT Port to listen on
-i IP, --ip IP Your IP address