ICMP(Internet Control Message Protocol,互联网控制消息协议)
用于网际协议(IP)中发送控制消息,提供可能发生在通信环境中的各种问题反馈。
使用
ping和 mtr
命令使用了ICMP,其中mtr
结合了 ping 和 traceroute 的功能
模拟
apt install icmpush
$ icmpush -h
Usage: icmpush type [options] host
Type:
-du Destination Unreach -echo Echo Request
-info Information Request -mask Address Mask Request
-rta Router Advertisement -rts Router Solicitation
-red Redirect -sq Source Quench
-tstamp Timestamp -tx Time Exceeded
-param Parameter Problem
-v Verbose mode on -vv Debug mode on
-h This help screen -V Program version
Options:
-sp address Spoof host.
-to secs Timeout secs to read the replies.
-n Don't use name resolution.
-lt secs Lifetime secs for an ICMP Router Advertisement.
-gw address Route gateway host for an ICMP Redirect.
-dest address Route destination host for an ICMP Redirect.
-orig address Original host for an ICMP error.
-psrc port Source port (tcp/udp) of ICMP error data.
-pdst port Destination port (tcp/udp) of ICMP error data.
-prot ICMP error data protocol ( tcp | udp | icmp ).
-id ident Identification for an ICMP information message.
-seq seq# Sequence number for an ICMP information message.
-pat pattern Data pattern to send within an ICMP Echo Request.
-gbg bytes|max Number of garbage data bytes to send or maximum(max).
-ptr byte Incorrect byte on an ICMP Parameter Problem.
-c code|num|max ICMP code. See the man page for details.
- 示例:构造 Address Mask Request
icmpush -mask -sp 172.20.0.132 -to 10 172.20.0.1