Giter Club home page Giter Club logo

ddos-deflate's Introduction

ddos-deflate

Shell script blocking DDoS attacks. Simplified fork of (D)DoS Deflate.

Not maintained since 2016.

Installation

sudo -i
cd /tmp
wget -q -O - https://raw.githubusercontent.com/Amet13/ddos-deflate/master/install.sh | bash

Setup config for example:

vim /usr/local/ddos-deflate/ddos-deflate.conf
NO_OF_CONNECTIONS=500
EMAIL_TO="[email protected]"
BAN_PERIOD=60
CUSTOM_PORTS=":80|:443:|:53|:21"
ENABLE_LOG=YES

Add your ignore IP's to ignore list:

vim /usr/local/ddos-deflate/ignoreip.list
127.0.0.1
192.168.0.1
1.1.1.1
2.2.2.2

Check:

bash /usr/local/ddos-deflate/ddos-deflate.sh
    724 127.0.0.1
    214 2.2.2.2
     59 3.3.3.3
...

Testing

Run ab from another computer:

[email protected] ~ $ ab -n 200000 -c 100 http://server-ip/

Check new IPTables rules on server:

iptables -t raw -L PREROUTING
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
DROP       all  --  192.168.0.100        anywhere

Check logs:

tail -1 /var/log/ddos-deflate.log
26/12/2015 [17:50:00] -- 192.168.0.100 blocked on 60 seconds

Check your inbox:

Subject: IP addresses banned on 26/12/2015 [17:50:02]

Banned the following IP addresses on 26/12/2015 [17:50:02]
From: hostname.tld (192.168.0.13)

192.168.0.100 with 4183 connections blocked on 60 seconds

Uninstallation

sudo -i
cd /tmp
wget -q -O - https://raw.githubusercontent.com/Amet13/ddos-deflate/master/uninstall.sh | bash

Why RAW table instead FILTER?

Original author

[email protected]

License

Artistic License 2.0

ddos-deflate's People

Contributors

amet13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ddos-deflate's Issues

После удаления скрипта в правила iptables добавляется блокировка hostname

Добрый день!

После удаления скрипта в правила iptables добавляется блокировка hostname при перезагрузке сервера.
Подскажите, как полностью удалить скрипт?

Причина удаления в том, что скрипт автоматически удаляет добавляемые в ignoreip.list адреса и это приводит к нарушению работы сервера.

Добавляются правила типа:
root@d:/tmp# iptables -t raw -L PREROUTING
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DROP all -- d.domain.ru anywhere
DROP all -- d.domain.ru anywhere
DROP all -- d.domain.ru anywhere
DROP all -- d.domain.ru anywhere
DROP all -- d.domain.ru anywhere

Wrong emails

Hi!
Thanks for the script!

I just installed it and rebooted the server.
I got email in 20:05
Banned the following IP addresses on 31/08/2016 [20:05:36]
From: localhost (::1 127.0.0.1 X.XXX.XX.XXX)
X.XXX.XX.XXX with 586 connections blocked on 600 seconds

But this IP is server's IP. It added in /usr/local/ddos-deflate/ignoreip.list:
nano /usr/local/ddos-deflate/ignoreip.list
127.0.0.1
192.168.0.1
X.XXX.XX.XXX

root@XXX:# iptables -t raw -L PREROUTING
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
root@XXX:
# tail -1 /var/log/ddos-deflate.log
31/08/2016 [19:41:21] -- X.XXX.XX.XXX blocked on 600 seconds

Server work properly.
Debian 8.5.

Thank you in advance!

BR, Maxim.

It blocked cloudflare IP

Hello,
it blocked CF IP with 330 connections.
Some websites hosted on the Apache server are using cloudflare. Should i try to find CF IPs and add them all into "/usr/local/ddos/ignore.ip.list"? I assume it does not support CIDR 1.2.3.0/24

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.