mirror of
https://github.com/nmap/nmap.git
synced 2026-10-22 11:51:52 +00:00
Fix traceroute with -sO
This commit is contained in:
parent
cd74c02e2f
commit
4f83a3bdad
1 changed files with 6 additions and 2 deletions
|
|
@ -545,19 +545,23 @@ struct probespec HostState::get_probe(const Target *target) {
|
|||
protocols. We cheat and store them in the TCP-, UDP-, SCTP- and
|
||||
ICMP-specific fields. */
|
||||
if (probe.proto == IPPROTO_TCP) {
|
||||
probe.type = PS_TCP;
|
||||
probe.pd.tcp.flags = TH_ACK;
|
||||
probe.pd.tcp.dport = get_random_u16();
|
||||
} else if (probe.proto == IPPROTO_UDP) {
|
||||
probe.type = PS_UDP;
|
||||
probe.pd.udp.dport = get_random_u16();
|
||||
} else if (probe.proto == IPPROTO_SCTP) {
|
||||
probe.type = PS_SCTP;
|
||||
probe.pd.sctp.dport = get_random_u16();
|
||||
} else if (probe.proto == IPPROTO_ICMP) {
|
||||
probe.type = PS_ICMP;
|
||||
probe.pd.icmp.type = ICMP_ECHO;
|
||||
} else if (probe.proto == IPPROTO_ICMPV6) {
|
||||
probe.type = PS_ICMPV6;
|
||||
probe.pd.icmp.type = ICMPV6_ECHO;
|
||||
} else {
|
||||
fatal("Unknown protocol %d", probe.proto);
|
||||
}
|
||||
// Otherwise we leave ourselves at the mercy of build_ip_raw()
|
||||
} else {
|
||||
/* No responsive probe known? The user probably skipped both ping and
|
||||
port scan. Guess ICMP echo as the most likely to get a response. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue