apache-struts
apache-struts copied to clipboard
This repository contains sample attacks that can be used to exploit vulnerabilities in the Jakarta Multipart Parser of Apache Struts
Description
This project is derived from the original project found here and aims to demonstrate the CVE-2017-5638 exploitation found in vulnerable versions of Apache Struts.
Build
-
Apache Struts application container image
./build.sh --registry <registry_name> --type app --push
-
Apache Struts exploit container image
./build.sh --registry <registry_name> --type exploit --push
Run Apache Struts Application (Kubernetes)
-
In the
apache-struts.yaml
manifest file and update theimage
key to point to theapache-struts-app
container image created in the previous setp. Update or deleteimpagePullSecrets
as necessary. -
Deploy the Apache Struts pods:
kubectl apply -f 1-deployment.yaml
-
Deploy the Apache Struts service (external load balancer):
kubectl apply -f 2-service.yaml
Run Apache Struts Exploit (Docker)
-
To run the standard Apache Struts exploit, modify the
image
,host
,src_ip
, anddst_ip
variables in therun_exploit.sh
file for your requirements and run the shell script:./run_exploit.sh
-
To run the reverse web shell Apache Struts exploit, modify the
image
,host
,port
,src_ip
, andsrc_port
variables in therun_webshell.sh
file for your requirements and open the designatedsrc_port
on the exploit host usingnetcat
:nc -lvp <src_port>
On the same exploit host but in a new terminal window, run the shell script:
./run_webshell.sh
Once the exploit has completed and the
GET
response has been returned, you should have full shell access to the host, pod, or container asroot
user.