Nmap path-mtu NSE Script


This page contains detailed information about how to use the path-mtu NSE script. For list of all NSE scripts, visit the Nmap NSE Library.

Select:
Overview
Error Messages

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/path-mtu.nse
Script categories: safe, discovery
Target service / protocol: -
Target network port(s): -
List of CVEs: -

Script Description


The path-mtu.nse script performs simple Path MTU Discovery to target hosts.

TCP or UDP packets are sent to the host with the DF (don't fragment) bit set and with varying amounts of data. If an ICMP Fragmentation Needed is received, or no reply is received after retransmissions, the amount of data is lowered and another packet is sent. This continues until (assuming no errors occur) a reply from the final host is received, indicating the packet reached the host without being fragmented.

Not all MTUs are attempted so as to not expend too much time or network resources. Currently the relatively short list of MTUs to try contains the plateau values from Table 7-1 in RFC 1191, "Path MTU Discovery". Using these values significantly cuts down the MTU search space. On top of that, this list is rarely traversed in whole because:

  • the MTU of the outgoing interface is used as a starting point, and
  • we can jump down the list when an intermediate router sending a "can't fragment" message includes its next hop MTU (as described in RFC 1191 and required by RFC 1812)

Path-mtu NSE Script Arguments


The path-mtu.nse script does not have any arguments.

Path-mtu NSE Script Example Usage


Here's an example of how to use the path-mtu.nse script:

nmap --script path-mtu target

Path-mtu NSE Script Example Output


Here's a sample output from the path-mtu.nse script:

Host script results:
|_path-mtu: 1492 <= PMTU < 1500

Host script results:
|_path-mtu: PMTU == 1006

Path-mtu NSE Script Example XML Output


There is no sample XML output for this module. However, by providing the -oX <file> option, Nmap will produce a XML output and save it in the file.xml file.

Author


  • Kris Katterjohn

References


See Also


Visit Nmap NSE Library for more scripts.

The path-mtu.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.

Error: Unable to determine PMTU (no replies)


Here is a relevant code snippet related to the "Error: Unable to determine PMTU (no replies)" error message:

382:	  pcap:close()
383:	  sock:ip_close()
384:	
385:	  if not gotit then
386:	    if nmap.debugging() > 0 then
387:	      return "Error: Unable to determine PMTU (no replies)"
388:	    end
389:	    return
390:	  end
391:	
392:	  if MTUS[m] == mtuset then

Version


This page has been created based on Nmap version 7.92.

Go back to menu.