Giter Club home page Giter Club logo

bananoid's Introduction

This tool adds basic protection to server against DoS/DDoS through HTTP.

Tool is designed to use:

  • Linux
  • tmpfs (for speedup)
  • sqlite3
  • ruby

Required ruby gems:

  • activesupport
  • daemons
  • sqlite3-ruby
  • file-tail

Well, as it starts and tries to mount ./db with tmpfs (ability and size of tmpfs are setting up in config) to boost speed.
And it is actually needed step, cause heavy working with sqlite3 increases disk activity a lot.

That it “tails” logfile (looking for new records each 10 seconds) and adds records to sqlite3.

During adding it increases counter for same requests in last 10 seconds. More than 10 same requests from same IP looks suspicious,
so its going to be banned using external command.

Example log formats:

:common => ‘%h %l %u %t \“%r\” %>s %b’

:common_with_virtual => ‘%v %h %l %u %t \“%r\” %>s %b’

:combined => ‘%h %l %u %t \“%r\” %>s %b \“%{Referer}i\” \“%{User-agent}i\”’

:combined_with_virtual => ‘%v %h %l %u %t \“%r\” %>s %b \“%{Referer}i\” \“%{User-agent}i\”’

:combined_with_cookies => ‘%h %l %u %t \“%r\” %>s %b \“%{Referer}i\” \“%{User-agent}i\” \“%{Cookies}i\”’

Legend:

‘h’ => :ip

‘l’ => :auth

‘u’ => :username

‘t’ => :datetime

‘r’ => :request

‘s’ => :status

‘b’ => :bytecount

‘v’ => :domain

‘i’ => :header_lines

Any help and assistance on improving this stuff will be appreciated.

bananoid's People

Contributors

e1senh0rn avatar

Watchers

 avatar  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.