
Authentifizierter RCE-Exploit für WBCE CMS <= 1.6.3, der eine bösartige Modul-ZIP-Datei mit einer PHP-Reverse-Shell und einem Netcat-Listener erstellt.
Dies ist eine Schwachstelle zur authentifizierten Remote-Codeausführung (Authenticated Remote Code Execution), die ich beim Spielen im Hackfinity-Event von TryHackMe entdeckt habe. Sie wurde auf den Versionen 1.6.2 und 1.6.3 unter Ubuntu getestet und betrifft möglicherweise auch ältere Versionen. Standardmäßig vertraut WBCE jedem Modul, das hochgeladen wird. Die einzige Prüfung, die bei der .zip-Moduldatei durchgeführt wird, ist, ob sie eine info.php-Datei enthält. Auszug aus /admin/modules/install.php von WBCE:
// 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']);
}
Sobald das Modul diese Prüfung als „gültiges Add-On“ besteht, werden alle install.php-Skripte automatisch auf dem Server ausgeführt. Dieser Exploit verwendet einfach eine php-Reverse-Shell als php-Payload.
YouTube-Demonstration: 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>