
Questa è una vulnerabilità di esecuzione di codice in remoto autenticata che ho trovato durante l'evento Hackfinity di TryHackMe. È stata testata sulle versioni 1.6.2 e 1.6.3 in esecuzione su Ubuntu, e potenzialmente potrebbe interessare anche versioni precedenti. Di default, WBCE si fida di qualsiasi modulo caricato al suo interno. L'unico controllo eseguito sul file di modulo .zip è che contenga un file info.php. Estratto da /admin/modules/install.php di 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 volta che il modulo supera questo controllo come "Add-On valido", qualsiasi script install.php viene automaticamente eseguito sul server. Questo exploit usa semplicemente una reverse shell PHP come payload PHP.
Dimostrazione 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>