zaishanfeng
V2EX  ›  问与答

怎么防止服务器被 traceroute?

  •  
  •   zaishanfeng · Jun 16, 2016 · 5630 views
    This topic created in 3616 days ago, the information mentioned may be changed or developed.

    // allow

    echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all

    // block

    echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all

    // permanent block (edit /etc/sysctl.conf)

    net.ipv4.conf.icmp_echo_ignore_all = 1

    这样设置能防止被 ping, 却不能防止被 traceroute, 大家是怎么解决的

    zaishanfeng
        1
    zaishanfeng  
    OP
       Jun 16, 2016
    以解决, traceroute 可以使用 icmp 和 udp, 以上只禁止了 icmp

    linux 下 traceroute 使用的 udp 端口是 33434-33529

    so

    iptables -A INPUT -p udp --dport 33434:33529 -j DROP
    bazingaterry
        2
    bazingaterry  
       Jun 16, 2016
    trace route 也可以 tcp 的,除非禁掉所有网络吧……
    fengxing
        3
    fengxing  
       Jun 16, 2016
    关机
    bearice
        4
    bearice  
       Jun 16, 2016
    可以 randomize ttl ,这样大部分 tercert 工具都能懵逼
    j4fun
        5
    j4fun  
       Jun 16, 2016
    drop 掉即可, iptables -t nat -A INPUT -t ttl -ttl 1 -j drop
    j4fun
        6
    j4fun  
       Jun 16, 2016
    喵的打错了居然不能编辑。。。宝宝的积分啊= =!
    。。 iptables -t nat -A INPUT -m ttl --ttl 1 -j drop ...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1014 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 22:16 · PVG 06:16 · LAX 15:16 · JFK 18:16
    ♥ Do have faith in what you're doing.