(Ubuntu 14.04.4 LTS)traceroute has -m, --max-hop=NUM, as does tracepath.How can I limit the max number of hops when using:  nmap -Pn -sn --traceroute  ?
Nmap traceroute max TTL
ubuntu;nmap
Nmap uses a different algorithm for tracing than traceroute(1), so the idea of a hop limit does not make sense.Traditional traceroute uses UDP packets to high-numbered ports and starts with a TTL of 1 to discover the very next hop on the path to the target. Then it increments to 2 to discover the second hop and so forth. If at some point on the path to the target there is a hop that refuses to pass along the UDP traffic (a firewall, for instance), then traceroute will start to show unknown lines like this:10  * * *11  * * *12  * * *13  * * *And it will continue to show these until it reaches the maximum number (IP TTL field is limited to 255, most traceroute implementations will set a lower limit for practicality, like 30).Nmap traceroute works a bit differently. It starts with a couple of key advantages:It requires you to have privileges to sniff network traffic and send on raw sockets, and It knows what probes will reach the target as a result of the host discovery and port scan phases of execution.Armed with this info, Nmap guesses the distance to the target. If you performed OS detection and got an ICMP response to a UDP probe, then it can calculate the exact distance. Otherwise, it starts at 10, or whatever distance the last target was at. It then begins to send probes, decrementing the initial TTL each time until all closer hops are accounted for (sometimes this means stopping once an already-found hop is found again, to not duplicate results.) If the target itself hasn't responded to any of these probes, Nmap will next start at TTL 10 and count up, replicating the traditional traceroute algorithm. The key difference here is that the probes that are sent are guaranteed to get a response from the target, since they've been chosen for that purpose. So we'll never overshoot the target or pick a probe that an intermediate hop will drop.The algorithm is described fully in the initial comment block of the traceroute.cc file in the Nmap source.