
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.
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.
This PoC demonstrates the file upload behavior related to CVE-2023-50164:
Install PIP packages:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Then, run the exploit script with for example:
python3 exploit.py --url http://strutted.htb/upload.action
Note that the exploit needs a full URL where the file upload functionality is implemented.
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.