This workshop demonstrates how to exploit and backport security fixes (CVE-2024-53677) into Apache Struts using cherry-picking.
- Git
- Java 8
- Maven
- Python 3
cd struts-vuln
mvn jetty:runVerify the application at: http://localhost:8080
python exploit.py --url http://localhost:8080 --upload-file shell.jsp --destination ../exploit.jspCheck exploit at: http://localhost:8080/exploit.jsp
Clone Apache Struts separately:
git clone https://github.com/apache/struts.git
cd struts
git checkout -b patched-release STRUTS_2_3_33Cherry-pick the commit fixing CVE-2024-53677:
git cherry-pick <commit-hash>
mvn clean install -DskipTestsUpdate your application's pom.xml to use the patched version (2.3.33-patched).
Rebuild the patched application:
cd ../struts-vuln
sed -i '' 's/2.3.33/2.3.33-patched/g' pom.xml
mvn clean package jetty:runTest exploit again to verify it's resolved.
struts-workshop/
├── struts (patched separately)
└── struts-vuln
├── src/
├── exploit.py
└── pom.xml