
Exploit de RCE autenticado para WBCE CMS <= 1.6.3 que cria um zip de módulo malicioso com uma shell reversa em PHP e listener netcat.
Esta é uma vulnerabilidade de Execução Remota de Código Autenticada que encontrei durante o evento Hackfinity do TryHackMe. Foi testada nas versões 1.6.2 e 1.6.3 rodando no Ubuntu, e potencialmente afeta versões anteriores também. Por padrão, o WBCE confia em qualquer módulo enviado a ele. A única verificação feita no arquivo de módulo .zip é se contém um arquivo info.php. Trecho do /admin/modules/install.php do 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']);
}
Depois que o módulo passa nessa verificação como um "Add-On válido", qualquer script install.php é executado automaticamente no servidor. Este exploit simplesmente usa um php reverse shell como payload php.
Demonstração no 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>