VULN REPORT
/
gövde gösterisi
/
ID: 103
OWASP A03:2021 – Enjeksiyon Zafiyetleri (Injection) ve SQLi / Command Injection Önleme
Summary
This entry details a vulnerability found in the target system. The exploit was published on 2026-07-21 and has garnered 10 views from the community. It is classified under the gövde gösterisi category. Users are advised to review the source code in the Detail tab for technical specifics.
exploit_103.txt
# OWASP A03:2021 – Enjeksiyon Zafiyetleri (Injection) ve SQLi / Command Injection Önleme
> **Teknik İnceleme**: Güvenilmeyen kullanıcı girdilerinin yorumlayıcılara (SQL, OS Shell, LDAP, XML) doğrudan gönderilmesi sonucu ortaya çıkan Enjeksiyon zafiyetleri, saldırganın veritabanı veya sunucu komut satırı üzerinde tam kontrol sağlamasına imkan tanır.
---
## 1. SQL Injection (SQLi) Nedir ve Nasıl Çalışır?
SQLi, kullanıcıdan alınan verinin SQL sorgusuna mantıksal bir kod olarak sızdırılmasıdır.
```sql
-- Zafiyetli Sorgu:
SELECT * FROM users WHERE username = 'ADMIN' OR '1'='1' AND password = 'xxx';
```
---
## 2. Örnek PoC: SQLi İle Veritabanı Mantığını Değiştirme
Saldırgan giriş formuna kullanıcı adı olarak `' UNION SELECT 1, username, password_hash, 4 FROM users--` enjekte ettiğinde tüm kullanıcı parolalarını sızdırabilir.
---
## 3. Komut Enjeksiyonu (OS Command Injection)
Uygulamanın işletim sistemi komutlarını çalıştırırken girdiyi doğrulamaması durumunda yaşanır:
```php
// ZAFİYETLİ KOD:
$target = $_GET['ip'];
system("ping -c 3 " . $target);
// İSTİSMAR: ?ip=8.8.8.8; cat /etc/passwd
```
---
## 4. Tam Koruma: Prepared Statements (Parametreli Sorgular)
```php
// GÜVENLİ PDO KODU:
$stmt = $pdo->prepare('SELECT id, username FROM users WHERE email = :email AND password = :hash');
$stmt->execute(['email' => $email, 'hash' => $hash]);
```
Entry Stats
Views
10
Downloads
2
Comments
1