Nmap for beginners: scan your own network

☰ All 15 lessons

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.)

How an Nmap SYN scan decides open or closedNmapTargetSYN → port 22SYN-ACK = OPEN ✓RST (no final ACK: "stealth")SYN → port 23RST = CLOSED ✗
  1. Nmap sends a SYN to port 22.
  2. The target replies SYN-ACK: port 22 is open.
  3. Nmap sends RST instead of the final ACK, so no full connection is made.
  4. Nmap sends a SYN to port 23.
  5. The target replies RST: port 23 is closed.
Open port: SYN-ACK. Closed port: RST. Nmap never completes the handshake.

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?

  1. A) -sV
  2. B) -sS
  3. C) -sU
  4. 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?

  1. A) -sS
  2. B) -sV
  3. C) -h
  4. 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?

  1. A) DNS spoofing
  2. B) ARP spoofing
  3. C) Brute force
  4. 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?

  1. A) Because HTTP doesn't encrypt
  2. B) Because Wireshark hacks the password
  3. C) Because the password is short
  4. 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?

  1. A) 21
  2. B) 22
  3. C) 80
  4. 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?

  1. A) ip.dst == 192.168.31.1
  2. B) dns
  3. C) tcp.dstport == 192.168.31.1
  4. 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?

  1. A) The port is open
  2. B) The port is closed
  3. C) The service version was found
  4. 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.

Do it hands-on.

This tutorial gives you the concepts. The 50 Days Ethical Hacking Challenge puts them to work in real labs, explained in Malayalam.