Linux 防ddos攻擊工具(D)DoS-Deflate
DDoS deflate其實(shí)非常簡(jiǎn)單,下面是詳細(xì)的安裝和配置步驟:宇塵網(wǎng)絡(luò)幫助中心域名知識(shí)|虛擬主機(jī)知識(shí)|VPS主機(jī)知識(shí)|服務(wù)器知識(shí)|網(wǎng)站建設(shè)知識(shí)|網(wǎng)絡(luò)推廣
1.安裝 DDoS deflate
wget http://www.inetbase.com/scripts/ddos/install.sh
chmod 0700 install.sh
./install.sh
//彈出版權(quán)信息后,在SSH下鍵入 q , 即可退出版權(quán)信息。
2.配置 DDoS deflate .
安裝成功后會(huì)提示Config file is at /usr/local/ddos/ddos.conf,所以你可以在ddos.conf里進(jìn)行簡(jiǎn)要配置.美國(guó)月付空間、月付美國(guó)空間、美國(guó)VPS、美國(guó)服務(wù)器租用
# vim /usr/local/ddos/ddos.conf
##### Paths of the script and other files
PROGDIR=”/usr/local/ddos”
PROG=”/usr/local/ddos/ddos.sh”
IGNORE_IP_LIST=”/usr/local/ddos/ignore.ip.list” //白名單
CRON=”/etc/cron.d/ddos.cron”
APF=”/etc/apf/apf”
IPT=”/sbin/iptables”
—————————————————————————-
##### frequency in minutes for running the script
##### Caution: Every time this setting is changed, run the script with –cron
##### option so that the new frequency takes effect
FREQ=1
//ddos.sh執(zhí)行的頻率,單位是分鐘,搭配crontab來執(zhí)行.
如果你更改了該設(shè)置,請(qǐng)執(zhí)行 /usr/local/ddos/ddos.sh –cron
—————————————————————————-
##### How many connections define a bad IP? Indicate that below.
NO_OF_CONNECTIONS=150
//當(dāng)哪個(gè)IP的連接數(shù)達(dá)到150就加入黑名單;查看連接數(shù)你可以執(zhí)行
#netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n
—————————————————————————-
##### APF_BAN=1 (Make sure your APF version is atleast 0.96)
##### APF_BAN=0 (Uses iptables for banning ips instead of APF)
APF_BAN=0
//一般情況下你是使用iptables來做防火墻,所以這里你需要將 APF_BAN的值改0.—————————————————————————-
##### KILL=0 (Bad IPs are’nt banned, good for interactive execution of script)
##### KILL=1 (Recommended setting)
KILL=1
//將非法的的IP加入iptables的INPUT鏈中,DROP之.
##### An email is sent to the following address when an IP is banned.
##### Blank would suppress sending of mails
EMAIL_TO=”root”
//給root發(fā)一封郵件
##### Number of seconds the banned ip should remain in blacklist.
BAN_PERIOD=600
//關(guān)押黑名單中的IP的時(shí)長(zhǎng)
3.卸載 DDoS deflate ,如果你不想用.
wget http://www.inetbase.com/scripts/ddos/uninstall.ddos
chmod 0700 uninstall.ddos
./uninstall.ddos 美國(guó)VPS,香港VPS,荷蘭VPS,新加坡VPS,VPS主機(jī)知識(shí),
另外如果總是會(huì)收到以下類似的郵件提示的話
Banned the following ip addresses on Tue Aug 5 01:32:01 BST 2008
1120 with 1120 connections
請(qǐng)查看/usr/local/ddos/ddos.sh文件的第117行
netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr > $BAD_IP_LIST
修改為以下代碼即可!
netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sed -n ‘/[0-9]/p’ | sort | uniq -c | sort -nr > $BAD_IP_LIST
更多技術(shù)知識(shí),更多網(wǎng)絡(luò)服務(wù),盡在宇塵網(wǎng)絡(luò)。我們的成長(zhǎng),離不開你們的支持,宇塵網(wǎng)絡(luò),歡迎您的訪問。