最近安全审计那边提供了我们服务器的一个漏洞需要修复,该漏洞是ICMP 时间戳请求响应漏洞,具体修复过程在此记录一番。

漏洞描述

ICMP(Internet Control Message Protocol,Internet控制信息协议)为IP 堆栈发送简单的信息。由于ICMP过于简单,所以它对于网络的安全性有比较大的负面影响,攻击者可以利用ICMP进行网络扫描、拒绝服务(DoS)攻击和隧道攻击等各种危害网络安全的活动。最常用的ICMP应用就是通常被称为Ping的操作。攻击者可以利用ICMP协议来探测主机地址是否存活。远程主机响应一个ICMP时间戳请求,就允许攻击者知道你机器的时间,这可以帮助攻击者攻击那些基于主机时间的协议。

image-20210401152845452

漏洞修复

1
2
3
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p ICMP --icmp-type timestamp-request -m comment --comment "deny ICMP timestamp" -j DROP
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p ICMP --icmp-type timestamp-reply -m comment --comment "deny ICMP timestamp" -j DROP
firewall-cmd --reload

查看是否生效

1
2
3
4
5
6
[test@hostname ~]$ su - root
Password:
Last login: Thu Apr 1 14:31:35 CST 2021 on pts/2
[root@hostname ~]# firewall-cmd --direct --get-all-rules
ipv4 filter INPUT 0 -p ICMP --icmp-type timestamp-request -m comment --comment 'deny ICMP timestamp' -j DROP
ipv4 filter INPUT 0 -p ICMP --icmp-type timestamp-reply -m comment --comment 'deny ICMP timestamp' -j DROP