What is the difference between nmap -ss and nmap -st?
TechnicalSecurity Operations EngineerNetwork Security EngineerPenetration TesterThe main difference between nmap -sS and nmap -sT lies in the type of scan they perform. The -sS option initiates a TCP SYN scan, which is stealthier and faster. It sends SYN packets to the target ports and waits for responses, allowing it to determine open ports without completing the TCP handshake. This makes it less detectable by firewalls or intrusion detection systems.
On the other hand, -sT performs a TCP connect scan, which completes the full TCP handshake. It establishes a connection by sending SYN, receiving SYN-ACK, and then sending an ACK. This method is easier to detect and can be blocked by security measures.
A practical example would be when I need to conduct a quick assessment of a network's security posture. I would use -sS for stealthy reconnaissance, especially if I suspect that the network has active monitoring. However, if I have permission and need detailed information about the services running on open ports, I would opt for -sT to ensure a complete connection and gather more data. The trade-off here is between stealth and the depth of information obtained.