• Linux漏洞修复:禁用外来的ICMP timestamp和禁止Traceroute探测


    1、安装iptables服务

    下载安装包,下载地址 http://mirrors.163.com/centos/7/os/x86_64/Packages/
    然后使用 rpm 命令安装
    sudo rpm -Uvh iptables-1.4.21-24.el7.x86_64.rpm
    sudo rpm -Uvh iptables-services-1.4.21-24.el7.x86_64.rpm

    2、重启iptables服务
    sudo service iptables restart

    3、直接在终端命令行输入如下命令,禁用外来的ICMP timestamp和禁止Traceroute探测
    sudo iptables -A INPUT -p ICMP --icmp-type timestamp-request -j DROP
    sudo iptables -A INPUT -p ICMP --icmp-type timestamp-reply -j DROP
    sudo iptables -A INPUT -p ICMP --icmp-type time-exceeded -j DROP
    sudo iptables -A OUTPUT -p ICMP --icmp-type time-exceeded -j DROP

    4、执行命令对修改过的规则进行保存,使其永久生效
    sudo service iptables save

    5、检查新添加的规则是否生效
    sudo iptables -L -n

    生效的话会显示添加下面几条规则,13,14是ICMP timestamp 请求响应漏洞的规则,11是解决允许Traceroute探测的
    DROP icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 13
    DROP icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 14
    DROP icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 11
    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
    DROP icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 11


    备注:
    修改过的规则保存在/etc/sysconfig/iptables文件下
    # Generated by iptables-save v1.4.21 on Wed Jan 26 16:31:39 2022
    *filter
    :INPUT ACCEPT [76:7013]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [35:5448]
    -A INPUT -p icmp -m icmp --icmp-type 13 -j DROP
    -A INPUT -p icmp -m icmp --icmp-type 14 -j DROP
    -A INPUT -p icmp -m icmp --icmp-type 11 -j DROP
    -A OUTPUT -p icmp -m icmp --icmp-type 11 -j DROP
    COMMIT
    # Completed on Wed Jan 26 16:31:39 2022

  • 相关阅读:
    迅为i.MX8M开发板Linux安卓9.0系统,四核CortexA53,单核CortexM4
    迅为龙芯2K1000开发板虚拟机ubuntu安装SSH服务
    迅为i.MX8MM开发板虚拟机Vmware的安装
    迅为龙芯2K1000开发板虚拟机ubuntu安装vscode
    归并排序XCoderLiu
    关于API中窗口子类化及超类化整理
    STL中最流行类模板vector
    andbook
    Navigation Failed: Cannot Find Application\HTML\1033\default.htm 错误解决办法
    html 播放音乐
  • 原文地址:https://www.cnblogs.com/nanqiang/p/15847573.html
Copyright © 2020-2023  润新知