
Exploit RCE authentifié pour WBCE CMS <= 1.6.3 qui crée une archive zip de module malveillant avec un reverse shell PHP et un listener netcat.
Il s'agit d'une vulnérabilité d'exécution de code à distance authentifiée que j'ai trouvée lors de l'événement Hackfinity de TryHackMe. Elle a été testée sur les versions 1.6.2 et 1.6.3 fonctionnant sous Ubuntu, et pourrait également affecter les versions antérieures. Par défaut, WBCE fait confiance à tout module qui lui est téléversé. La seule vérification effectuée sur le fichier .zip du module consiste à déterminer s'il contient un fichier info.php. Extrait du fichier /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']);
}
Une fois que le module passe cette vérification en tant qu'« Add-On valide », tous les scripts install.php sont automatiquement exécutés sur le serveur. Cet exploit utilise simplement un php reverse shell comme payload PHP.
Démonstration 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>