ICMP协议
一、ICMP基本概念
1、ICMP协议
- Internet控制报文协议,用于在IP主机、路由器之间传递控制消息,控制消息指网络通不通、主机是否可达、路由是否可用等等
- ICMP是属于网络层的协议,封装在传输层与网络层之间
2、ICMP报文格式
- 类型 (type)
- 代码 (code)
- 类型
- (type:8 code0) 请求
- (type: 0 code: 0) 回显应答(表示比较正常的应答)
- (type:3 code:1) 目标不可达,主机不可达
- (11 0) 超时(传输生存时间为0)
- (3 3) 目标不可达(端口不可达)
- (3 2) 协议不可达
- (5 0) 网络重定向
- (5 1)主机重定向
- 类型
2、ICMP常见的报文
- 响应请求
- 使用ping请求(type=0) 响应(type=8)
- 目标不可达
- type=3
- 源抑制
- 源抑制则充当一个控制流量的角色,它通知主机减少数据报流量,由于ICMP没有恢复传输的报文,所以只要停止该报文,主机就会逐渐恢复传输速率 type=4
- 超时报文
- 类型11 code 0 传输超时,code1 重组分段超时
- 时间戳
- type =13 时间戳请求
- type=14 时间戳应答
二、ICMP重定向
在某些特定情况下,路由器检测到主机使用非优化路由时候,会向主机发送一个ICMP重定向报文,是主机的路由改变
1.ICMP重定向原理实验
2.ICMP重定向攻击(在kali上使用工具实施ICMP重定向网关)
工具:netwox
root㉿kali2)-[~]
└─# netwox
Netwox toolbox version 5.39.0. Netwib library version 5.39.0.
######################## MAIN MENU #########################
0 - leave netwox
3 - search tools
4 - display help of one tool
5 - run a tool selecting parameters on command line
6 - run a tool selecting parameters from keyboard
a + information
b + network protocol
c + application protocol
d + sniff (capture network packets)
e + spoof (create and send packets)
f + record (file containing captured packets)
g + client
h + server
i + ping (check if a computer if reachable)
j + traceroute (obtain list of gateways)
k + scan (computer and port discovery)
l + network audit
m + brute force (check if passwords are weak)
n + remote administration
o + tools not related to network