skip to content

What does an authorised Nmap ACK scan (-sA) of a firewalled test server map when it reports ports unfiltered and filtered, and why can it never report open?

level: seniorimportance: should knowfreq 20%

answer

  1. asks about the rule set, not the service
  2. one flag in the probe
  3. open and closed both reset
  4. stateful or stateless filtering
  5. a window field twist

basics

~20 s

An ACK scan sends bare ACK segments. A reset, from open and closed ports alike, means unfiltered; silence or an ICMP unreachable error means filtered. It maps what the rule set lets through, never which ports are open.

solid answer

~30 s

The probe carries only the ACK flag, so a host with no filter in the way answers with a RST whether the port is open or closed, and Nmap labels it `unfiltered`. Silence or an ICMP unreachable error is `filtered`. Because open and closed look the same, the scan never reports `open`; its job is to map which ports a rule set passes ACK-flagged segments to and whether it behaves statefully. A stateful firewall typically drops an ACK with no tracked connection, while a stateless filter that allows ACKs passes it. Follow up with a scan that can name open ports.

go deeper

for a junior

Recall that an ACK scan sends one flag and reads a reset as unfiltered, so it cannot tell open from closed.

for a middle

Explain why both open and closed ports reset, why filtered means silence or an ICMP error, and why the scan never reports open.

for a senior

Use an ACK scan against a SYN scan to hypothesise stateful versus stateless filtering, then verify against the firewall configuration instead of reporting the guess.

for a principal

Set what a rule-set test must prove: separate the rule being tested from the services behind it, and keep scan evidence subordinate to the owner's configuration.

## What the ACK scan asks The other scan types in this area ask "is something listening on this port?". The **ACK scan** (`-sA`) asks a different question: "does anything between me and this host drop a packet that carries only an ACK flag?". The probe has just the ACK flag set. On a path that does not filter, a host answers an unexpected ACK with a RST whether the port is open or closed, because a segment that belongs to no connection draws a reset either way. ## Reading the answers | Reply to the bare ACK | State | Meaning | |---|---|---| | A RST segment | `unfiltered` | The probe reached the host; open versus closed is not determined | | Nothing | `filtered` | Something dropped the probe or its reply | | ICMP unreachable (type 3, code 0, 1, 2, 3, 9, 10 or 13) | `filtered` | A device refused to forward the probe | An ACK scan **never reports `open`**, and never `open|filtered`. `unfiltered` is a state only this scan produces. To learn whether an unfiltered port is actually open, follow up with a scan that can say so, such as the SYN scan. ## What the scan maps The reference guide's purpose for the scan is to map out a firewall rule set: which ports are filtered and whether the filtering is stateful. The reasoning is an inference, and worth stating as one: 1. A **stateful** firewall tracks connections and typically drops an ACK that belongs to no tracked connection, so the ports it protects read `filtered`. 2. A **stateless** filter that allows ACK-flagged segments through, for example a rule written to permit replies, passes the probe and the host answers with a reset, so the port reads `unfiltered`. 3. Comparing the ACK scan with a SYN scan of the same ports sharpens the picture: a port that reads `filtered` to the SYN scan and `unfiltered` to the ACK scan points to a filter that matches on flags rather than on connection state. Treat each of these as a hypothesis to confirm against the firewall's own configuration, which the owner can provide. The reference guide also reminds readers that all of Nmap's insights come from packets returned by the target or the firewall in front of it, and that those can be unhelpful or untrustworthy. ## The window scan variant The **window scan** (`-sW`) is the ACK scan plus a reading of the returned reset's TCP window field. On some systems an open port's reset has a positive window and a closed port's has a zero window, so Nmap reports `open` or `closed` instead of always `unfiltered`. The reference guide warns that this depends on an implementation detail of a minority of systems: systems that do not behave this way usually return every port as `closed`, and a few show the exact opposite. A scan showing 1,000 open ports and three closed ones may mean the three are the truly open ones. ## What the defender sees A stateful firewall that drops an unsolicited ACK usually records it as an invalid or no-state packet. Many such drops from one source across many ports, with no SYNs, are what an ACK scan against a stateful rule set looks like in the logs. The probe is also a legitimate way for the firewall's owner to test their own rule set from outside. ## Using it in an assessment Run it from the position whose filtering you want to measure, with the signed scope covering the target range, and write down what was learned as a statement about rules ("ACK-flagged segments to ports X are dropped") and not about services ("port X is open").

  • How does the window scan differ from the ACK scan, and how far can it be trusted?
    It sends the same ACK probe but reads the window field of the returned reset: positive means `open`, zero means `closed`, on systems that behave that way. That is an implementation detail of a minority of stacks, so systems that do not support it return all ports `closed`, and some show the reverse. Confirm with another technique.
  • An ACK scan reads every port unfiltered and a SYN scan shows most ports filtered; what do you infer?
    The path passes ACK-flagged segments to the host but drops SYNs, which is consistent with a filter that matches on flags rather than tracking connection state. It is a hypothesis: confirm it against the firewall rule set with the owner before reporting it as stateless.
  • What does a stateful firewall's log show for an ACK scan against it?
    Many dropped or invalid-state entries from one source across many destination ports, with no SYNs preceding them, because each ACK belongs to no tracked connection. The same pattern from an unknown source is worth a look; from the assessor's address inside the signed window it is the expected result.

An ACK scan is like sending a delivery receipt to every desk in a building to see what the mailroom lets through. A bounce means the envelope reached the building; silence means the mailroom discarded it. A bounce never says whether the person is at the desk.

  • An unfiltered port in an ACK scan is an open port
  • The ACK scan is the quickest way to list open ports
  • Filtered in an ACK scan means the port is closed
  • An ACK scan can report open|filtered ports
  • A stateful firewall always answers an ACK probe with a reset