Güvenlik Rehberi v3 - Imunify360 İlaveli

PHP Güvenlik Tarama Rehberi

Backdoor, Malware ve Zararlı Kod Tespiti

5 Ocak 2026 (v3) | 70 Kontrol Noktası | +20 Imunify360

Basit Anlatım (Herkes İçin)

Bu rehber, web sitenize sızabilecek zararlı kodları (virüs, backdoor, shell) tespit etmenizi sağlar. v3'te Imunify360 tarafından kullanılan gelişmiş tespit yöntemleri de eklendi.

Aşağıdaki 70 kontrolü düzenli olarak çalıştırarak sitenizi koruyabilirsiniz.

Kritik Uyarı

Bu taramalar sırasında bulunan şüpheli dosyaları hemen silmeyin! Önce içeriğini inceleyin, yedek alın ve emin olduktan sonra silin. Yanlışlıkla silinen sistem dosyaları siteyi çökertebilir.

v3'te Eklenenler - Imunify360 Testleri

Kategori 15-18 (51-70): Imunify360'ın kullandığı profesyonel tespit yöntemleri:

70 Güvenlik Kontrol Noktası

Kategori 1-14: Temel Güvenlik Kontrolleri (1-50)

v2'den devam eden temel kontroller. Her kategorinin detayları için komutlara bakın.

1. Backdoor & Shell (1-5)
eval, base64, shell_exec, assert...
2. Dosya Manipülasyonu (6-8)
file_put_contents, @copy, chmod...
3. Gizli Dosyalar (9-12)
.php, hex isimleri, public'te PHP...
4. Upload Güvenliği (13-15)
uploads/*.php, resim içinde kod...
5. Encoding (16-19)
gzip, chr(), base64, preg_replace...
6. Network (20-22)
socket, remote include, proc_open...
7. Sistem (23-26)
cron, .htaccess, permissions...
8-9. Zaman & Tehditler (27-30)
son 24 saat, crypto miner, mail spam...
10. Variable Function (31-34)
call_user_func, array callbacks...
11. Advanced Encoding (35-38)
hex, octal, double encoding, pack...
12. PHP Wrappers (39-42)
php://input, data://, expect://...
13. Webshell (43-46)
c99, r57, cookie auth, unserialize...
14. Config (47-50)
.user.ini, auto_prepend, SVG/XML...

💡 Detaylı komutlar için v2 rehberine bakın veya aşağıdaki script'i kullanın.

Imunify360 Gelişmiş Testler (51-70)

15 Imunify360: Malware Signatures YENİ

15.1 SEO Spam Injection Kritik

Gizli SEO linkler, viagra/casino spam.

grep -ri "viagra\|cialis\|casino\|poker\|pharma" /var/www/html --include="*.php" --include="*.html" | grep -i "display.*none\|visibility.*hidden" | head -20
15.2 Malicious Redirects Kritik

JavaScript/Meta tag ile gizli yönlendirmeler.

grep -r "window\.location\|document\.location\|meta.*refresh" /var/www/html/public --include="*.php" --include="*.html" | grep -v "vendor" | head -20
15.3 Defaced Page Detection Yüksek

Hacked by, owned by pattern'leri.

grep -ri "hacked by\|owned by\|defaced by\|pwned by" /var/www/html/public --include="*.php" --include="*.html"
15.4 Known Malware Strings Kritik

Bilinen malware imzaları (eval chains).

grep -r "eval.*base64_decode.*gzinflate\|eval.*str_rot13.*base64" /var/www/html --include="*.php" --exclude-dir=vendor
15.5 Suspicious Function Chains Yüksek

Şüpheli fonksiyon kombinasyonları.

grep -r "file_get_contents.*base64_decode\|curl_exec.*eval" /var/www/html --include="*.php" --exclude-dir=vendor | head -10

16 Imunify360: Gelişmiş Tespit YENİ

16.1 Polymorphic Malware Kritik

Sürekli değişen, kendini şifreleyen kod.

find /var/www/html -name "*.php" -exec sh -c 'grep -l "eval.*\\\$" "$1" && stat -c "%Y %n" "$1"' _ {} \; | sort -rn | head -20
16.2 Time-Based Execution Yüksek

Belli saatlerde aktif olan backdoor.

grep -r "date\s*(\|time\s*(" /var/www/html/public --include="*.php" --exclude-dir=vendor | grep -i "if\|switch" | head -20
16.3 IP-Based Backdoors Kritik

Sadece belli IP'lerden erişilebilen backdoor.

grep -r "\$_SERVER\[.*REMOTE_ADDR.*==\|REMOTE_ADDR.*!=\|in_array.*REMOTE_ADDR" /var/www/html/public --include="*.php" --exclude-dir=vendor | head -10
16.4 User-Agent Filtering Yüksek

User-agent kontrol eden backdoor.

grep -r "\$_SERVER\[.*HTTP_USER_AGENT" /var/www/html/public --include="*.php" --exclude-dir=vendor | grep -i "if\|preg_match" | head -10
16.5 Multi-Stage Payloads Kritik

Çok aşamalı encoded yükler.

grep -r "eval.*eval\|base64_decode.*base64_decode.*base64_decode" /var/www/html --include="*.php" --exclude-dir=vendor

17 Imunify360: Dosya Bütünlüğü YENİ

17.1 Core File Modifications Kritik

Laravel core dosyalarında değişiklik.

find /var/www/html/vendor/laravel -name "*.php" -mtime -30 ! -path "*/cache/*" 2>/dev/null | head -10
17.2 Permission Anomalies Yüksek

777 izinli PHP dosyaları.

find /var/www/html -type f -name "*.php" -perm 0777 ! -path "*/storage/*" 2>/dev/null
17.3 Timestamp Manipulation Yüksek

Eski tarihli ama yeni içerikli dosyalar.

find /var/www/html/public -name "*.php" -type f -printf "%T@ %p\n" | sort -n | head -20 | awk '{print $2}' | xargs -I {} sh -c 'echo "File: {}"; grep -c "eval\|base64" {}'
17.4 Hidden Attributes Orta

Immutable (değiştirilemez) attribute.

find /var/www/html/public -type f -name "*.php" -exec lsattr {} \; 2>/dev/null | grep -E "i-|a-" | head -10
17.5 Suspicious File Sizes Orta

Çok küçük (<100 byte) veya çok büyük (>1MB) PHP.

find /var/www/html/public -name "*.php" -type f \( -size -100c -o -size +1M \) ! -path "*/vendor/*" 2>/dev/null | head -10

18 Imunify360: Davranış Analizi YENİ

18.1 Mass File Creation Kritik

Son 1 saatte 10+ PHP dosyası oluşturulmuş.

find /var/www/html -name "*.php" -type f -cmin -60 ! -path "*/vendor/*" ! -path "*/storage/framework/*" 2>/dev/null | wc -l
18.2 Rapid Modifications Yüksek

Aynı dosyaya 1 saat içinde çok sayıda modify.

find /var/www/html/public -name "*.php" -type f -mmin -60 ! -path "*/storage/*" -exec ls -lt {} \; | head -20
18.3 Suspicious Includes Yüksek

Dinamik include/require pattern'i.

grep -r "include\s*(\s*\$\|require\s*(\s*\$" /var/www/html/public --include="*.php" --exclude-dir=vendor | head -10
18.4 External File Operations Kritik

Dışarıdan dosya indirme/kaydetme.

grep -r "file_get_contents\s*(\s*['\"]http\|curl_exec" /var/www/html/public --include="*.php" --exclude-dir=vendor | grep "file_put_contents" | head -10
18.5 Suspicious Variable Names Orta

Tek harf veya anlamsız değişken isimleri.

grep -r '\$[a-z]\s*=.*eval\|\$[a-z]\s*=.*base64' /var/www/html/public --include="*.php" --exclude-dir=vendor | head -10

Hızlı Tarama Script'i v3.0 (70 Kontrol)

Tüm 70 kontrolü (v2'nin 50'si + Imunify360'ın 20'si) tek seferde çalıştırmak için:

#!/bin/bash
# PHP Security Scanner v3.0 - 70 Kontrol (Imunify360 İlaveli)
WEBROOT="/var/www/vhosts/tuufi.com/httpdocs"

echo "=== PHP GÜVENLİK TARAMASI v3.0 ==="
echo "=== 70 Kontrol (50 temel + 20 Imunify360) ==="
echo ""

# Kategori 1-14: Temel Kontroller (1-50) - v2'den
echo "[1/70] Eval+Base64..."
grep -r --include="*.php" -l "eval(base64_decode" $WEBROOT --exclude-dir=vendor 2>/dev/null

echo "[10/70] Rastgele isimli dosyalar..."
find $WEBROOT/public -maxdepth 2 -regextype posix-extended -regex '.*/[a-f0-9]{16,}\.[a-z]+$' 2>/dev/null

echo "[13/70] Uploads'da PHP..."
find $WEBROOT/public/uploads -name "*.php" 2>/dev/null

# ... (diğer v2 kontrolleri)

# Kategori 15: Malware Signatures (51-55)
echo "[51/70] SEO Spam..."
grep -ri "viagra\|cialis\|casino" $WEBROOT/public --include="*.php" | grep -i "display.*none" | head -5

echo "[52/70] Malicious Redirects..."
grep -r "window\.location\|meta.*refresh" $WEBROOT/public --include="*.php" | grep -v vendor | head -5

echo "[53/70] Defaced pages..."
grep -ri "hacked by\|owned by" $WEBROOT/public --include="*.html" --include="*.php"

echo "[54/70] Known malware strings..."
grep -r "eval.*base64_decode.*gzinflate" $WEBROOT --include="*.php" --exclude-dir=vendor

echo "[55/70] Suspicious function chains..."
grep -r "file_get_contents.*base64_decode" $WEBROOT --include="*.php" --exclude-dir=vendor | head -5

# Kategori 16: Advanced Detection (56-60)
echo "[56/70] Polymorphic malware..."
find $WEBROOT -name "*.php" -exec grep -l "eval.*\\\$" {} \; | head -5

echo "[57/70] Time-based execution..."
grep -r "date\s*(\|time\s*(" $WEBROOT/public --include="*.php" | grep -i "if" | head -5

echo "[58/70] IP-based backdoors..."
grep -r "REMOTE_ADDR.*==" $WEBROOT/public --include="*.php" --exclude-dir=vendor | head -5

echo "[59/70] User-agent filtering..."
grep -r "HTTP_USER_AGENT" $WEBROOT/public --include="*.php" | grep "if\|preg" | head -5

echo "[60/70] Multi-stage payloads..."
grep -r "eval.*eval\|base64_decode.*base64_decode.*base64" $WEBROOT --include="*.php" --exclude-dir=vendor

# Kategori 17: File Integrity (61-65)
echo "[61/70] Core file modifications..."
find $WEBROOT/vendor/laravel -name "*.php" -mtime -30 ! -path "*/cache/*" 2>/dev/null | head -5

echo "[62/70] Permission anomalies..."
find $WEBROOT -name "*.php" -perm 0777 ! -path "*/storage/*" 2>/dev/null

echo "[63/70] Timestamp manipulation..."
find $WEBROOT/public -name "*.php" -type f -printf "%T@ %p\n" | sort -n | head -10

echo "[64/70] Hidden attributes..."
find $WEBROOT/public -name "*.php" -exec lsattr {} \; 2>/dev/null | grep -E "i-|a-"

echo "[65/70] Suspicious file sizes..."
find $WEBROOT/public -name "*.php" \( -size -100c -o -size +1M \) ! -path "*/vendor/*" 2>/dev/null

# Kategori 18: Behavioral Analysis (66-70)
echo "[66/70] Mass file creation..."
find $WEBROOT -name "*.php" -cmin -60 ! -path "*/vendor/*" ! -path "*/storage/framework/*" 2>/dev/null | wc -l

echo "[67/70] Rapid modifications..."
find $WEBROOT/public -name "*.php" -mmin -60 ! -path "*/storage/*" -ls | head -10

echo "[68/70] Suspicious includes..."
grep -r "include\s*(\s*\$\|require\s*(\s*\$" $WEBROOT/public --include="*.php" --exclude-dir=vendor | head -5

echo "[69/70] External file operations..."
grep -r "file_get_contents.*http.*file_put_contents" $WEBROOT/public --include="*.php" --exclude-dir=vendor | head -5

echo "[70/70] Suspicious variable names..."
grep -r '\$[a-z]\s*=.*eval' $WEBROOT/public --include="*.php" --exclude-dir=vendor | head -5

echo ""
echo "=== TARAMA TAMAMLANDI (v3.0 - 70 Kontrol) ==="

Önleme Tavsiyeleri (Imunify360 Standartları)

Upload Klasörü

uploads/.htaccess: php_flag engine off

Dosya İzinleri

Dosyalar 644, klasörler 755, ASLA 777 değil

Güncellemeler

PHP, Laravel ve paketleri güncel tutun

Düzenli Tarama

Haftada bir bu 70 kontrolü çalıştırın

WAF Kullanın

ModSecurity veya Imunify360 WAF

File Integrity Monitoring

Core dosya değişikliklerini izleyin

HAZIR PROMPT - KOPYALA & YAPIŞTIR

Nasıl Kullanılır?

  1. 1. Aşağıdaki prompt'u kopyalayın
  2. 2. Claude AI'ya yapıştırın
  3. 3. Enter'a basın
  4. 4. AI otomatik olarak:
    • ✓ Todo listesi oluşturur
    • ✓ 70 kontrolü tek tek çalıştırır
    • ✓ Bulguları analiz eder
    • ✓ O güne ait HTML rapor oluşturur
    • ✓ Size link verir

📋 Prompt (v3.0 - 70 Kontrol)

READY TO USE
https://ixtif.com/readme/2026/01/02/guvenlik-tarama-rehberi/v3/ bu linkteki 70 güvenlik kontrolünü tek tek uygula.

GÖREV:
1. Todo listesi oluştur (70 kontrol için 18 kategori)
2. Tüm kontrolleri tek tek çalıştır (1-70)
3. Sonuçları derle ve analiz et
4. Bugüne ait (YYYY/MM/DD formatında) detaylı HTML rapor oluştur:
   - public/readme/[YYYY]/[MM]/[DD]/guvenlik-tarama-sonuclari/v1/index.html
   - İki seviyeli içerik (basit anlatım + teknik detaylar)
   - Kritik bulgular ayrı bölüm
   - Temiz sonuçlar ayrı bölüm
   - 70 kontrolün özet tablosu
   - Öneriler bölümü

5. Rapor hazır olunca:
   - İzinleri düzelt (tuufi.com_:psaserv, 644/755)
   - Sembolik link oluştur
   - curl ile 200 OK kontrolü yap
   - Bana link ver

ÖNEMLİ:
- Hepsi onaylı, tek tek sormana gerek yok
- Her kategori bitince todo güncelle
- Vendor klasörünü hariç tut
- Temiz sonuçları da raporla (sadece hataları değil)
- Bulguları şiddete göre sınıflandır (Kritik/Yüksek/Orta/Normal)

Not: Bu prompt tamamen otonom çalışır. AI'ya yapıştırıp Enter'a bastıktan sonra hiçbir müdahale gerektirmez. Yaklaşık 5-10 dakika içinde tüm tarama tamamlanır ve size hazır rapor linki verilir.

✅ Prompt Ne Yapar?

  • • 70 kontrolü otomatik çalıştırır
  • • Bulguları kategorize eder
  • • HTML rapor oluşturur
  • • İzinleri düzeltir
  • • Size erişilebilir link verir

📊 Rapor İçeriği

  • • Basit anlatım (herkes için)
  • • Teknik detaylar (dev için)
  • • Kritik bulgular listesi
  • • Temiz kontroller listesi
  • • Güvenlik önerileri