1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 20:09:02 +00:00

Changed the default port for UDP probing. Also changed the ICMP id in ICMP

pinging to be a nonzero number.
This commit is contained in:
josh
2009-06-05 03:29:10 +00:00
parent d011afb07c
commit 881fc1777f
4 changed files with 17 additions and 4 deletions

View File

@@ -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

View File

@@ -611,7 +611,7 @@ you would expect.</para>
specified) UDP packet to the given ports. The port list
takes the same format as with the previously discussed
<option>-PS</option> and <option>-PA</option> 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
<varname>DEFAULT_UDP_PROBE_PORT_SPEC</varname><indexterm><primary><varname>DEFAULT_UDP_PROBE_PORT_SPEC</varname></primary></indexterm>
in <filename>nmap.h</filename>.<indexterm><primary><filename>nmap.h</filename></primary></indexterm>
@@ -627,7 +627,7 @@ you would expect.</para>
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.</para>

2
nmap.h
View File

@@ -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

View File

@@ -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;