cswork / libraryOpen practice workspace

Articles

Nmap Interview Questions: Port States, Scan Evidence, and False Assumptions

Prepare Nmap interview questions on port states, SYN and UDP scan evidence, host discovery, and misleading service labels with worked comparison cases.

An Nmap report says a port is filtered. Does that establish that the service is down? Another scan says open|filtered. Can you count it as an open service? Nmap interview questions become easier when you connect each label to the probe, the response, and the scanner's location rather than treating the label as an absolute fact about a machine.

This guide uses official Nmap documentation for scan semantics. Its packet ledgers and comparison cases are original exercises, not results of a live network scan. Start with Does a Successful Ping Mean Port 443 Is Reachable? Diagnosing Server Connectivity to practice the central skill: say exactly what an observation establishes.

What do Nmap port states actually describe?

Official behavior: Nmap recognizes six port states: open, closed, filtered, unfiltered, open|filtered, and closed|filtered. These describe how Nmap sees a port, rather than an intrinsic property independent of the scanner. Different network locations can produce different states for the same destination. Port scanning basics

Interview question: “What is the difference between a closed port and a filtered port?”

A closed result provides evidence of reachability without a listening application under the scan's interpretation. A filtered result means Nmap could not determine whether the port was open because filtering interfered with its probes. Neither label identifies a particular firewall rule or explains the application's complete health. Port scanning basics

Preparation inference: include the target address, transport protocol, port, scan type, vantage point, time, and reason when reporting a finding. “Port 8080 is broken” leaves out the facts another engineer needs to reproduce it.

For an original case, a service accepts connections from a monitoring subnet but drops probes from a developer VPN subnet. The monitoring scanner reports open; the VPN scanner reports filtered. Those observations can coexist without the application restarting. Your answer should compare the paths and source policies before choosing one report as “the truth.”

Also distinguish the endpoint being scanned from the backend you intend to diagnose. If the target address belongs to a load balancer, its listening port is the observed boundary. Backend process health requires additional evidence. An open frontend listener and a failing application request are compatible observations.

Read a SYN scan as a packet ledger

Official behavior: for a TCP SYN scan, a SYN/ACK indicates an open port and a RST indicates a closed port. No response after retransmissions, or specified ICMP unreachable errors, produces a filtered result. SYN scanning does not complete the ordinary TCP connection handshake. TCP SYN scan

Interview question: “Explain these three results without guessing the service configuration.”

The following ledger is synthetic. It illustrates response interpretation, not a capture from a real server.

ProbeObserved responseNmap interpretationClaim you should avoid
TCP SYN to port 8080SYN/ACK from the endpointopenThe application is healthy or correctly authenticated
TCP SYN to port 8081RSTclosedThe whole host is unreachable
TCP SYN to port 8082No response after the scan's retriesfilteredA specific firewall rule is certainly responsible

Explain the missing evidence for each row. Port 8080 needs an application-level check if the question is about a failing request. Port 8081 needs listener and address-binding evidence if it was expected to serve traffic. Port 8082 needs a path investigation that distinguishes where probes or responses disappear.

Official behavior: raw-packet privileges affect available scan methods; Nmap substitutes a TCP connect scan when the default SYN scan is unavailable. A connect scan uses the operating system's connection API and can complete connections to open ports. Port scanning techniques

This matters when two candidates say they used “the default scan” on different machines. Ask for the actual command, privileges, platform, and reported scan method. An explicit scan type makes a comparison more reproducible. Do not assume that an unprivileged laptop produced the same packet exchange as a privileged scanner.

For a report, separate what the tool classified from what you independently confirmed. A reason field is useful evidence, but it is not a substitute for knowing which scan produced that reason.

Why does UDP produce open|filtered?

Official behavior: a UDP response establishes open; an ICMP port-unreachable response establishes closed; no response after retransmissions is classified as open|filtered. Certain other ICMP unreachable responses indicate filtering. Some UDP applications do not respond to an unsuitable probe. UDP scan

Interview question: “All selected UDP ports are open|filtered. Are they all listening?”

No. The result preserves ambiguity. For an original lab exercise, imagine three ports with the same silent outcome: one application ignores an invalid payload, one firewall drops the request, and one return path drops the response. Your scanner cannot distinguish these solely from silence.

A useful next observation is a protocol-appropriate request against the specific service you expect, within the lab's scope. If you can inspect the server, correlate the request with listener configuration and a packet capture. If you cannot inspect it, say which uncertainty remains.

Official behavior: version detection can send additional service probes and change an ambiguous UDP result to open when a response is obtained. It does not guarantee a response from every open service. Service and version detection

Suppose your exercise service requires an application-specific token before returning data. A generic probe receiving no response does not prove that the listener is absent. Conversely, knowing that a process exists locally does not prove that its response can reach your scanner.

UDP scans can also be slow because they wait for silent outcomes and because ICMP error responses may be rate limited. UDP scan Explain whether the interview task values coverage, response certainty, or elapsed time before proposing a larger scan. For this exercise, a small known port set provides a better controlled comparison than changing many scan parameters at once.

Does unfiltered mean open?

Official behavior: an ACK scan can classify a port as unfiltered after receiving a RST. Both open and closed ports can produce that response, so the ACK scan does not determine whether an application is listening. TCP ACK scan

Interview question: “An ACK scan says unfiltered, but a SYN scan says filtered. Is Nmap contradicting itself?”

It may be observing different treatment of different packets. The official ACK documentation warns that combining scan types assumes consistency that firewall and TCP-stack behavior may violate. TCP ACK scan

In an original case, the path permits the ACK probe's reset response but drops a new connection's SYN. The ACK result supports a limited statement about that probe's reachability; it does not demonstrate that a new TCP connection succeeds.

Keep the unfiltered label, explain the scan method, and choose a connection-oriented observation when listener reachability is the actual question. Preserve uncertainty until your next test resolves it.

Diagnose a disagreement between two scan locations

Use this original evidence table. Both observations concern the same lab endpoint, port, and time window, and both use a SYN scan.

EvidenceMonitoring subnetDeveloper VPN subnet
DestinationLab endpoint, TCP 8080Same endpoint, TCP 8080
Scanner observationSYN/ACK receivedNo response after retries
Classificationopenfiltered
Initial interpretationListener reachable from this sourceOpen/closed status unresolved from this source
Next correlated evidenceSuccessful application requestCapture at the endpoint and relevant gateway

Suppose the endpoint capture shows the monitoring SYN and its reply but never sees the VPN SYN. Your investigation moves toward the path before the endpoint; it does not immediately identify which upstream device dropped the packet. If the endpoint sees the VPN SYN and sends a SYN/ACK that never arrives at the scanner, investigate the return path instead.

If the endpoint receives the SYN but produces no response, compare host policy and stack behavior with the capture. Before blaming a firewall, confirm that the capture interface and filters cover the traffic you intended to observe. Missing capture data is not automatically evidence of a missing packet.

Preparation inference: change one variable at a time. Keep the destination and scan method fixed while comparing source locations. If you simultaneously change the source, target hostname, address family, port set, and timing, the second result cannot isolate the cause of the first.

Choose commands that answer the actual question

Official behavior: -Pn skips host discovery and attempts the requested scan against specified targets. It does not force ports open. On a local Ethernet network, ARP may still occur because Nmap needs destination MAC addresses. -sn performs discovery without a subsequent port scan. Host discovery

Interview question: “Nmap says the host seems down, but I know a service is available. What changes?”

Explain whether discovery probes failed before the requested port check occurred. For a controlled exercise on your own machine, the following command explicitly requests a TCP connect scan of one loopback port:

nmap -sT -Pn -p 8080 --reason -oX loopback-8080.xml 127.0.0.1

This is an illustrative command, not a scan executed for this article. It examines the loopback endpoint, so it cannot reproduce the VPN-to-server path in the preceding case.

Official behavior: -p sets the requested ports; Nmap's default port selection is not an exhaustive scan of every possible port. Port specification State the selected set before claiming a missing service.

Official behavior: --reason displays reasons for host and port classifications, while XML output supports programmatic analysis. The available detail depends on the scan method. Nmap output

Retain the command, timestamp, source context, tool version, and output together. If the application was expected on port 8443 but your command checked only 8080, “no open application port” is an unsupported conclusion. Likewise, a TCP result says nothing by itself about UDP on the same number.

A service name is not a verified application identity

Official behavior: Nmap can label services from its port-name database. Version detection interrogates ports with service probes to learn more about the actual protocol or application. Services can run on unexpected ports, and not every probe reveals all details. Service and version detection

Interview question: “The SERVICE column says http. Does that prove the endpoint serves our HTTP API?”

Distinguish a conventional port-based label from a probe-supported identification. Then distinguish either identification from product correctness. An HTTP server can return an error, reject credentials, route to a different backend, or serve a different application than expected.

For an original exercise, port 8080 accepts TCP and returns an HTTP response, but the expected health path returns 404. The scan's open classification is useful; it does not settle routing or deployment configuration. Your next test should use the intended request path and expected response contract.

Avoid converting a reported version string directly into a confirmed vulnerability. Explain what additional configuration and verification the actual question requires. An interview answer should preserve the chain from observation to conclusion instead of skipping its uncertain steps.

Sources and Further Reading