對這種攻擊的處罰政策是,
Further violations will proceed with these following actions:
1st violation - Warning and shutdown of server. We will allow 24 hours for you to rectify the problem. 第一次是警告+關機,給24小時的時間來解決問題
2nd violation - Immediate reformat of server. 第二次是立即格式化伺服器
3rd violation - Cancellation with no refund. 第三次是取消服務並不給退款
針對這個問題,給一個簡單的描述,
表現特徵:一開啟IIS,伺服器的流出頻寬就用光-----就是說伺服器不斷向別人發包,這個情況和受到ddos攻擊是不同的,Ddos是不斷收到大量資料包.
解決辦法:
先停止IIS,這樣就暫時沒法對外攻擊了,然後
禁止上述的代碼:
在c:\windows\php.ini裡設定:
disable_functions =gzinflate,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen
在c:\windows\php.ini裡設其值為Off
allow_url_fopen = Off
並且:
;extension=php_sockets.dll
前面的;號一定要有,意思就是限制用sockets.dll
前面的;號要保留
然後啟動IIS
在IP策略,或防火牆中,禁止所有udp向外發送
linux下解決辦法
一、禁止本機對外發送UDP包
iptables -A OUTPUT -p udp -j DROP
二、允許需要UDP服務的連接埠(如DNS)
iptables -I OUTPUT -p udp --dport 53 -d 8.8.8.8 -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 }'
附完整iptables規則
#iptables -A INPUT -p tcp -m tcp --sport 53 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
#iptables -A INPUT -p udp -m udp --sport 53 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
#iptables -A OUTPUT -p tcp -m tcp --sport 1024:65535 -d 8.8.4.4 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
#iptables -A OUTPUT -p udp -m udp --sport 1024:65535 -d 8.8.8.8 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
#iptables -A OUTPUT -p udp -j REJECT
#/etc/rc.d/init.d/iptables save
# service iptables restart
#chkconfig iptables on
開放 對外 以及對內的 DNS連接埠 53
禁止其他全部出站的UDP 協議
開機啟動iptables
另外要說明的是,上面的代碼是因為我伺服器使用的是Google的DNS來解析,我伺服器端對外的訪問(在伺服器端上網,就需要,如果只是單純的伺服器,不進行 yum安裝也可以不用),因此我開放對8.8.4.4和8.8.8.8的訪問,如果你不是設定為Google的DNS,那麼這裡要自行修改成你的DNS。使用的 DNS是什麼可以用下面方法查詢