
حاوية دوكر قابلة للاختراق لـ Apache Struts 2 RCE CVE-2023-50164
أصدرت Apache مؤخرًا إرشادات بشأن CVE-2023-50164، وهو ثغرة أمنية حرجة بتقييم خطورة 9.8 تؤثر على Apache Struts 2.
ترتبط CVE-2023-50164 ارتباطًا وثيقًا ببنية Apache Struts في المؤسسة والطريقة التي تستخدم بها ميزة رفع الملفات، مما يتيح اجتياز المسار غير المصرح به الذي يمكن استغلاله لرفع ملف ضار وتنفيذ تعليمات برمجية عن بُعد (RCE).
يحتوي هذا المستودع على ملف Dockerfile لفهم الثغرة والتعامل معها. لم يتم توفير كود الاستغلال المسلح.
فيما يلي أوامر تشغيل المختبر (يمكنك نسخها ولصقها في شل الخاص بك):
git clone https://github.com/Trackflaw/CVE-2023-50164-ApacheStruts2-Docker.git
cd CVE-2023-50164-ApacheStruts2-Docker
docker build --ulimit nofile=122880:122880 -m 3G -t cve-2023-50164 .
docker run -p 8080:8080 --ulimit nofile=122880:122880 -m 3G --rm -it --name cve-2023-50164 cve-2023-50164
curl http://localhost:8080/upload.action
تحقق باستخدام CUrl للتأكد من توفر التطبيق.
curl http://localhost:8080/upload.action
<html>
<head>
<title>File upload</title>
</head>
<body>
<h1>💣 CVE-2023-50164</h1>
<p>Welcome to CVE-2023-50164 lab. You can practice with the file upload feature below. Find a way yo bypass the filter 😉</p>
<form id="upload" name="upload" action="/upload.action" method="post" enctype="multipart/form-data">
<table class="wwFormTable">
<tr>
<td class="tdLabel"></td>
<td class="tdInput"><input type="file" name="upload" id="upload_upload" /></td>
</tr>
<tr>
<td colspan="2">
<div class="formButton"><input type="submit" value="Submit" id="upload_0" />
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
اختراق سعيد! 😉

هذا المشروع مستوحى بشكل كبير من عمل Jakabakos.
فيما يلي قائمة بالمقالات لفهم الثغرة: