Cấu hình fix lỗ hổng portmapper

0
1781

Hiện trạng

  • VPS chạy dịch vụ portmapper, listen port 111/udp trên địa chỉ IP public, do đó có nguy cơ bị khai thác tấn công DDoS

Giải pháp

  • Tắt dịch vụ rpcbind nếu không có nhu cầu sử dụng (dùng cho NFS). VD trên CentOS7:

    # systemctl stop rpcbind
    # systemctl stop rpcbind.socket
    # systemctl disable rpcbind
    # systemctl disable rpcbind.socket
  • Cấu hình firewall
    • Redhat/CentOS

      # iptables -I INPUT -p udp -s 127.0.0.1 --dport 111 -j ACCEPT
      # iptables -I INPUT -p udp --dport 111 -j DROP
    • Debian/Ubuntu

      # ufw allow from 127.0.0.1 proto udp to any port 111
      # ufw deny from any proto udp to any port 111

Leave a Reply

avatar
  Subscribe  
Notify of