
Target sfruttabile per CVE-2017-5638
Completamente basato su https://github.com/piesecurity/apache-struts2-CVE-2017-5638
Uno scenario realistico in cui un progetto di riferimento per un framework viene distribuito su un container ma con terribili conseguenze. Per familiarizzare, guarda il codice e compilalo. Inoltre, esamina il Dockerfile: c'è qualcosa di specifico che attira la nostra attenzione?
Mostra come decisioni quotidiane e vulnerabilità multiple in catena possano essere sfruttate facilmente.
Prerequisiti:
Per preparare:
./mvnw clean package nella root del progettodocker build -t hackme \.docker run -d -p 9080:8080 hackmeNota: se non hai Docker installato, puoi eseguire ./mvnw jetty:run
Per iniziare a testare RCE - esegui il file exploit.py:
python exploit.py http://localhost:9080/orders/3 "CMD"java -jar jython*.jar exploit.py http://localhost:9080/orders/3 "CMD"Prova con diversi CMD come
pwd - dove siamo?whomai - con quale utente stiamo eseguendo?ls -la - cosa c'è nella mia directory?ls / - qual è la mia macchinals /etc - cos'altro possiamo trovare?Usa il Pannello Informazioni Componenti di Nexus Lifecycle per identificare una versione non vulnerabile di struts2-core. Aggiorna il POM a quella versione e ricostruisci. Puoi anche ricostruire l'immagine Docker ed eseguirla per riprovare l'attacco.
Inoltre, guarda le Issues qui per vedere i risultati di DepShield
https://github.com/apache/struts/tree/master/apps/rest-showcase
README.txt - Rest Showcase Webapp
Rest Showcase is a simple example of REST app build with the REST plugin.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
I18N:
=====
Please note that this project was created with the assumption that it will be run
in an environment where the default locale is set to English. This means that
the default messages defined in package.properties are in English. If the default
locale for your server is different, then rename package.properties to package_en.properties
and create a new package.properties with proper values for your default locale.