Objective
Compare scan speed, accuracy, and firewall footprint between different Nmap scan types (-sS SYN scan vs -sT TCP Connect scan) and examine how timing templates affect detection and packet loss.
Methodology & Execution
Scans were performed against a test Debian host running OpenSSH 9.2, Nginx, and a Python test service listening on port 9000.
1. SYN Stealth Scan (-sS)
$ sudo nmap -sS -p 22,80,9000 -T4 192.168.10.50$ Starting Nmap 7.94 ( https://nmap.org )$ Nmap scan report for 192.168.10.50$ PORT STATE SERVICE$ 22/tcp open ssh$ 80/tcp open http$ 9000/tcp open cslistener$ Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds
The SYN scan sends a SYN packet, waits for a SYN/ACK, and immediately replies with RST rather than completing the three-way handshake. This avoids opening full application sockets on target services.
2. Service Version Detection (-sV)
$ nmap -sV -p 22,80 192.168.10.50$ PORT STATE SERVICE VERSION$ 22/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)$ 80/tcp open http nginx 1.22.1$ Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
When version detection is enabled, Nmap connects to open ports and issues protocol probes (such as GET / HTTP/1.0\r\n\r\n for HTTP or reading SSH banner SSH-2.0-...).
Scan Timing Notes (-T2 vs -T4)
In testing against an interface with simulated 20ms jitter:
-T4completed in 0.28 seconds for 100 ports, but occasionally caused retransmissions when inspecting higher port ranges.-T3(default) took approximately 1.4 seconds with zero packet loss.- In low-bandwidth or IDS-monitored environments, slowing down probe frequency prevents buffer exhaustion on embedded targets like ESP32 or Raspberry Pi.
Practical Recommendations
- Always use
-sSwhen root privileges are available to prevent unnecessary socket allocation on the target. - Use
--opento filter out closed and filtered ports when scanning larger subnets. - Save scan outputs in multiple formats simultaneously (
-oA scan_output) for documentation and post-processing with grep or Python.