Backdoor, Malware ve Zararlı Kod Tespiti
v2 + v3 = Kapsamlı v4
5 Ocak 2026 (v4) | 70 Kontrol Noktası | 50 Temel + 20 Imunify360
Bu rehber, web sitenize sızabilecek zararlı kodları (virüs, backdoor, shell) tespit etmenizi sağlar. v4 tüm detayları içerir: v2'nin 50 temel kontrolü + v3'ün 20 Imunify360 testi.
Aşağıdaki 70 kontrolü düzenli olarak çalıştırarak sitenizi koruyabilirsiniz.
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.
Kategori 1-14, kontrol 1-50. Backdoor, encoding, upload, network, sistem kontrolleri.
Kategori 15-18, kontrol 51-70. Profesyonel malware tespiti, davranış analizi.
Hazır prompt ile tek tıkla 70 kontrolü çalıştır, rapor al.
En yaygın backdoor pattern'i. Şifreli kod çalıştırır.
grep -r --include="*.php" -l "eval(base64_decode" /var/www/html --exclude-dir=vendor
Sistem komutları çalıştıran fonksiyonlar.
grep -r --include="*.php" -l "passthru\|shell_exec\|system\s*(" /var/www/html/public --exclude-dir=vendor
Kullanıcı girdisini doğrudan çalıştıran kod.
grep -r --include="*.php" -l '\$_\(REQUEST\|POST\|GET\).*eval\|eval.*\$_\(REQUEST\|POST\|GET\)' /var/www/html
PHP assert() fonksiyonu kod çalıştırabilir.
grep -r --include="*.php" "assert\s*(" /var/www/html/public --exclude-dir=vendor
Eski PHP exploit yöntemi.
grep -r --include="*.php" -l "create_function" /var/www/html --exclude-dir=vendor
Şifreli içeriği dosyaya yazan kod.
grep -r --include="*.php" -l "file_put_contents.*base64_decode" /var/www/html --exclude-dir=vendor
Dosya kopyalama/taşıma (hata gizleme ile).
grep -r --include="*.php" -l "@copy\|@rename\|@move" /var/www/html/public --exclude-dir=vendor
İzin değiştirme komutları.
grep -r --include="*.php" -l "chmod\|chown" /var/www/html/public --exclude-dir=vendor
Nokta ile başlayan gizli PHP dosyaları.
find /var/www/html -name ".*php" -o -name ".*.php" 2>/dev/null
453bbb9eb16f.php gibi rastgele isimler.
find /var/www/html/public -maxdepth 2 -type f -regextype posix-extended -regex '.*/[a-f0-9]{16,}\.[a-z]+$'
Public klasöründe olmaması gereken PHP'ler.
find /var/www/html/public -maxdepth 1 -name "*.php" ! -name "index.php" ! -name "robots.txt"
Marker/beacon dosyaları.
find /var/www/html/public -maxdepth 1 -name "*.txt" ! -name "robots.txt"
Upload klasöründe PHP dosyası OLMAMALI!
find /var/www/html/public/uploads -name "*.php" 2>/dev/null
phtml, phar, php5, php7 uzantıları.
find /var/www/html/public/uploads -type f \( -name "*.phtml" -o -name "*.phar" -o -name "*.php5" -o -name "*.php7" \)
JPG/PNG/GIF içine gizlenmiş PHP kodu.
find /var/www/html -type f \( -name "*.jpg" -o -name "*.png" -o -name "*.gif" \) -exec grep -l "<?php" {} \;
Sıkıştırılmış zararlı kod.
grep -r --include="*.php" -l "gzinflate\|gzuncompress\|str_rot13" /var/www/html/public
chr(98).chr(97)... formatı.
grep -r --include="*.php" -l "chr(98).chr(97).chr(115).chr(101)" /var/www/html
50+ karakter base64 encoded string.
grep -r --include="*.php" -l '\$[a-zA-Z_]*\s*=\s*["'"'"'][a-zA-Z0-9+/=]\{50,\}["'"'"']' /var/www/html/public
Eski PHP versiyonlarında kod çalıştırır.
grep -r --include="*.php" "preg_replace.*['\"]\/.*e['\"]" /var/www/html --exclude-dir=vendor
Uzak bağlantı açan kod.
grep -r --include="*.php" -l "fsockopen\|socket_create\|pfsockopen" /var/www/html --exclude-dir=vendor
Uzak sunucudan dosya include.
grep -r --include="*.php" -l "include.*http\|require.*http" /var/www/html/public
Process açma fonksiyonu.
grep -r --include="*.php" -l "proc_open" /var/www/html/public
Zamanlanmış görevlerde backdoor.
crontab -l | grep -v "^#"
Son 7 günde değişen htaccess.
find /var/www/html -name ".htaccess" -mtime -7 -exec ls -la {} \;
Herkesin yazabildiği dosyalar.
find /var/www/html/public -type f -perm -002 ! -path "*/storage/*"
Şüpheli sembolik linkler.
find /var/www/html/public -type l ! -path "*/storage/*" ! -path "*/readme/*"
Son 24 saatte oluşturulan PHP dosyaları.
find /var/www/html -name "*.php" -mtime -1 ! -path "*/vendor/*" ! -path "*/storage/framework/*"
Son 7 günde uploads'a eklenen PHP.
find /var/www/html/public/uploads -name "*.php" -mtime -7
Kripto madenci zararlıları.
grep -r --include="*.php" -l "coinhive\|cryptonight\|stratum\|xmrig" /var/www/html
Public'te mail fonksiyonu (spam için kullanılabilir).
grep -r --include="*.php" -l "mail\s*(" /var/www/html/public --exclude-dir=vendor
$func() şeklinde dinamik fonksiyon çağrısı. Backdoor'larda çok yaygın.
grep -r --include="*.php" -l '\$[a-zA-Z_][a-zA-Z0-9_]*\s*(' /var/www/html/public --exclude-dir=vendor | head -20
call_user_func ile dinamik kod çalıştırma.
grep -r --include="*.php" -l "call_user_func\|call_user_func_array" /var/www/html/public --exclude-dir=vendor
array_map, array_filter ile kod çalıştırma.
grep -r --include="*.php" "array_map\|array_filter\|array_walk\|usort" /var/www/html/public --exclude-dir=vendor | grep -i "eval\|assert\|base64"
Reflection API ile kod çalıştırma.
grep -r --include="*.php" -l "ReflectionFunction\|ReflectionMethod" /var/www/html/public --exclude-dir=vendor
\x62\x61\x73\x65 formatında gizli kod.
grep -r --include="*.php" '\\x[0-9a-fA-F]\{2\}\\x[0-9a-fA-F]\{2\}' /var/www/html/public --exclude-dir=vendor
\142\141\163\145 formatında octal encoding.
grep -r --include="*.php" '\\[0-7]\{3\}\\[0-7]\{3\}' /var/www/html/public --exclude-dir=vendor
Çift base64 encoding ile gizleme.
grep -r --include="*.php" "base64_decode.*base64_decode" /var/www/html --exclude-dir=vendor
Binary veri manipülasyonu ile kod gizleme.
grep -r --include="*.php" "pack\s*(\|unpack\s*(" /var/www/html/public --exclude-dir=vendor
Raw POST verisi ile kod çalıştırma.
grep -r --include="*.php" "php://input" /var/www/html/public --exclude-dir=vendor
Data URI ile kod injection.
grep -r --include="*.php" "data://" /var/www/html/public --exclude-dir=vendor
Filter wrapper ile dosya okuma/encoding.
grep -r --include="*.php" "php://filter" /var/www/html --exclude-dir=vendor
Sistem komutu çalıştırma wrapper'ı.
grep -r --include="*.php" "expect://" /var/www/html --exclude-dir=vendor
c99, r57, b374k gibi ünlü shell'ler.
grep -r --include="*.php" -l "c99shell\|r57shell\|b374k\|WSO\|FilesMan" /var/www/html
Dosya yöneticisi shell imzaları.
grep -r --include="*.php" "FilesMan\|filemanager\|File Manager" /var/www/html/public --exclude-dir=vendor
Cookie ile gizli erişim kontrolü.
grep -r --include="*.php" '\$_COOKIE.*==\|md5.*\$_COOKIE' /var/www/html/public --exclude-dir=vendor
unserialize ile RCE saldırısı.
grep -r --include="*.php" "unserialize\s*(\s*\$_" /var/www/html --exclude-dir=vendor
PHP ayarlarını override eden .user.ini dosyaları.
find /var/www/html -name ".user.ini" -exec cat {} \;
Her PHP çalışmadan önce otomatik include.
grep -r "auto_prepend_file\|auto_append_file" /var/www/html -l 2>/dev/null
SVG ve XML dosyalarına gizlenmiş PHP.
find /var/www/html -type f \( -name "*.svg" -o -name "*.xml" \) -exec grep -l "<?php\|<script" {} \;
.pht, .phps, .inc gibi az bilinen PHP uzantıları.
find /var/www/html -type f \( -name "*.pht" -o -name "*.phps" -o -name "*.inc" -o -name "*.php3" -o -name "*.php4" \)
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
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
Hacked by, owned by pattern'leri.
grep -ri "hacked by\|owned by\|defaced by\|pwned by" /var/www/html/public --include="*.php" --include="*.html"
Bilinen malware imzaları (eval chains).
grep -r "eval.*base64_decode.*gzinflate\|eval.*str_rot13.*base64" /var/www/html --include="*.php" --exclude-dir=vendor
Şüpheli fonksiyon kombinasyonları.
grep -r "file_get_contents.*base64_decode\|curl_exec.*eval" /var/www/html --include="*.php" --exclude-dir=vendor | head -10
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
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
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
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
Çok aşamalı encoded yükler.
grep -r "eval.*eval\|base64_decode.*base64_decode.*base64_decode" /var/www/html --include="*.php" --exclude-dir=vendor
Laravel core dosyalarında değişiklik.
find /var/www/html/vendor/laravel -name "*.php" -mtime -30 ! -path "*/cache/*" 2>/dev/null | head -10
777 izinli PHP dosyaları.
find /var/www/html -type f -name "*.php" -perm 0777 ! -path "*/storage/*" 2>/dev/null
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" {}'
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
Ç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
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
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
Dinamik include/require pattern'i.
grep -r "include\s*(\s*\$\|require\s*(\s*\$" /var/www/html/public --include="*.php" --exclude-dir=vendor | head -10
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
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
https://ixtif.com/readme/2026/01/02/guvenlik-tarama-rehberi/v4/ 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.
uploads/.htaccess: php_flag engine off
Dosyalar 644, klasörler 755, ASLA 777 değil
PHP, Laravel ve paketleri güncel tutun
Haftada bir bu 70 kontrolü çalıştırın
ModSecurity veya Imunify360 WAF
Core dosya değişikliklerini izleyin