——
LabLABS

Scan your own public IP from the outside with Nmap

A practical perimeter check you can run today: find the correct public address, scan it from a genuinely external network, understand every result, fix exposure, and prove the change.

For home users and small organisations testing only public IPv4 or IPv6 addresses they own or are explicitly authorised to assess.

NmapPublic IPPerimeter

Start with the situation, not the slogan

This lab is designed to produce evidence and judgement, not a ceremonial screenshot of a tool running. Scan your own public IP from the outside with Nmap is successful when you can explain the question, predict the expected observation, collect it safely and distinguish a useful result from noise. The commands are the least interesting part, although they are traditionally the part everyone photographs.

Use systems you own or have explicit permission to test. Keep the exercise isolated from household, client and production networks, take a snapshot before deliberate breakage, and write the rollback step before the first change. A lab without a reset path is simply a future troubleshooting appointment.

An internal scan shows the private side of the router. An external Nmap scan shows what the internet-facing path answers from that particular vantage point. It can reveal open services and filtering, but it cannot prove that an application is patched, safe, or unreachable from every network.

How this usually reaches the desk

Set one modest objective for the session. Begin with the expected clue: The public address is confirmed independently and distinguished from a private router address or carrier-grade NAT. Then create or collect only enough benign activity to make that clue visible. If the observation does not appear, investigate the data path before adding more tools. Instrumentation that cannot see a known test event will not become more perceptive during a real incident.

This scenario combines common operational patterns; it is not presented as a report of one named incident.

What to look for

Begin with preserved, comparable evidence. One signal is rarely proof; use independent observations and a reliable timeline before declaring scope or intent.

01

The public address is confirmed independently and distinguished from a private router address or carrier-grade NAT.

Write the expected observation before the exercise. Include the source, destination, time and field that should carry it; this turns an interesting screen into a falsifiable test.

02

The scan originates from a separate internet connection or controlled remote host, not from behind the router being tested.

Confirm that clocks, names and identifiers line up across the lab. Time drift and ambiguous hostnames can turn three tidy events into an accidental detective novel.

03

Every open port has an expected service, named owner, business reason, source restriction, patch status, and removal date if temporary.

Keep a known-good comparison. The aim is not merely to produce an alert or packet, but to explain how the test differs from ordinary activity and where false positives would arise.

The test: what does your address answer from the internet?

We are not “hacking the router”. We are asking a narrower and much more useful question: from one genuinely external connection, which TCP ports on an address we own answer, which appear filtered, and which service seems to be listening? That gives us a perimeter observation we can compare with the intended firewall and port-forwarding configuration.

Use only an address and service you own or have explicit written permission to test. “It is my public IP” is not always sufficient: a CDN, reverse proxy, shared hosting platform or CGNAT address may belong operationally to somebody else. If the scanner runs from a VPS or cloud account, check that provider’s acceptable-use and penetration-testing policy as well as the target provider’s terms; some providers require notice, a support ticket, a named source IP, rate limits or a defined testing window even for authorised work. Cross-border testing can add legal duties. This is practical scoping guidance, not legal advice.

The examples use 203.0.113.25 and 2001:db8::25, addresses reserved for documentation. They are stage props, not targets. Replace them only after recording the owner, target, source IP, date, permitted techniques, emergency contact and stop condition.

01

Find the public address. From the network being tested, visit the router status page and a reputable “what is my IP” service, or use curl -4 https://api.ipify.org. On PowerShell, (Invoke-RestMethod -Uri "https://api.ipify.org").Trim() does the same job. Write down the result and time.

02

Compare it with the router’s WAN address. If the router shows a private address such as 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, or the shared carrier range 100.64.0.0/10, you may be behind upstream NAT or CGNAT. CGNAT is common on mobile broadband in Latvia and across the Baltics, and may also appear on some fixed-access plans. Do not assume the ISP name or connection type settles the question: compare both addresses and ask whether a dedicated public IPv4 is available. Scanning a shared address may test provider infrastructure rather than your router.

03

Move the scanner outside. Put a laptop on a phone hotspot, use a second site, or use a small remote machine you control. Do not test from the LAN and call it external: NAT loopback can give a different answer, and some routers refuse the experiment out of principle.

04

Confirm the address again. Dynamic addresses can change between making tea and opening a terminal. Confirm immediately before the scan and stop if the target is no longer yours.

Before you press EnterRecord the target, ownership, external source address, date, time zone and expected open ports. If the expected list is blank, write “none”. This small act turns surprise into evidence rather than a lively anecdote.

One sensible scan before lunch

# Run this on a laptop using a different connection, or on a remote host you control.
# 203.0.113.25 is documentation space: replace it with YOUR confirmed public IP.
nmap -Pn -sT --top-ports 1000 --reason \
  -oA perimeter-2026-08-18 203.0.113.25
-Pn

Skip host discovery and scan the address even if ping probes are blocked. “Host is up, received user-set” therefore reflects your instruction, not proof that an ICMP reply arrived.

-sT

Use a TCP connect scan. It works without raw-packet privileges and makes this first run consistent across ordinary machines. It completes real TCP connections, so your logs may quite properly notice it.

--top-ports 1000

Check the 1,000 TCP ports Nmap ranks most commonly used. It is a strong first pass, not every possible port. We deliberately begin bounded and expand only when needed.

--reason

Show why Nmap assigned a state—perhaps a reset, a successful reply, or no response. This is far more useful than accepting a coloured word as revelation.

-oA name

Save normal, XML and grepable-format output under one basename. XML is useful for comparison and automation; the normal text remains pleasant for humans and printers with excellent self-esteem.

203.0.113.25

The single authorised target. Avoid pasting a hostname until you understand every address it resolves to, especially when a CDN or hosting provider may own the result.

Do not begin with -A, every NSE script, maximum speed and an entire subnet. Nmap is a toolbox, not a loyalty programme: collecting every option does not earn points. The baseline should answer which common TCP ports are reachable without producing needless load or muddying the question.

Open, closed and filtered are observations, not moral judgements

Nmap scan report for 203.0.113.25
Host is up, received user-set.

PORT     STATE     SERVICE  REASON
22/tcp   open      ssh      syn-ack
80/tcp   closed    http     reset
443/tcp  open      https    syn-ack
8291/tcp filtered  winbox   no-response

Nmap done: 1 IP address (1 host up) scanned
StateWhat Nmap observedWhat you do next
OpenAn application accepted a connection or otherwise responded as a listener.Identify the real service, owner, forwarding rule, authentication, patch state and reason it must be public.
ClosedThe host answered, but nothing was listening on that port at that moment.Usually no service exposure exists there. Keep it as useful evidence that the host path replied.
FilteredA firewall or another obstacle prevented Nmap deciding whether the port was open or closed.Compare with your firewall policy. Filtered is often desirable externally, but it is not proof that the service behind the filter is safe.
Open|filteredCommon with UDP: the probe produced no response, so Nmap cannot distinguish a silent service from a filter.Verify locally, review policy and use a protocol-specific test only when justified.

In the example, SSH and HTTPS deserve an owner and a reason. Port 80 is closed: it answered with a reset but has no listener. Winbox appears filtered from this source, which may match a firewall rule that permits management only through VPN. The word SERVICE is initially based largely on conventional port numbers; a line saying ssh is not yet proof that OpenSSH—or any particular version—is present.

Run service detection only against the ports you found and own:

# Investigate only the TCP ports found open in the baseline.
nmap -Pn -sT -sV --version-light \
  -p 22,443,8291 --reason \
  -oA services-2026-08-18 203.0.113.25

# If HTTPS is yours, inspect the presented certificate and offered TLS ciphers.
nmap -Pn -sT -p 443 \
  --script ssl-cert,ssl-enum-ciphers \
  -oA tls-2026-08-18 203.0.113.25

-sV sends service-specific probes and may identify an application and version. --version-light uses a lighter probe intensity. Treat the result as an identification lead, not a vulnerability verdict: banners can be hidden, misleading or different from the installed patch level. Confirm on the router, server or application itself.

What is not all right—and what to improve

Remove

Telnet 23, plain FTP 21 or an accidental database

These are rarely sensible on a home or small-office public address. Disable the service or port forward. Replace legacy protocols with an encrypted, authenticated alternative. A public database, SMB, RDP or management panel deserves immediate confirmation and usually immediate restriction.

Restrict

SSH 22 or MikroTik Winbox 8291

If remote management is genuinely required, prefer a VPN and a trusted management network. Otherwise restrict source addresses, use key-based or strong authentication, remove defaults, patch promptly, rate-limit sensibly and monitor logins. Moving the port reduces noise, not risk.

Review

HTTP 80 and HTTPS 443

Port 80 may exist only to redirect to HTTPS; prove that it does. For 443, inspect the certificate and ciphers, patch the web stack and review the application itself. A good TLS configuration cannot make an exposed admin panel a good idea.

Explain

Everything expected

“Expected” still needs a named owner, purpose, update path, logs and a retirement trigger. An intentional port with an abandoned appliance behind it is merely an accident that completed paperwork.

Check the router’s port forwards, UPnP mappings, VPN configuration and input rules, then check the listening process on the destination host. Cloud firewalls, provider controls and container publishing can create additional layers. Remove the exposure at the authoritative layer rather than stacking a temporary rule somewhere everyone will forget.

An open port is exposure. A CVE needs considerably more evidence.

Nmap’s first answer is reachability. Service detection adds a product or protocol lead. A vulnerability decision requires the actual product, installed package or firmware build, affected configuration, reachable feature and a primary advisory. Keep those conclusions separate in the case record:

EvidenceWhat it establishesNext check
443/tcp openA TCP listener accepted the external connection.Identify the owner, reverse proxy, application and reason for public exposure.
-sV resultA best-effort service fingerprint or banner.Confirm the installed package, container digest, appliance firmware and backported security fixes locally.
Scanner findingA rule matched an observed version, response or configuration.Read the exact plugin evidence and primary vendor advisory; reproduce the safe condition in an authorised environment.
Confirmed affected pathThe deployed version and reachable feature meet the advisory’s affected conditions.Contain unnecessary exposure, patch or mitigate, then repeat the same observation and negative test.

For a Linux SSH result, confirm the package rather than trusting a banner:

# Debian or Ubuntu
dpkg-query -W -f='${Package} ${Version}\n' openssh-server
apt-cache policy openssh-server

# RHEL, Fedora or Rocky Linux
rpm -q openssh-server
dnf updateinfo list --security openssh-server

Distributions often backport security fixes without changing the upstream-looking banner in the way a scanner expects. Compare the installed package release with the distribution security notice or vendor advisory. For containers, identify the immutable image and scan that exact build:

docker inspect --format='{{.Config.Image}} {{.Image}}' CONTAINER_NAME
trivy image --severity HIGH,CRITICAL --ignore-unfixed YOUR_IMAGE@sha256:YOUR_DIGEST

For TLS configuration on a service you own, the targeted Nmap scripts ssl-cert and ssl-enum-ciphers are more intelligible than throwing the whole script cupboard at it. Before any NSE script, read its description and categories with nmap --script-help SCRIPT_NAME. Nmap’s vuln category is not a harmless “find problems” switch: NSE also includes intrusive, exploit, brute-force and denial-of-service scripts, scripts are not sandboxed, and some default scripts are considered intrusive. Do not run --script vuln, -A or third-party scripts blindly against production.

Patch decisionIf the affected version and reachable condition are confirmed, first remove needless public reachability or restrict it to a trusted path, preserve the finding, follow the vendor remediation, test in staging, deploy with rollback, and repeat the original scan. If no patch exists, document the compensating control, monitoring, owner and expiry date.

If nobody owns the port, treat it as an incident lead

Do not immediately launch more aggressive probes at a service nobody recognises. First preserve the external Nmap output and identify the internal listener, port forward, container or router service through local control-plane evidence:

# Linux: listener, process and executable lead
sudo ss -lntup
sudo readlink -f /proc/PID/exe

# Windows PowerShell: listener and owning process
Get-NetTCPConnection -State Listen | Sort-Object LocalPort
Get-Process -Id PID | Select-Object Id,ProcessName,Path,StartTime

# Docker: host bindings
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Ports}}'

# MikroTik RouterOS: forwards, UPnP and router services
/ip firewall nat print detail where action=dst-nat
/ip upnp mappings print
/ip service print detail

An undocumented but legitimate service should still acquire an owner, purpose, patch path and logging. Escalate to incident response when the port is new and accompanied by an unknown process or container, new privileged account, unfamiliar remote administration tool, unexplained outbound connection, suspicious login, disabled security control or unapproved configuration change. Block or restrict the exposure at the perimeter when that can be done safely, preserve volatile state and logs, and follow the web-server compromise playbook or the Linux compromise guide. Rebooting first may remove the listener and the evidence while leaving stolen credentials perfectly employed elsewhere.

Catch the things the first command deliberately missed

# Full TCP range: slower, but catches services outside the common 1,000 ports.
nmap -Pn -sT -p- --reason -oA all-tcp-2026-08-18 203.0.113.25

# A deliberately small UDP sample. Administrator/root rights are normally required.
sudo nmap -Pn -sU --top-ports 20 --reason \
  -oA udp-2026-08-18 203.0.113.25

# IPv6 is a separate perimeter. Replace the documentation address with YOUR IPv6.
nmap -6 -Pn -sT --top-ports 1000 --reason \
  -oA ipv6-2026-08-18 2001:db8::25

A full TCP scan checks ports 1–65535. Run it during a suitable window, still against the one authorised address. The small UDP check is intentionally not -p-; UDP is slower and ambiguity is normal. Verify any interesting UDP result against the router and host rather than escalating punctuation.

IPv6 is not decorative IPv4. Devices can have globally reachable IPv6 addresses without the IPv4 port-forwarding model you expected. Identify your assigned prefix and actual device addresses, confirm authorisation, and scan only the intended target. Review the IPv6 firewall independently. “The IPv4 scan was clean” says nothing about a forgotten IPv6 management service.

A result of no open ports is encouraging but limited. It describes the tested address, protocols, ports, source network and time. It does not assess outbound compromise, web-application flaws behind port 443, cloud services on another address, a VPN-only path, or a service that was asleep. Write the boundary next to the conclusion.

Zenmap, for the especially industrious sort of lazy

Zenmap is the official graphical front end and results viewer for Nmap. On Windows, the official Nmap self-installer offers Zenmap as an installation option. Open it on the external machine, put your confirmed single address in Target, and paste the baseline command into Command. Zenmap updates the profile controls, runs the same Nmap engine, and displays the ordinary output alongside Ports/Hosts and other views.

Zenmap
Hosts203.0.113.25Servicesssh (22)https (443)
Nmap OutputPorts / HostsTopologyHost DetailsScans
Nmap scan report for 203.0.113.25
PORT    STATE    SERVICE
22/tcp  open     ssh
443/tcp open     https
8291/tcp filtered winbox
1 One confirmed address2 Read the command before Scan3 Save XML to compare later
A faithful visual map of the Zenmap workflow. The exact colours and window furniture vary by operating system and version; the important controls are Target, Profile, Command, Scan and the result tabs.
  1. Install the current release only from the official Nmap site and leave the Zenmap option selected where offered.
  2. Enter your one authorised IP in Target. Do not select a convenient neighbouring range; your neighbour did not consent merely by owning an address.
  3. Paste nmap -Pn -sT --top-ports 1000 --reason YOUR_IP into Command, inspect it, then click Scan.
  4. Use Ports / Hosts to review open and filtered ports. Choose Scan → Save Scan and save XML if you want Zenmap to open it again; the plain-text format cannot be reopened as a Zenmap scan.
  5. Create a profile for the bounded command if you will repeat it. Use Tools → Compare Results to compare the before and after scans; a new + line is an addition and a - line is a removal.

The built-in “Intense scan” profile is broader than our first pass. It can be useful on a suitable authorised target, but choosing the most dramatic name because it sounds thorough is how a five-minute check becomes an afternoon of unexplained probes. The GUI removes typing; it does not remove scope, judgement or ownership.

Run it, read it, decide what changes

These examples use documentation addresses, test identities and bounded targets. Replace placeholders only inside systems you own or are explicitly authorised to operate. Read the expected result and next action before running the command; a successful command is evidence, not yet a conclusion.

Example 01

Run a bounded authorised TCP baseline

NmapExternal Linux, macOS or Windows scanner
Prerequisites
One public IP you own, written scope, and an external network; replace the documentation IP only after verifying ownership.
shell
nmap -Pn -sT --top-ports 1000 --reason   -oA perimeter-baseline 203.0.113.25
Expected result

Nmap classifies common TCP ports as open, closed or filtered and saves normal, XML and grepable output.

How to interpret it

Open means a listener answered; it does not mean vulnerable. Filtered means the scan could not decide. Compare every open port with the intended inventory.

Next action

Run focused version detection only on expected or unexplained open ports, then confirm the process and package locally.

Example 02

Identify one exposed service carefully

NmapAuthorised scanner
Prerequisites
A port found open in the baseline and permission for service probes.
shell
nmap -Pn -sV --version-all -p 443 --reason   -oA service-443 203.0.113.25
Expected result

Nmap reports a service fingerprint or best-effort product/version lead for TCP/443.

How to interpret it

A banner can be hidden, proxied or backported. Never equate the printed string directly with a CVE match.

Next action

Confirm the product and package version on the server, then check the vendor advisory, supported version and CISA KEV/NVD record where applicable.

Example 03

Check a web endpoint passively

OWASP ZAP BaselineDocker on an authorised workstation
Prerequisites
A website you own and approval for spidering; the baseline scan is passive after a short spider.
shell
docker run --rm -t ghcr.io/zaproxy/zaproxy:stable   zap-baseline.py -t https://www.example.com -r zap-report.html
Expected result

ZAP writes a report of passively observed warnings; by default alerts are warnings rather than automatic failures.

How to interpret it

A warning is a configuration or application lead, not proof of exploitability. The baseline does not perform a full active security test.

Next action

Review each alert against the application, fix confirmed issues, rerun the same command, and retain both dated reports.

Lab procedure

Read the whole sequence before starting. Several workstreams may run in parallel, but their evidence, authority and expected outcomes still need to be explicit. Every step below points back to a concrete example; use the example as implementation evidence, not as permission to operate outside the stated scope.

  1. 01

    Confirm ownership and determine the public IPv4 and any public IPv6 address; compare them with the router WAN address before scanning.

    Record the topology, versions, addresses, accounts and snapshots used for this run. Reproducibility starts with knowing which machine was actually on the screen.

    Working example 01: Run a bounded authorised TCP baseline — Nmap on External Linux, macOS or Windows scanner.

  2. 02

    Run a conservative TCP baseline from a genuinely external system and save normal, XML, and grepable output with the date.

    Make one controlled change or generate one benign event, then observe the result before continuing. Small steps preserve causality and make rollback considerably less theatrical.

    Working example 02: Identify one exposed service carefully — Nmap on Authorised scanner.

  3. 03

    Use targeted service detection only on the ports found open, then verify the actual listener and forwarding rule on the owned router or host.

    Capture raw evidence before filtering or transforming it. Save the query, filter or rule beside the result so a second run can challenge the first.

    Working example 03: Check a web endpoint passively — OWASP ZAP Baseline on Docker on an authorised workstation.

  4. 04

    Run a small UDP check and an IPv6 check where relevant, recording that silence and filtered results are not proof of absence.

    Introduce one negative or boundary case. A detection that fires on everything is technically energetic but operationally similar to a smoke alarm mounted above a toaster.

    Working example 01: Run a bounded authorised TCP baseline — Nmap on External Linux, macOS or Windows scanner.

  5. 05

    Remove or restrict unnecessary exposure, patch expected services, repeat the same scan, and keep the before-and-after evidence.

    Return the environment to its baseline, compare outcomes with the written expectation and note what would need to change before using the technique on managed systems.

    Working example 02: Identify one exposed service carefully — Nmap on Authorised scanner.

Operational judgement

Keep a lab notebook with four columns: time, action, expected evidence and observed evidence. Add screenshots only when they preserve information that text cannot. The notebook should allow another person to repeat the exercise without inheriting your browser history, shell history and particular relationship with luck.

The transfer-to-production question matters more than the demo. For Nmap, Public IP and Perimeter, consider data volume, retention, credentials, privacy, performance, ownership and failure behaviour. A successful lab proves that a mechanism can work under stated conditions; it does not prove that it can be deployed everywhere before lunch.

Make the result useful to the next person

Turn the exercise into a reusable lab card. Record the learning objective, isolation boundary, diagram, versions, seed data, expected observations, exact queries, screenshots that add real information, and the reset procedure. Mark which evidence was generated and which was supplied. If the lab uses a deliberately vulnerable image or sample, store its provenance and checksum. Future-you is a different operator and deserves better documentation than “it worked after I restarted something”.

End with a short teach-back. Explain why “Confirm ownership and determine the public IPv4 and any public IPv6 address; compare them with the router WAN address before scanning.” matters, demonstrate the observation that supports the conclusion, and show how the environment returns to baseline after “Remove or restrict unnecessary exposure, patch expected services, repeat the same scan, and keep the before-and-after evidence.” Then name one production assumption the lab did not test. That last sentence keeps a useful experiment from turning into unjustified confidence and gives the next exercise a sensible place to begin.

Validate before you close

The check is complete when the scan was external and authorised, every exposed service is explained and safely configured, unnecessary ports are closed or restricted, IPv6 and UDP were considered, and a repeat scan proves the intended change.

Capture the test, the expected result and the observed result. Where a person or business owner must accept restored service, name them in the record. A green dashboard can confirm that a component is answering; it cannot confirm that invoices, identities or restored data are trustworthy.

Finish with a compact closure note: the original trigger, confirmed scope, evidence retained, controls changed, tests passed, known gaps, residual risk, and the people responsible for the remaining work. Schedule a review while the timeline is still fresh enough to challenge. The purpose is not to find a person to blame; computers already perform blame with admirable efficiency. The purpose is to make the next response faster, safer and less dependent on one person remembering where the useful log was hidden.

Common mistakes

  • Connecting an intentionally weak lab directly to a home or production network.
  • Copying commands without recording the expected evidence and rollback step.
  • Calling a test successful without comparing the result to a known-good baseline.

These errors usually come from haste, unclear ownership or misplaced confidence. Build the safeguard into the runbook: a required evidence field, a second-person review, a rollback test or a specific exit criterion.

Questions people ask when the clock is running

Can I run this against a public target for practice?

No. Keep the work to systems you own or are explicitly authorised to assess. An educational intention is not an access-control mechanism and will not improve the conversation with a provider or solicitor.

What should I save from the exercise?

Keep the topology, versions, raw evidence, exact filters or rules, expected result, observed result and rollback notes. Remove real secrets and personal data before sharing the notebook.

How do I know the lab worked?

The check is complete when the scan was external and authorised, every exposed service is explained and safely configured, unnecessary ports are closed or restricted, IPv6 and UDP were considered, and a repeat scan proves the intended change. Repeat the key observation from a clean snapshot; repeatability is a stronger result than a single attractive screenshot.

Safety boundary

Use these steps only on systems you own or are explicitly authorised to assess. Preserve evidence, follow your organisation’s legal and regulatory obligations, and prefer reversible actions when the situation is not yet understood.

Primary references

  1. Nmap Reference GuideNmap Project
  2. Port Specification and Scan OrderNmap Project
  3. Service and Application Version DetectionNmap Project
  4. Zenmap GUI User’s GuideNmap Project
  5. ZAP Baseline ScanOWASP ZAP

Editorial status: first edition. Review the linked vendor documentation for product- and version-specific changes before acting.