You can find out which doors are open on a server with a single command. That's Nmap.
The SYN scan: -sS
We saw this in the 3-way handshake (lesson 8). Send a SYN to a port: if a SYN-ACK comes back, the port is open; if an RST comes back, it's closed. Nmap's SYN scan uses exactly that:
nmap -sS 192.168.31.1
It's also called a stealth or half-open scan: Nmap sends the SYN and checks whether a SYN-ACK comes back, but it never sends the final ACK. It cuts the conversation off with an RST, so a full connection is never made. (-sS usually needs administrator or root rights.)
- Nmap sends a SYN to port 22.
- The target replies SYN-ACK: port 22 is open.
- Nmap sends RST instead of the final ACK, so no full connection is made.
- Nmap sends a SYN to port 23.
- The target replies RST: port 23 is closed.
Services and versions: -sV
Knowing a port is open isn't enough. You need to know which service is running on it. For that, use -sV:
nmap -sV 192.168.31.1
The output adds a VERSION column, for example which SSH or web server software, and which version. Old versions with known vulnerabilities are exactly what a security tester looks for next.
There's much more
Nmap can scan a whole network, for example nmap -sS 192.168.31.0/24, to find which devices are on it and which ports and services each one runs. That's how you find the forgotten device with an open RDP port (lesson 13) before someone else does.
The rule: scan only your own network, or one you have written permission to test. Scanning other people's systems without permission is illegal in India under the IT Act, and in most other countries too.
For more scans, the beginner mistakes to avoid and where to practise legally, read our Nmap tutorial for beginners.
You've finished the tutorial
You can now read the Wireshark screen that once made no sense, and you know what Nmap is actually doing when it says "open". If you want to do all of this hands-on, in real labs, with a mentor explaining it in Malayalam, the 50 Days Ethical Hacking Challenge covers it fully.
Key takeaways
- nmap -sS: SYN scan; SYN-ACK = open, RST = closed.
- It's "stealth" or half-open because the handshake is never completed.
- nmap -sV shows the service and version on each open port.
- Scan only your own network or one you have permission to test.
Quick quiz
Pick an answer to check yourself. Answer both to mark this lesson done.
1. Which Nmap option runs a SYN (stealth) scan?
- A) -sV
- B) -sS
- C) -sU
- D) -p
Show answer
Answer: B. -sS is the SYN scan. It sends SYN and checks for SYN-ACK without making a full connection, which is why it's called stealth.
2. Which option shows the service and version running on a port?
- A) -sS
- B) -sV
- C) -h
- D) -v
Show answer
Answer: B. -sV detects the service and version running on open ports.
Module 3 test
Five questions on lessons 11 to 15.
1. A asks "who has 31.2?" and before B can answer, an attacker says "I'm 31.2" and gives their own MAC. Which attack is this?
- A) DNS spoofing
- B) ARP spoofing
- C) Brute force
- D) SYN scan
Show answer
Answer: B. Giving a false answer to an ARP question so data comes to your own MAC is ARP spoofing.
2. Why can you read the password directly in an HTTP login packet in Wireshark?
- A) Because HTTP doesn't encrypt
- B) Because Wireshark hacks the password
- C) Because the password is short
- D) Because there's no DNS
Show answer
Answer: A. HTTP sends data as plain text. With HTTPS it would be encrypted.
3. Which port does SSH usually run on?
- A) 21
- B) 22
- C) 80
- D) 3389
Show answer
Answer: B. 21 = FTP, 22 = SSH, 80 = HTTP, 443 = HTTPS, 3389 = RDP.
4. Which Wireshark filter shows only packets going to the IP 192.168.31.1?
- A) ip.dst == 192.168.31.1
- B) dns
- C) tcp.dstport == 192.168.31.1
- D) http
Show answer
Answer: A. ip.dst filters by destination IP. tcp.dstport is for port numbers.
5. In an Nmap SYN scan, a port replies with RST. What does it mean?
- A) The port is open
- B) The port is closed
- C) The service version was found
- D) The server was hacked
Show answer
Answer: B. SYN-ACK means open; RST (reset) means closed.
Frequently asked questions
What does nmap -sS do?
It runs a TCP SYN scan: Nmap sends a SYN to each port and marks it open if a SYN-ACK comes back and closed if an RST comes back, without completing the connection.
What is the difference between -sS and -sV in Nmap?
-sS finds which ports are open using SYN packets. -sV goes further and identifies the service and version running on each open port.
Is it legal to use Nmap?
Yes, on your own network or on systems you have written permission to test. Scanning other people's systems without permission is illegal.