Season 1 Part of Tool Spotlight · Episode 04 of 10
View all 10 episodes →
Tool Spotlight · Episode 04 · Nmap · Network Security · Port Scanning · Attack Surface · September 6, 2027 · 9 min read

Nmap for Checking Your Own Network Exposure

Tool Spotlight · Ep 04 Nmap Network Security Port Scanning Attack Surface · 9 min read
💬 Feedback
1,000
TCP ports Nmap checks by default
A plain scan covers the most commonly used ports unless you ask for more
6
Port states Nmap can report
From open and closed to filtered and the uncertain states in between
Written
Permission before scanning anything not yours
Nmap's own guide calls it the best way to avoid controversy

Within minutes of a device appearing on the internet, something will knock on its ports. Automated scanners sweep the whole address space looking for remote desktop, forgotten admin panels, old file shares and unpatched services. The question is not whether your network will be scanned. It is whether you will scan it first and know what they will find.

Tool card What it is: network discovery and security auditing tool ("Network Mapper")
Cost: free and open source
Runs on: Windows, macOS and Linux
Also includes: Zenmap (graphical interface) and Ncat (data transfer and debugging)
Good for: finding devices on your network, seeing which services they expose, building an inventory
Skill level: beginner to start, deep for experts

What Nmap Does

Nmap describes itself as a free and open-source utility for network discovery and security auditing. Administrators use it for tasks such as network inventory and monitoring whether hosts and services are up. It has been around for more than two decades and is one of the most widely used tools in security.

At its simplest, Nmap answers three questions about a network:

  • Which devices are there?
  • Which ports are open on each one? An open port means an application is accepting connections.
  • What is listening on those ports, and which version?

Those are the same questions an attacker asks. Answering them yourself shows you your attack surface: everything a stranger could try to connect to.

Only scan what you own or are authorised to test Nmap's own guide says the best way to avoid controversy is to always secure written authorisation. Scanning your own home network or systems you administer is generally uncontroversial, but scanning other people's networks can break your internet provider's acceptable use policy, your employer's rules, or the law, depending on where you are. For practice, the Nmap project gives permission to scan scanme.nmap.org, within limits.

Four Scans That Answer the Important Questions

Replace 192.168.1.0/24 with your own network range, which you can find in your device's network settings.

  1. What is on my network?
    nmap -sn 192.168.1.0/24
    A "ping scan" that lists which addresses respond, without checking ports. Compare the list with the devices you know about. Unknown devices deserve an explanation.
  2. What does each device expose?
    nmap 192.168.1.0/24
    A default scan checks 1,000 common TCP ports on each device and reports their state.
  3. What exactly is listening?
    nmap -sV 192.168.1.20
    Version detection identifies the software and version behind each open port, so you can check whether it is out of date.
  4. Did I miss anything?
    nmap -p- 192.168.1.20
    Scans all 65,535 TCP ports on one device. Slower, but it finds services hiding on unusual ports.

Add -oA results to any scan to save the output, so you can compare it with future scans. If you prefer a graphical interface, Zenmap runs the same scans and shows the results visually.

Reading the Results

Nmap reports each port in one of six states. The three you will see most:

  • open: an application is accepting connections. This is your attack surface.
  • closed: the device responded, but nothing is listening.
  • filtered: a firewall is blocking the probes, so Nmap cannot tell whether the port is open.

Open ports that deserve immediate attention, especially if they are reachable from the internet:

  • 3389 (Remote Desktop) and 22 (SSH): prime targets for password-guessing and exploits. Put them behind a VPN or restrict them tightly.
  • 445 (Windows file sharing): should never be exposed to the internet.
  • 23 (Telnet) and 21 (FTP): old protocols that send passwords in plain text.
  • 80, 443, 8080 and 8443 on routers, cameras, printers or storage devices: admin interfaces that often have default passwords or unpatched flaws.
  • Database ports such as 3306 (MySQL), 5432 (PostgreSQL) and 27017 (MongoDB): almost never meant to be public.
Every open port is a door. Nmap shows you which ones you left unlocked, and some you did not know you had.

Inside Versus Outside

A scan from inside your network shows what any device on that network can reach. That matters for malware spreading from one machine to another. But attackers on the internet see a different picture: only what your router or firewall lets through.

  • Check your router's port forwarding and UPnP settings. Anything forwarded is exposed to the internet. Turn off UPnP if you do not need it, and remove forwards you cannot explain. See Security in 5 Minutes, Episode 02.
  • Scan your public address from outside, for example from a cloud server you control, to see exactly what the internet sees. Your internet provider's terms still apply.
  • For organisations, include cloud servers, websites and remote access gateways, not just the office network. Anything with a public address is part of your attack surface.

What to Do With What You Find

  1. Identify every device and service. If you cannot explain it, find out what it is before doing anything else.
  2. Close what is not needed. Disable the service, remove the port forward, or block it at the firewall.
  3. Restrict what must stay open to specific addresses, or put it behind a VPN or zero-trust access service.
  4. Update what remains. Version detection tells you what is running; check it against the vendor's latest release. See Security in 5 Minutes, Episode 08.
  5. Change default passwords on every admin interface you found.
  6. Scan again regularly and compare with your saved results. New open ports are worth investigating.

Limits to Keep in Mind

  • Nmap finds open doors; it does not test whether they can be broken. It is a mapping tool, not a full vulnerability scanner.
  • Scans can disrupt fragile devices, such as old printers or industrial equipment. Start gently and avoid production systems at busy times.
  • Firewalls and filtering affect results. "Filtered" means "unknown", not "safe".
  • A scan is a snapshot. Networks change daily, so regular scanning matters more than one perfect scan.

Final Thoughts

Attackers will map your network whether you do or not. Run a ping scan of your home or office network this week, then a default scan of anything you do not recognise. You will probably find at least one device or open port that surprises you, and it is far better to be surprised by your own scan than by someone else's.

You cannot defend what you do not know is there. Map it before someone else does.

Sources and Further Reading

Cyber Insight | Tool Spotlight · Season 1

Making cybersecurity easier to understand, one issue at a time.

Season 1

Tool Spotlight · All 10 Episodes

Free and open-source security tools: what they do and where they fall short.

01
Wireshark basics for spotting suspicious traffic Episode 01 · Published
02
Have I Been Pwned and breach-monitoring tools Episode 02 · Published
03
Sysmon for endpoint visibility on Windows Episode 03 · Published
04
Nmap for checking your own network exposure Episode 04 · Now reading
05
YARA and Sigma rules: writing a first detection Episode 05 · Published
06
CyberChef for decoding and analysing data Episode 06 · Coming soon
07
VirusTotal: using it well and its limits Episode 07 · Coming soon
08
Process Explorer and Autoruns for finding persistence Episode 08 · Coming soon
09
OWASP ZAP for testing your own web app Episode 09 · Coming soon
10
Wazuh: open-source monitoring for a small network Episode 10 · Coming soon
PS
Poorna Sujampathi Rathnayaka
Writer · Cyber Insight · Digital Literacy

I started Cyber Insight because everywhere online people only talk about cybersecurity in technical terms — and most people are left without a proper understanding of how the digital world works. I work in cybersecurity, but I write here for everyone. No jargon. Just clear, honest explanations.