Coder Social home page Coder Social logo

wupfhub / ddos-defalte Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snail007/ddos-defalte

0.0 0.0 0.0 156 KB

DDOS defalte是一款免费的用来防御和减轻DDoS攻击。它通过netstat监测跟踪创建大量网络连接的IP地址,在检测到某个结点超过预设的限制时,该程序会通过APF或iptables禁止或阻挡这些IP.

License: MIT License

ddos-defalte's Introduction

DDos-defalte

DDOS defalte是一款免费的用来防御和减轻DDoS攻击。它通过netstat监测跟踪创建大量网络连接的IP地址,在检测到某个结点超过预设的限制时,该程序会通过APF或iptables禁止或阻挡这些IP.

#该版对原版进行了错误修复,而且进行了本地化不需要安装的时候下载文件。

#安装步骤

  1. 下载 ddos-defalte.tar.gz
  2. tar zxfv ddos-defalte.tar.gz
  3. cd ddos-defalte
  4. ./install.sh
  5. 安装完毕。
  6. 配置文件位于 /usr/local/ddos/ddos.conf
  7. ip白名单文件位于 /usr/local/ddos/ignore.ip.list ,格式:一行一个ip
  8. 配置完毕之后执行命令 ddos 可以看到一行行的输出,每行:第一个是连接数 第二个是对应ip
    /usr/local/sbin/ddos命令是脚本/usr/local/ddos/ddos.sh的一个软链接
  9. 安装完毕。 然后只需要计划任务周执 ddos 命令即可。ddos每执行一次都会检测配置里面的设置监测系统网络连接情况封ip。
    比如root帐号下,执crontab -e 可以这样执行计划任务 */1 * * * * /usr/local/ddos/ddos.sh >/dev/null 2>&1
  10. 命令ddos有一些带参数的用法,可以通过ddos -h 了解用法。

配置文件/usr/local/ddos/ddos.conf的一些简要说明:

PROGDIR="/usr/local/ddos" 
PROG="/usr/local/ddos/ddos.sh" 
IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list"  #ip的白名单 
APF="/etc/apf/apf" 
IPT="/sbin/iptables" 

##### How many connections define a bad IP? Indicate that below. 
NO_OF_CONNECTIONS=100 #一个ip超过100个连接数,自动封掉 

##### 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封ip 

##### KILL=0 (Bad IPs are'nt banned, good for interactive execution of script) 
##### KILL=1 (Recommended setting) 
KILL=1 

##### An email is sent to the following address when an IP is banned. 
##### Blank would suppress sending of mails ,设置为 root 则不发邮件
EMAIL_TO="root"  #封ip,自动发送邮件 

##### Number of seconds the banned ip should remain in blacklist. 
BAN_PERIOD=600 

ddos-defalte's People

Contributors

snail007 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.