Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.
/ bananoid Public archive

Tool to prevent DoS/DDoS attacks by parsing webserver's log and adding intruders to iptables/routes.

Notifications You must be signed in to change notification settings

e1senh0rn/bananoid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Tool to prevent DoS/DDoS attacks by parsing webserver's log and adding intruders to iptables/routes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages