Created
September 8, 2016 03:08
-
-
Save x2c3z4/2286e5a6e0975938fb22f69f7ed39c97 to your computer and use it in GitHub Desktop.
ddos-deflate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt | |
wget https://github.com/jgmdev/ddos-deflate/archive/master.zip | |
unzip master.zip | |
rm master.zip | |
cd ddos-deflate-master | |
./install.sh | |
echo '# Paths of the script and other files | |
PROGDIR="/usr/local/ddos" | |
SBINDIR="/usr/local/sbin" | |
PROG="$PROGDIR/ddos.sh" | |
IGNORE_IP_LIST="ignore.ip.list" | |
IGNORE_HOST_LIST="ignore.host.list" | |
CRON="/etc/cron.d/ddos" | |
# Make sure your APF version is atleast 0.96 | |
APF="/usr/sbin/apf" | |
CSF="/usr/sbin/csf" | |
IPT="/sbin/iptables" | |
# frequency in minutes for running the script as a cron job | |
# Caution: Every time this setting is changed, run the script with --cron | |
# option so that the new frequency takes effect | |
FREQ=1 | |
# frequency in seconds when running as a daemon | |
DAEMON_FREQ=5 | |
# How many connections define a bad IP? Indicate that below. | |
NO_OF_CONNECTIONS=50 | |
# The firewall to use for blocking/unblocking, valid values are: | |
# auto, apf, csf and iptables | |
FIREWALL="auto" | |
# An email is sent to the following address when an IP is banned. | |
# Blank would suppress sending of mails | |
EMAIL_TO="[email protected]" | |
# Number of seconds the banned ip should remain in blacklist. | |
BAN_PERIOD=600 | |
# Connection states to block. See: man netstat | |
CONN_STATES="ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT2|TIME_WAIT|CLOSE_WAIT|LAST_ACK|CLOSING"' > /etc/ddos/ddos.conf | |
echo "*.cloudflare.com | |
*.ssllabs.com | |
imirhil.fr" >> /etc/ddos/ignore.host.list | |
echo "# Cloudflare | |
103.21.244.0/22 | |
103.22.200.0/22 | |
103.31.4.0/22 | |
104.16.0.0/12 | |
108.162.192.0/18 | |
131.0.72.0/22 | |
141.101.64.0/18 | |
162.158.0.0/15 | |
172.64.0.0/13 | |
173.245.48.0/20 | |
188.114.96.0/20 | |
190.93.240.0/20 | |
197.234.240.0/22 | |
198.41.128.0/17 | |
199.27.128.0/21 | |
2400:cb00::/32 | |
2405:8100::/32 | |
2405:b500::/32 | |
2606:4700::/32 | |
2803:f800::/32" >> /etc/ddos/ignore.ip.list | |
service ddos restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment