1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 22:21:29 +00:00

Make a slight change to the order in which ping probes are sent to match

research. -PY should come after, not before -PU. -PM should be the last
one.
This commit is contained in:
david
2010-03-05 19:45:58 +00:00
parent 45cb43151c
commit 9fee7968f9

View File

@@ -2038,22 +2038,9 @@ static int get_next_target_probe(UltraScanInfo *USI, HostScanStats *hss,
return 0;
}
}
if (USI->ptech.rawsctpscan && hss->next_sctpportpingidx < USI->ports->sctp_ping_count) {
pspec->type = PS_SCTP;
pspec->proto = IPPROTO_SCTP;
pspec->pd.sctp.dport = USI->ports->sctp_ping_ports[hss->next_sctpportpingidx++];
pspec->pd.sctp.chunktype = SCTP_INIT;
return 0;
}
if (USI->ptech.rawicmpscan) {
pspec->type = PS_ICMP;
pspec->proto = IPPROTO_ICMP;
if ((o.pingtype & PINGTYPE_ICMP_MASK) && !hss->sent_icmp_mask) {
hss->sent_icmp_mask = true;
pspec->pd.icmp.type = ICMP_MASK;
pspec->pd.icmp.code = 0;
return 0;
}
if ((o.pingtype & PINGTYPE_ICMP_TS) && !hss->sent_icmp_ts) {
hss->sent_icmp_ts = true;
pspec->pd.icmp.type = ICMP_TSTAMP;
@@ -2067,6 +2054,13 @@ static int get_next_target_probe(UltraScanInfo *USI, HostScanStats *hss,
pspec->pd.udp.dport = USI->ports->udp_ping_ports[hss->next_udpportpingidx++];
return 0;
}
if (USI->ptech.rawsctpscan && hss->next_sctpportpingidx < USI->ports->sctp_ping_count) {
pspec->type = PS_SCTP;
pspec->proto = IPPROTO_SCTP;
pspec->pd.sctp.dport = USI->ports->sctp_ping_ports[hss->next_sctpportpingidx++];
pspec->pd.sctp.chunktype = SCTP_INIT;
return 0;
}
if (USI->ptech.rawprotoscan) {
pspec->type = PS_PROTO;
pspec->proto = USI->ports->proto_ping_ports[hss->next_protoportpingidx++];
@@ -2079,6 +2073,16 @@ static int get_next_target_probe(UltraScanInfo *USI, HostScanStats *hss,
pspec->pd.tcp.flags = TH_SYN;
return 0;
}
if (USI->ptech.rawicmpscan) {
pspec->type = PS_ICMP;
pspec->proto = IPPROTO_ICMP;
if ((o.pingtype & PINGTYPE_ICMP_MASK) && !hss->sent_icmp_mask) {
hss->sent_icmp_mask = true;
pspec->pd.icmp.type = ICMP_MASK;
pspec->pd.icmp.code = 0;
return 0;
}
}
}
assert(0); /* TODO: need to handle other protocols */
return -1;