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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2023-50164 PoC — Apache Struts: File upload component had a directory traversal vulnerability

Source
Associated Vulnerability
Title:Apache Struts: File upload component had a directory traversal vulnerability (CVE-2023-50164)
Description:An attacker can manipulate file upload params to enable paths traversal and under some circumstances this can lead to uploading a malicious file which can be used to perform Remote Code Execution. Users are recommended to upgrade to versions Struts 2.5.33 or Struts 6.3.0.2 or greater to fix this issue.
Description
A scanning utility and PoC for CVE-2023-50164
Readme
# CVE-2023-50164
A scanning utility and PoC for CVE-2023-50164

# Considerations

CVE-2023-50164's exploitation is very environment specific. This PoC attempts to generalize the exploitation process by requiring the user to enter environment specific details through the script flags. 

The script attempts to upload a benign file and overwrite it with a file path passed by the user. Although the script (necessarily) allows users to upload their own file paths, the file content written to that path is completely benign, it's simply "SUCCESSFULLY EXPLOITED CVE-2023-50164 AT <datetime>"

Original Reference: https://xz.aliyun.com/t/13172

# Installation

Before running the script you need to install the requirements.txt

```
python3 -m pip install -r requirements.txt
```

# Usage

The script accepts the following flags:

- --url: The URL of the target
- --uploadvar: The name of the variable that the script will use to upload the file,in the reference this would be "Upload"
- --filenamevar: The name of the variable that the script will use for the uploadFileName value, in the reference this would be "uploadFileName"
- --payloadpath: The path of the payload file that will be uploaded
- --follow302: A boolean which indicates whether the script should follow 302 redirects or not
- --verbose: A boolean which indicates whether the script should print verbose output or not

# Example

```
python3 cve202350164.py --url http://localhost:8080 --uploadvar Upload --filenamevar uploadFileName --payloadpath /tmp/payload.txt --follow302 --verbose
```
File Snapshot

[4.0K] /data/pocs/3eca19f640b9f975d02c16f758b9426aee757ead ├── [4.7K] cve202350164.py ├── [1.5K] README.md └── [ 35] requirements.txt 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 →