Friday, April 26, 2024

利用iptables防止php-ddos对外udp发包

最近一段时间php-ddos泛滥,尤其是织梦dede一堆洞洞,你懂得。其实,我们可以利用iptables,从根源上禁止php-ddos对外发包。

这样你就不必担心你的VPS或者虚拟空间因为漏洞问题被植入php-ddos,对外发送大量的数据包而被主机商关闭。

# iptables -I OUTPUT -p udp –dport 53 -d 8.8.8.8 -j ACCEPT
# iptables -I OUTPUT -p udp –dport 53 -d 8.8.4.4 -j ACCEPT

“53”,为DNS所需要的UDP端口,“8.8.8.8”部分为DNS IP,根据您服务器的设定来定,若您不知您当前服务器使用的DNS IP,可在SSH中执行以下命令获取:

# cat /etc/resolv.conf |grep nameserver |awk ‘NR==1{print $2 }’

禁止本机对外发送UDP包

# iptables -A OUTPUT -p udp -j DROP

转载自深度VPS [ http://www.deepvps.com ]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.