这是我在参加 TryHackMe 的 Hackfinity 活动时发现的一个认证远程代码执行漏洞。该漏洞已在运行于 Ubuntu 上的 1.6.2 和 1.6.3 版本中进行了测试,并且可能影响更低的版本。默认情况下,WBCE 信任任何上传到它的模块。对 .zip 模块文件进行的唯一检查是它是否包含 info.php 文件。以下内容摘自 WBCE 的 /admin/modules/install.php:
// Check if uploaded file is a valid Add-On zip file
if (!($list && file_exists($temp_unzip . 'info.php'))) {
// Remove the temp unzip directory and the temp zip file
rm_full_dir($temp_unzip);
if (file_exists($temp_file)) {
unlink($temp_file);
}
$admin->print_error($MESSAGE['GENERIC_INVALID_ADDON_FILE']);
}
一旦模块通过此检查而被视为"有效附加组件(valid Add-On)",任何 install.php 脚本都会在服务器上自动执行。该漏洞利用工具仅需使用一个 php 反弹 shell 作为 PHP 载荷。
YouTube 演示: https://youtu.be/Dhg5gRe9Dzs?si=LHC29PBRRRPNNy73
Description:
This is an Authenticated RCE exploit for WBCE CMS version <= 1.6.3
It will create an infected module .zip file and start a netcat listener.
Once the zip is created, you will have to login to the admin page
to upload and install the module, which will immediately run the shell
Shell taken from: https://github.com/pentestmonkey/php-reverse-shell/tree/master
Usage:
./exploit.sh <lhost> <lport>