In Nmap 7.991 with no host discovery option given, which probes does Nmap send to each target, and when do they differ?
answer
- Four probes, two protocols
- Equal to -PE -PS443 -PA80 -PP
- Local Ethernet gets something else
- Privilege changes what is sent
- IPv6 loses one of the four
basics
~20 sA privileged run against a routed IPv4 target sends an ICMP echo request, a TCP SYN to 443, a TCP ACK to 80 and an ICMP timestamp request. Local Ethernet targets use ARP; an unprivileged user sends connect() SYNs to 80 and 443.
solid answer
~40 sThe defaults equal `-PE -PS443 -PA80 -PP`: an ICMP echo request, a TCP SYN to 443, a TCP ACK to 80 and an ICMP timestamp request. They change in three situations. Targets on the local Ethernet segment are found with ARP (IPv4) or Neighbor Discovery (IPv6) instead. IPv6 targets get no timestamp request, because ICMPv6 has none. An unprivileged Unix user cannot send raw packets, so Nmap uses the `connect` system call: a SYN to ports 80 and 443 only. Naming a probe-type option such as `-PS22` replaces the defaults. The set is deliberately varied so that a host filtering one probe type can still be found by another.
go deeper
Recall the four default probes and that they mix ICMP and TCP so one filtered type does not hide a host.
Give the probe set with its ports, then the three variations: local segment, IPv6 and an unprivileged user. Connect each to its option equivalent.
Say how you would audit a scheduled sweep: the account's privilege, the probe set actually used, and --reason output from known-live hosts.
Decide whether the organisation standardises one probe set for every quarterly inventory so results are comparable over time, and who owns changing it.
## The default probe set When no host discovery option is given, Nmap 7.991 does not rely on one probe. For a privileged user and a routed IPv4 target it sends four, which the reference guide says are equal to `-PE -PS443 -PA80 -PP`: | Probe | Equivalent option | What a live host returns | |---|---|---| | ICMP echo request | `-PE` | an echo reply | | TCP SYN to port 443 | `-PS443` | a SYN/ACK (port open) or a reset (port closed) | | TCP ACK to port 80 | `-PA80` | a reset | | ICMP timestamp request | `-PP` | a timestamp reply | Any one answer is enough to mark the host up, which is why the set mixes protocols. Many hosts and firewalls drop ICMP echo, so the reference guide calls ICMP-only scans rarely reliable against unknown targets. A stateless filter that blocks incoming SYNs to closed ports may still let an ACK through, while a stateful one drops the unexpected ACK but may answer a SYN. Sending both covers each case. ## When the set changes - **Local Ethernet segment.** Targets on the same segment are found with ARP for IPv4 and Neighbor Discovery for IPv6. This runs even when you name other probe options, because it is almost always faster and more effective; `--disable-arp-ping` turns it off. - **IPv6.** The timestamp request is left out because it is not part of ICMPv6. - **Unprivileged Unix user.** No raw packets, so Nmap calls `connect` against ports 80 and 443, which sends a SYN. A quick success or a refusal tells it the host is up; a hang until timeout marks it down. If you also ask for ICMP probe types, Nmap prints a warning and substitutes TCP probes. - **Explicit probe options.** `-PS`, `-PA`, `-PU`, `-PE`, `-PP`, `-PM` and the others replace the defaults, so a short custom list can find fewer hosts than the default set. ## The two TCP probes in detail The SYN probe to 443 does not try to open a connection. A live host answers with a SYN/ACK if the port is open or a reset if it is closed, and either answer marks it up; the machine running Nmap then tears the half-open exchange down, with the reset sent by its own kernel rather than by Nmap. The ACK probe to 80 claims to acknowledge data on a connection that does not exist, so a host should answer with a reset, and that reset discloses it. For an unprivileged user both reduce to the same thing: the ACK port list is folded into the SYN list, so the `connect` calls go to 80 and 443 whichever probe type was named. ## Why it matters for an inventory 1. Know which set your run actually used, because the same range can read differently under a different set. 2. Check the privilege of the account running the sweep: an unprivileged scheduled job quietly sends a different, narrower probe set. 3. Read `--reason` to see which probe type your network answered. 4. Remember the set is chosen for speed and breadth, not completeness: a host that drops all four probes reads as down. To see exactly what a run sends, point it at one lab host you own with `--packet-trace`, which prints every packet sent and received. Nothing in the default set is a port scan. A TCP SYN to 443 is a discovery probe, and a reset from a closed 443 is as good as a SYN/ACK from an open one. ## What a defender sees Each address in the range receives up to four packets from one source in a short time: an echo request, a SYN to 443, an ACK to 80 and a timestamp request. The set is easy to recognise and says only that a discovery sweep ran, not who ran it or whether it was authorised.
- An unprivileged account runs the sweep with -PE added; what is actually sent?On Unix, Nmap prints a warning that you are not root and substitutes TCP probes for the ICMP ones, so the ICMP types are never sent. A host that only answers ICMP is then missed, and the inventory silently has gaps unless someone reads the warning.
- On a local segment you add -PS22; does ARP discovery still run?Yes. ARP or Neighbor Discovery is done by default for local Ethernet targets even when other probe options are named. Use `--disable-arp-ping` on a network with proxy ARP, where a router answers for every address and makes every target look up.
- Default discovery is just an ICMP echo, like ping
- The default SYN probe goes to 80 and the ACK probe to 443
- An unprivileged user sends the same probes as root
- ARP only runs if you request it with a -P option
- IPv6 targets get exactly the same four probes
Assumes Nmap 7.991 and its reference guide; the default probe set, its ports and the unprivileged and IPv6 variants are the documented 7.991 behaviour.