diff --git a/CHANGELOG b/CHANGELOG index 5997d4b5a..6d4b292cd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,11 @@ # Nmap Changelog ($Id$); -*-text-*- +o Changed the ICMP ping probes to use a random non-zero ICMP id. Some hosts + seem to drop probes when ICMP id is 0 [Josh Marlow] + +o Changed the default UDP ping port to 40125. This appears to be a + better port based on tests done by David [Josh Marlow] + o [Ncat] Handling of newlines on Windows has been improved. CRLF is automatically converted to bare LF when input is from the console, but not when it is from a pipe or a file. No newline translation is done diff --git a/docs/refguide.xml b/docs/refguide.xml index 0c02ffc35..83a14faa6 100644 --- a/docs/refguide.xml +++ b/docs/refguide.xml @@ -611,7 +611,7 @@ you would expect. specified) UDP packet to the given ports. The port list takes the same format as with the previously discussed and options. If - no ports are specified, the default is 31338. This default + no ports are specified, the default is 40125. This default can be configured at compile-time by changing DEFAULT_UDP_PROBE_PORT_SPECDEFAULT_UDP_PROBE_PORT_SPEC in nmap.h.nmap.h @@ -627,7 +627,7 @@ you would expect. a down or unreachable host. A lack of response is also interpreted this way. If an open port is reached, most services simply ignore the empty packet and fail to return - any response. This is why the default probe port is 31338, + any response. This is why the default probe port is 40125, which is highly unlikely to be in use. A few services, such as the Character Generator (chargen) protocol, will respond to an empty UDP packet, and thus disclose to Nmap that the machine is available. diff --git a/nmap.h b/nmap.h index 0ecc2ddf3..369980e9c 100644 --- a/nmap.h +++ b/nmap.h @@ -274,7 +274,7 @@ void *realloc(); #define DEFAULT_TCP_PROBE_PORT_SPEC "80" /* The ports TCP ping probes go to if unspecified by user -- uber hackers change this to 113 */ -#define DEFAULT_UDP_PROBE_PORT_SPEC "31338" /* The port UDP ping probes go to +#define DEFAULT_UDP_PROBE_PORT_SPEC "40125" /* The port UDP ping probes go to if unspecified by user */ #define DEFAULT_SCTP_PROBE_PORT_SPEC "80" /* The port SCTP probes go to if unspecified by diff --git a/scan_engine.cc b/scan_engine.cc index cd8c75470..91b8b4e3b 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -3155,10 +3155,17 @@ static UltraProbe *sendIPScanProbe(UltraScanInfo *USI, HostScanStats *hss, &packetlen); break; case IPPROTO_ICMP: + u16 icmp_ident; + + /* Some hosts do not respond to ICMP requests if the identifier is 0. */ + do { + icmp_ident = get_random_u16(); + } while (icmp_ident == 0); + packet = build_icmp_raw(&o.decoys[decoy], hss->target->v4hostip(), o.ttl, ipid, IP_TOS_DEFAULT, false, o.ipoptions, o.ipoptionslen, - 0, 0, 8, 0, + 0, icmp_ident, 8, 0, o.extra_payload, o.extra_payload_length, &packetlen); break;