
CVE-2017-5638 के लिए शोषण योग्य लक्ष्य
पूरी तरह से https://github.com/piesecurity/apache-struts2-CVE-2017-5638 पर आधारित
एक यथार्थवादी परिदृश्य जहाँ किसी फ्रेमवर्क का रेफरेंस प्रोजेक्ट कंटेनर पर तैनात किया जाता है लेकिन भयानक परिणामों के साथ। खुद को परिचित करने के लिए कोड देखें और उसे कंपाइल करें। साथ ही dockerfile की जाँच करें - क्या कोई विशेष चीज़ हमारा ध्यान खींचती है?
दिखाता है कि कैसे रोज़मर्रा के फैसले और श्रृंखला में कई कमज़ोरियाँ आसानी से भुनाई जा सकती हैं।
पूर्व-आवश्यकताएँ:
तैयारी के लिए:
./mvnw clean package चलाएँdocker build -t hackme \. चलाएँdocker run -d -p 9080:8080 hackme चलाएँनोट: यदि आपके पास Docker इंस्टॉल नहीं है, तो आप ./mvnw jetty:run चला सकते हैं
RCE परीक्षण शुरू करने के लिए - exploit.py फ़ाइल चलाएँ:
python exploit.py http://localhost:9080/orders/3 "CMD" चलाएँjava -jar jython*.jar exploit.py http://localhost:9080/orders/3 "CMD" चलाएँविभिन्न CMD आज़माएँ जैसे
pwd - हम कहाँ हैं?whomai - हम यह किस यूज़र के रूप में चला रहे हैं?ls -la - मेरी डायरेक्टरी में क्या है?ls / - मेरी मशीन क्या हैls /etc - हम और क्या पा सकते हैं?struts2-core का एक गैर-कमज़ोर संस्करण पहचानने के लिए Nexus Lifecycle Component Information Panel उपयोग करें। POM को उस संस्करण में अपडेट करें और पुनः बिल्ड करें। आप Docker इमेज को भी पुनः बिल्ड करके चला सकते हैं और हमले को फिर से आज़मा सकते हैं।
साथ ही, DepShield निष्कर्ष देखने के लिए यहाँ Issues देखें
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.