
تطبيق Spring معرّض للثغرات الأمنية عن قصد لاختبار CVE-2022-22965
لمزيد من المعلومات: https://www.fracturelabs.com/posts/effective-spring4shell-scanning-exploitation/
سينشئ الكود التالي بسرعة صورة Docker ضعيفة باستخدام المكونات التالية:
git clone https://github.com/fracturelabs/spring4shell_victim.git
cd spring4shell_victim
docker image build -t spring4shell_victim .
docker container run -it -p 8080:8080 --name spring4shell_victim --rm spring4shell_victim
يوجد مساران معرّفان: /spring4shell_victim و /spring4shell_victim/vulnerable. يمكنك استخدام هذا للتحقق من أن أدوات الفحص تعمل بشكل صحيح. المسار الافتراضي (/) غير ضعيف تحديدًا لدفعك إلى التفكير في كيفية تكوين أدوات الفحص الخاصة بك للعثور على نقاط النهاية الضعيفة.
# This route is not vulnerable
curl -is localhost:9000/spring4shell_victim/?class.module.classLoader.URLs%5b-1%5d
# This route is vulnerable
curl -is localhost:9000/spring4shell_victim/vulnerable?class.module.classLoader.URLs%5b-1%5d

يمكنك التحقق من أن الكود نُشر بشكل صحيح عبر الاتصال بواجهة أوامر (shell) على الحاوية والنظر في دليل /usr/local/tomcat/webapps/.
docker exec -it spring4shell_victim /bin/bash
ملاحظة: كود إثبات المفهوم (POC) أعلاه يسبب فقط تعطّلًا يمكنك اكتشافه (خطأ 500). وهو لا يقوم في الواقع برفع أي كود.