
Exploit de RCE autenticado para WBCE CMS <= 1.6.3 que crea un zip de módulo malicioso con un reverse shell en PHP y un listener de netcat.
Esta es una vulnerabilidad de ejecución remota de código autenticada que encontré mientras jugaba en el evento Hackfinity de TryHackMe. Fue probada en las versiones 1.6.2 y 1.6.3 ejecutándose en Ubuntu, y potencialmente afecta también a versiones anteriores. Por defecto, WBCE confía en cualquier módulo que se le suba. La única comprobación que se realiza sobre el archivo de módulo .zip es si contiene un archivo info.php. Extracto de /admin/modules/install.php de 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']);
}
Una vez que el módulo pasa esta verificación como "Add-On válido", cualquier script install.php se ejecuta automáticamente en el servidor. Este exploit simplemente utiliza un reverse shell en PHP como payload PHP.
Demostración en 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>