Most people run nmap with an IP address and nothing else: 1,000 TCP ports out of 65,535, no UDP, and every probe ends up in the defender's logs. In this episode you scan like a pro: port states, host discovery, SYN vs connect scans, all TCP ports, UDP, version and OS detection, timing templates, the Nmap Scripting Engine and masscan. Then you switch sides: how Suricata, Zeek and the firewall see every scan, how to shrink what a scan can find, and how to prove the fix with ndiff.

⚠️ For education only. Every demo runs in an isolated lab (Kali 10.10.10.5, Metasploitable 10.10.10.20, Ubuntu server 10.10.10.60). Only test systems you own or have written permission to test. Scanning networks you don't own can be illegal.

In this episode:
✔ Port states: open, closed, filtered, unfiltered, open|filtered, closed|filtered
✔ MITRE ATT&CK: T1595.001 Scanning IP Blocks, T1046 Network Service Discovery
✔ Host discovery: -sn (ARP on a LAN) and -Pn
✔ SYN scan (half-open) vs connect scan, packet by packet
✔ All 65,535 TCP ports with -p- and --min-rate, saving with -oA
✔ UDP scanning: why it's slow and what open|filtered means
✔ -sV, -sC, -O and -A: versions, default scripts, OS
✔ Timing templates T0 to T5, plus rate, retries and host timeout
✔ NSE: categories, --script-help, and a script that is really an exploit
✔ masscan for big ranges, nmap for the details
✔ Detect: Suricata ET SCAN rules, Zeek conn.log, UFW firewall logs
✔ Fix: disable services, bind to localhost, default-deny firewall, re-test with ndiff

⏱ Chapters
0:00 The scan most people run
0:17 Welcome
0:25 Legal: scanning & scope
0:43 Port states & ATT&CK
1:13 Host discovery (-sn, -Pn)
1:35 SYN scan vs connect scan
2:01 All 65,535 TCP ports (-p-, -oA)
2:26 UDP scanning
2:51 Versions, scripts & OS (-sV -sC -O)
3:15 Timing templates T0 to T5
3:41 NSE: categories & script-help
4:07 NSE in action: vsftpd backdoor
4:29 masscan + nmap
4:53 Detect: Suricata, Zeek & firewall logs
5:28 Fix: shrink exposure + ndiff re-test
5:58 Common mistakes
6:20 Cheat sheet
6:38 Like & subscribe
6:49 Homework & up next

💻 Commands from this video
Kali (10.10.10.5):
sudo nmap -sn 10.10.10.0/24
sudo nmap -sS -p- --min-rate 2000 -oA ms2-full 10.10.10.20
sudo nmap -sU --top-ports 50 10.10.10.20
sudo nmap -sV -sC -O -p 21,22,139,445,3306 10.10.10.20
sudo nmap -T4 --max-retries 2 --host-timeout 10m -p- 10.10.10.20
ls /usr/share/nmap/scripts | wc -l
nmap --script-help ftp-vsftpd-backdoor
sudo nmap -p 21 --script ftp-vsftpd-backdoor 10.10.10.20 (lab only: it runs a command on the target)
sudo nmap --script "default and safe" -p 21,22,80 10.10.10.20
sudo masscan 10.10.10.0/24 -p1-65535 --rate 10000
sudo nmap -sV -p 22,3306,8080 10.10.10.60

Defender:
cat conn.log | zeek-cut id.orig_h conn_state | awk '$2=="REJ"{print $1}' | sort | uniq -c
sudo grep 'UFW BLOCK' /var/log/ufw.log | tail -1
Suricata: ET SCAN Possible Nmap User-Agent Observed · ET SCAN Suspicious inbound to mySQL port 3306

Fix + re-test (Ubuntu 10.10.10.60):
sudo systemctl disable --now inetutils-inetd
/etc/mysql/mysql.conf.d/mysqld.cnf: bind-address = 127.0.0.1
sudo ufw default deny incoming
sudo ufw allow from 10.10.10.0/24 to any port 22 proto tcp
sudo ufw logging on
sudo nmap -sS -p- -oX after.xml 10.10.10.60
ndiff before.xml after.xml

🛡 Defender's checklist
• Know your own exposure: scan yourself with -p- and -sU, on a schedule
• Expose only what's needed; bind internal services to localhost
• Default-deny firewall with logging on
• Watch for one source touching many ports (Zeek conn.log, REJ / S0 states)
• Correlate over long windows: slow scans hide in short ones
• Patch: hiding version banners is cosmetic
• Re-test every change with ndiff

📺 Full course playlist:
⏮ Previous episode – #3 OSINT & Attack Surface Mapping:


⏭ Next episode – #5 Vulnerability Assessment: OpenVAS, Nuclei & triage: [EP5 LINK]

📝 Homework: scan your lab, all TCP ports and the top UDP ports, with versions and safe scripts. Then find your own scan in Suricata and Zeek.

👍 If this helped, like & subscribe, it keeps the course free.
© netacademy.ge

#KaliLinux #Nmap #EthicalHacking #CyberSecurity #PenetrationTesting

Last modified: Sunday, 6 December 2026, 10:07 AM