Hello everyone,
so I was reading through the “Network discovery with Nmap” module, and when I reached the “Host and Port scanning section”, I saw this bit of information about the -sT (TCP Connection scan) being said:
The
Connect
scan is useful because it is the most accurate way to determine the state of a port, and it is also the most stealthy. Unlike other types of scans, such as the SYN scan, the Connect scan does not leave any unfinished connections or unsent packets on the target host, which makes it less likely to be detected by intrusion detection systems (IDS) or intrusion prevention systems (IPS).
Nevertheless, according to the official Nmap documentation, they say that -sS is the most stealthy TCP scan, precisely because it does not make a connection:
SYN scan is the default and most popular scan option for good reason. It can be performed quickly, scanning thousands of ports per second on a fast network not hampered by intrusive firewalls. SYN scan is relatively unobtrusive and stealthy, since it never completes TCP connections.
When discussing TCP Connect scan in the Nmap official docu, this is what they say:
When SYN scan is available, it is usually a better choice. Nmap has less control over the high level
connect
call than with raw packets, making it less efficient. The system call completes connections to open target ports rather than performing the half-open reset that SYN scan does. Not only does this take longer and require more packets to obtain the same information, but target machines are more likely to log the connection. A decent IDS will catch either, but most machines have no such alarm system. Many services on your average Unix system will add a note to syslog, and sometimes a cryptic error message, when Nmap connects and then closes the connection without sending data. Truly pathetic services crash when this happens, though that is uncommon. An administrator who sees a bunch of connection attempts in her logs from a single system should know that she has been connect scanned.
Is there something I’m missing, or are these bits of information contradicting each other (Nmap docu vs HTB Academy)?
-sS docu: https://nmap.org/book/synscan.html
-sT docu: https://nmap.org/book/scan-methods-connect-scan.html