Proof-of-concept for CVE-2023-50164 (Apache Struts 2), originally by jakabakos and adapted for the HTB Strutted lab environment. For educational use only.# CVE-2023-50164:
A critical security vulnerability, identified as CVE-2023-50164 (CVE: 9.8) was found in Apache Struts, allowing attackers to manipulate file upload parameters that can potentially lead to unauthorized path traversal and remote code execution (RCE).
It is intended **only for educational, CTF, or lab use** on systems you own or are authorized to test.
**Do not use this code on production or unauthorized systems.**
## Overview
This PoC demonstrates the file upload behavior related to CVE-2023-50164:
- Original source: [jakabakos/CVE-2023-50164-Apache-Struts-RCE](https://github.com/jakabakos/CVE-2023-50164-Apache-Struts-RCE)
- Modifications: Adapted for the HTB “Strutted” lab environment for safe learning.
## Usage
Install PIP packages:
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
Then, run the exploit script with for example:
```bash
python3 exploit.py --url http://strutted.htb/upload.action
```
Note that the exploit needs a full URL where the file upload functionality is implemented.
## Disclaimer
This exploit script has been created solely for the purposes of research and for the development of effective defensive techniques. It is not intended to be used for any malicious or unauthorized activities. The author and the owner of the script disclaim any responsibility or liability for any misuse or damage caused by this software. Users are urged to use this software responsibly and only in accordance with applicable laws and regulations. Use responsibly.
Log in to view the POC file snapshot cached by Shenlong Bot
Log in to view