Host Keşfi & Port Tarama
recon difficulty: kolay
Ağ testi, saldırı yüzeyini haritalamakla başlar: hangi hostlar canlı, hangi portlar açık ve arkalarında hangi servisler çalışıyor. Nmap standart araçtır; büyük aralıklarda hız ile gürültü arasında denge kurulur.
Ön koşullar
Section titled “Ön koşullar”- Dayanak host IP / route bilgisi (ip route, ip a)- Hedef CIDR veya host listesi- IDS/IPS hassasiyeti bilinmiyorsa önce yavaş/stealth profilip -br aip routecat /etc/resolv.confCanlı host keşfi
Section titled “Canlı host keşfi”nmap -sn 10.10.10.0/24 -oA discoverynmap -PR -sn 10.10.10.0/24netdiscover -r 10.10.10.0/24fping -a -g 10.10.10.0/24 2>/dev/nullnmap -sn -PS22,80,443,445,3389 10.10.10.0/24nmap -sn -PA80,443 10.10.10.0/24masscan -p443,445,22,80 10.10.0.0/16 --rate 5000 -oL ms.lstCanlı IP listesini çıkar:
nmap -sn 10.10.10.0/24 -oG - | awk '/Up$/{print $2}' > live.txtPort tarama
Section titled “Port tarama”nmap -p- --min-rate 5000 -T4 -Pn -iL live.txt -oA tcp_allnmap -p- --min-rate 2000 -T4 -Pn 10.10.10.5 -oA tcp_all_hostnmap -sC -sV -O -p $(tr '\n' ',' < ports.txt) 10.10.10.5 -oA tcp_deepnmap --top-ports 1000 -sV -Pn 10.10.10.5nmap -sU --top-ports 50 -Pn 10.10.10.5 -oA udp_topnmap -sU -p 53,67,69,123,161,162,500,514,520,1434,1900 10.10.10.5sudo nmap -sS -p- 10.10.10.5nmap -sT -p- 10.10.10.5Masscan + nmap hibrit:
sudo masscan -p1-65535 10.10.10.5 --rate 10000 -oG ms.gnmapnmap -sC -sV -p 22,80,445,3389 10.10.10.5Komut üreteci
Section titled “Komut üreteci”Nmap · Service Scan
embedded toolnmap -sC -sV -p- -T4 --min-rate 2000 10.10.10.5 -oA nmap_scanNmap · Service Scan
Section titled “Nmap · Service Scan”Metodoloji
Section titled “Metodoloji”-
Geniş ve hızlı başla — canlı host keşfi, sonra tüm TCP portlarda –min-rate ile açık port listesi üret ( -oA / -oG kaydet).
-
Hedefli derinleş — sadece açık portlarda -sC -sV (ve gerekirse -O ); her servis için not al.
-
UDP’yi unutma — SNMP(161), DNS(53), IKE(500), TFTP(69), NTP(123), syslog(514) kritik olabilir.
-
NSE ile zenginleştir — servise özel script’ler; vuln script’lerini bilinçli ve kapsam dahilinde çalıştır.
-
Çıktıyı envantere dök — host → port → servis → sürüm → sonraki enum sayfası.
nmap -p445 --script "smb-os-discovery,smb-enum-shares,smb-security-mode" 10.10.10.5nmap -p443 --script "ssl-enum-ciphers,ssl-cert,http-title" 10.10.10.5nmap -p80,443 --script "http-enum,http-methods,http-robots.txt" 10.10.10.5nmap -p161 -sU --script snmp-info 10.10.10.5nmap -p445 --script smb-vuln-ms17-010 10.10.10.5nmap -sA -p 80,443 10.10.10.5 # ACK scannmap -f -p 80 10.10.10.5 # fragment (nadiren)Çıktı yönetimi
Section titled “Çıktı yönetimi”nmap -p- -Pn 10.10.10.5 -oA scans/host_fullxsltproc scans/host_full.xml -o scans/host_full.htmlgrep '/open/' scans/host_full.gnmapSaldırı zinciri
Section titled “Saldırı zinciri”ARP/ping sweep → live.txt → masscan/nmap -p- → open ports → -sC -sV → SMB/HTTP/SNMP adayları → service-enumeration / smb / ntlm-relay