
هدف قابل للاستغلال لـ 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 - ماذا يمكننا أن نجد أيضًا؟استخدم لوحة معلومات المكوّنات في Nexus Lifecycle لتحديد إصدار غير معرّض للخطر من struts2-core. حدّث ملف POM إلى ذلك الإصدار وأعد البناء. يمكنك أيضًا إعادة بناء صورة Docker وتشغيلها لإعادة محاولة الهجوم.
أيضًا، اطّلع على قسم Issues هنا لرؤية نتائج 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.