skip to content

What do Nmap's -f and --mtu options send, and what does a defender's firewall or sensor see and do about those tiny IP fragments?

level: seniorimportance: nice to knowfreq 8%

answer

  1. IP fragments, not a new scan type
  2. offsets come in units of eight bytes
  3. only raw-packet features can do it
  4. a reassembling device sees whole packets
  5. no fragments does not mean no scan

basics

~20 s

-f splits probes into IP fragments of eight bytes or less after the IP header; --mtu sets a multiple of eight. A defender sees bursts of tiny fragments from one source; a firewall or sensor that reassembles them inspects whole packets.

solid answer

~40 s

`-f` makes Nmap's raw probes use tiny IP fragments: one `-f` gives eight bytes or less per fragment after the IP header, so a 20-byte TCP header becomes three packets; a second `-f` uses 16 bytes. `--mtu` sets your own size, which must be a multiple of eight, and is not combined with `-f`. It works only for raw-packet features, meaning TCP and UDP port scans other than connect scan, and OS detection. A defender sees a run of small fragments from one source; reassembling or normalising them at the perimeter, at a cost in memory and processing, lets inspection see whole packets.

go deeper

for a junior

Recall that -f and --mtu split probes into small IP fragments and only work with raw-packet features.

for a middle

Explain the eight-byte unit, that --mtu must be a multiple of eight, which features cannot fragment, and what split headers look like in a log.

for a senior

Choose the defender's response: reassembly or normalisation where affordable, fragment counting elsewhere, and a clear statement of what missing fragments do not prove.

for a principal

Weigh the cost of reassembly and path asymmetry across the estate against the value of inspecting whole packets, and set where each control sits.

## What the options do `-f` (fragment packets) and `--mtu` ask Nmap to send the requested scan, including host discovery, as **small IP fragments** rather than whole packets. - `-f` once: the data after the IP header is split into pieces of **eight bytes or less**. A 20-byte TCP header therefore travels in three packets, two with eight bytes and one with four, each with its own IP header. - `-f` twice: **16 bytes** per fragment, which reduces the number of fragments. - `--mtu size`: your own size. It must be a **multiple of eight**, and the reference guide says not to combine it with `-f`. These are modifiers of the probe, not a scan type. They apply to Nmap's raw-packet features: TCP and UDP port scans, except the connect scan and FTP bounce scan, and OS detection. Version detection and the scripting engine generally do not fragment, because they use the host's own TCP stack to talk to the service. ## What the receiving side sees 1. **A stream of small fragments** with the more-fragments flag set and offsets in units of eight bytes, from one source address. 2. **A split TCP header.** In the first fragment of a 20-byte header sit only the first eight bytes, which hold the ports and sequence number; the flags field arrives in a later fragment. A device that judges each fragment alone cannot see a SYN or a reset in the first one. 3. **The same pattern as any scan**: many distinct ports or hosts, mostly refused. Fragmentation changes the packaging, not what is being asked. 4. **Unusual size.** Ordinary TCP is normally sized to fit the path, so a flood of eight-byte fragments stands out in a fragment counter. ## What the defender does - **Reassemble or normalise at the perimeter** firewall or sensor so that inspection and logging operate on whole packets. The reference guide notes that a device which queues all IP fragments sees the whole packet. - **Count fragments** by source, and alert on a high rate of tiny ones. - **Accept the cost.** Reassembly needs memory and processing, and the guide observes that some networks cannot afford the performance hit while others cannot enable it because fragments take different routes into them. - **Do not generalise from one device.** How a particular sensor resolves overlapping or inconsistent fragments is a separate subject from recognising a scan's packaging. ## A worked reading A perimeter firewall's counters show 203.0.113.9 sending several hundred IP fragments a minute to 192.0.2.40, none larger than 24 bytes of data, and, once reassembled, each probe aimed at a different destination port. A capture taken with the packets reassembled shows ordinary SYN probes. The analyst's job is to say what was seen (a port sweep sent as small fragments), what the reassembly policy did with it (the whole probes were inspected and refused), and whether the source belongs to an agreed assessment. ## What an absence does not prove The reference guide warns that some source systems defragment outgoing packets in the kernel, so `-f` may not produce fragments on the wire at all, and the connect scan never fragments. A log with no fragments says nothing about whether a scan took place. Equally, a fragment alert says an unusual packaging was observed, not whose tool or what permission stands behind it; compare the source and times with the assessment plan. ## Operational summary For a reviewer: treat fragmentation as a property of the traffic to be normalised and counted, not as a separate threat to be argued about. For an assessor with a signed scope: using it needs the plan to say so, because it changes what the target's defences see.

  • Which Nmap features cannot be fragmented with -f, and why?
    The TCP connect scan and FTP bounce scan, version detection and the scripting engine generally cannot, because they rely on the host's own TCP stack rather than Nmap's raw-packet engine. Fragmentation covers TCP and UDP port scans that use raw packets, and OS detection.
  • Why not simply reassemble every fragment at every border?
    It costs memory and processing, and some networks cannot afford that. Others cannot enable it because fragments of one packet may take different routes into the network. So the defender chooses where reassembly is affordable and monitors fragment counts elsewhere.

  • -f is a separate scan type like -sS
  • -f also fragments version detection and scripts
  • --mtu accepts any size, such as 20 or 36
  • No fragments in the log proves no scan happened
  • Fragmentation makes a scan invisible to every sensor