Centos8漏扫 ICMP timestamp请求响应漏洞&允许Traceroute探测 的解决方法

Centos8漏扫 ICMP timestamp请求响应漏洞&允许Traceroute探测 的解决方法ICMPtimestamp请求响应漏洞firewall-cmdpermanentdirectadd-ruleipv4filterINPUT0-pICMPicmp-typetimestamp-request-mcommentcomment”denyICMPtimestamp”-jDROPfirewall-cmdpermanentdirectadd-ruleipv4filterINPUT0-pICMPicmp.

ICMP timestamp请求响应漏洞

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 --permanent --direct --add-rule ipv4 filter INPUT 0 -p ICMP --icmp-type 11 -m comment --comment "time-exceeded" -j DROP
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -p ICMP --icmp-type 11 -m comment --comment "time-exceeded" -j DROP

允许Traceroute探测

firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p ICMP --icmp-type 0 -m comment --comment "echo-reply" -j DROP
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -p ICMP --icmp-type 0 -m comment --comment "echo-reply" -j DROP
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p ICMP --icmp-type 3 -m comment --comment "destination-unreachable" -j DROP
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -p ICMP --icmp-type 3 -m comment --comment "destination-unreachable" -j DROP

--reload使之生效

firewall-cmd --reload

--get-all-rules查看添加的规则

firewall-cmd --direct --get-all-rules

由于添加 echo-reply规则导致ping不通,现需要移除规则--remove-rule

firewall-cmd --permanent --direct --remove-rule ipv4 filter INPUT 0 -p ICMP --icmp-type 0 -m comment --comment "echo-reply" -j DROP
firewall-cmd --permanent --direct --remove-rule ipv4 filter OUTPUT 0 -p ICMP --icmp-type 0 -m comment --comment "echo-reply" -j DROP

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/35006.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注