# ll /usr/local/ddos/ 總用量 24 -rw-r--r--. 1 root root 971 1月 10 2006 ddos.conf -rwxr-xr-x. 1 root root 3945 1月 10 2006 ddos.sh -rw-r--r--. 1 root root 10 1月 10 2006 ignore.ip.list -rw-r--r--. 1 root root 10113 1月 10 2006 LICENSE # cat /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" #crond定時任務指令碼 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執行的頻率,單位是分鐘,搭配crontab來執行. ##### How many connections define a bad IP? Indicate that below. NO_OF_CONNECTIONS=150 #最大串連數設定,超過這個數位IP就會屏蔽 ##### 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=1 #1:使用APF 0:使用iptables,一般情況下你是使用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" #寄送電子郵件警示的郵箱地址 ##### Number of seconds the banned ip should remain in blacklist. BAN_PERIOD=600 #屏蔽IP的時間,根據情況調整 # |