Why do Nmap's FIN, NULL and Xmas scans (-sF, -sN, -sX) report a Linux host mostly open|filtered but a Windows host all closed?
answer
- silence carries meaning here
- a rule on page 65 of RFC 793
- flags that are not SYN, RST or ACK
- some stacks reset regardless
- silence cannot split open from filtered
basics
~20 sNULL, FIN and Xmas probes carry no SYN, RST or ACK bit. An RFC 793-compliant stack resets them on closed ports and drops them on open ones: reset means closed, silence means open|filtered. Stacks that always reset make every port look closed.
solid answer
~30 sThese probes carry none of the SYN, RST or ACK bits: NULL sets no flags, FIN sets FIN, Xmas sets FIN, PSH and URG. RFC 793 says a closed port answers with a RST and an open port silently drops them, so a RST reads `closed` and silence reads `open|filtered`, because a filter also produces silence. The Linux host follows the RFC. Windows, many Cisco devices, BSDI and IBM OS/400 send a RST regardless, so every port reads `closed`. The result is the stack's behaviour, not a port inventory, and an IDS can be configured to flag these probes.
go deeper
Recall the flags: NULL sets none, FIN sets FIN, Xmas sets FIN, PSH and URG, and a reset means closed.
Explain the RFC 793 rule that produces the reset or the silence, why silence is open|filtered, and which stacks answer with a reset regardless.
Treat an all-closed result as a stack finding, confirm with a SYN scan, and know that stateful firewalls and IDS see these odd-flag segments.
Decide whether the scan type belongs in a standard audit at all, given the stack dependence and the ambiguity it leaves in an inventory.
## One loophole, three probes Nmap's NULL, FIN and Xmas scans (`-sN`, `-sF`, `-sX`) use a rule in the TCP specification. RFC 793 says that a segment without a RST sent to a **closed** port causes a RST in response. For a segment that reaches an **open** port without the SYN, RST or ACK bits set, the same document says to drop it and return. A compliant stack therefore answers a probe carrying none of those three bits with a reset if the port is closed and with nothing if it is open. The three scans behave identically; only the flags in the probe differ. | Scan | Option | Flags set in the probe | |---|---|---| | NULL | `-sN` | none (flags field is 0) | | FIN | `-sF` | FIN only | | Xmas | `-sX` | FIN, PSH and URG | ## Reading the answers - A RST means `closed`. - No response means `open|filtered`: an open port is silent, but so is a filter that dropped the probe. - An ICMP unreachable error (type 3, code 0, 1, 2, 3, 9, 10 or 13) means `filtered`. Notice what is missing. These scans **never report `open`** on their own: silence is all an open port gives, and silence is ambiguous. That is the stated downside, alongside the other one below. ## Where the inference breaks The whole reading depends on the target following the RFC text. The reference guide lists the common exceptions: Microsoft Windows, many Cisco devices, BSDI and IBM OS/400 send a RST to these probes whether or not the port is open, so every port is labelled `closed`. The technique works against most Unix-based systems. A report from a FIN scan that shows every port closed on a host known to run services is therefore a finding about the stack, not about the ports. The **Maimon scan** (`-sM`) is a close relative: its probe is FIN/ACK, which RFC 793 says should be answered with a RST open or closed, but many BSD-derived systems drop it when the port is open. It is read the same way and is just as dependent on the stack. ## What the defender sees Each probe is a TCP segment that belongs to no connection and carries an unusual flag pattern: no flags at all, a lone FIN, or FIN with PSH and URG. Practical consequences: 1. A stateful firewall tracks connections and typically treats such segments as invalid. They show up as denied or invalid-state entries from one source across many ports. 2. The reference guide says most modern IDS products can be configured to detect these scans, so an assessor must not assume they go unseen. 3. Reading logs, many invalid segments from one source with a spread of destination ports is the pattern to look for. What signature expresses it belongs to the network-defence owners. ## How an auditor uses the result The honest uses are small. These scans can show how a particular stack handles segments outside a connection, and they flag which hosts do not follow RFC 793. They are a poor first choice for an inventory because of the ambiguity and the stack dependence; a SYN scan answers `open`, `closed` and `filtered` directly. A report line should read "open|filtered per the FIN scan, to be confirmed with a SYN scan" and should never say "open".
- Why can a FIN scan never report a port as open on its own?On a compliant stack an open port gives no answer to these probes, and silence is also what a packet filter produces by dropping the probe. Nmap cannot separate the two, so it reports `open|filtered`. To resolve a port, run a technique whose open answer is positive, such as a SYN scan or version detection.
- How does the Maimon scan differ from the FIN scan, and is it more reliable?Its probe is FIN/ACK. RFC 793 says that should draw a RST whether the port is open or closed, but many BSD-derived systems drop it when the port is open, which is what the scan reads. It depends on that stack behaviour just as the others depend on RFC compliance, so it is no more reliable.
- A FIN scan reports open ports directly
- All ports closed on a FIN scan proves nothing is listening
- NULL, FIN and Xmas scans work equally on every operating system
- These scans cannot be seen because they never open a connection
- A silent port in a FIN scan is closed