[ad_1]
To get this product on 50 p.c contact me on this link
PHP DosDetector Class Documentation
Version: 1.1
Release: June 2013
Keyword: safety, php, class, firewall, DoS Attack, IDS/IPS
1. What is that this class?
This PHP Class used for stopping Denial of Service (DoS) assault to your net server written by PHP. Running this script will monitoring all requests from an IP tackle and logged it into reminiscence cache (PHP APC Caching). If an IP tackle sends an excessive amount of request to your server, it’ll set off the Intrustion Preventing System (IPS) and auto-ban this IP Address.
2. System Requirement
- PHP 5.x
- APC Cache (Learn more..)
3. Installation
– First, copy class.dosdetector.php
file to your undertaking, akin to ./lessons/
listing in your undertaking.
– Next, together with class.docsdetector.php
file.
– Now, simply create an object from this class and name run
methodology earlier than the primary line of your undertaking (often in bootstrap, begin up or index file) to start out monitoring. You can go an URL to run methodology in case banned IP will probably be redirect to handed URL. If you don’t go this parameter, banned IP will see a default message on display.
– Example code:
//Put this within the startning of your all web page include_once('./lessons/class.dosdetector.php'); $myDosDetector = new DosDetector(); //Default Running $myDosDetector->run(); //Default Running with Custom Landing Page for Banned IP Access //$myDosDetector->run('http://url/to/your/landing/page'); ////////////////////////////// // YOUR SITE SOURCE CODE HERE //....
4. Editable Properties & Constants
$ignoreIpAddress
: IP Address on this array will probably be ignored by this detector. Usually your Company IP…PHPIDS_QUOTA_IDS_TRIGGER
: if in a second, an IP Address request greater than this worth will probably be set off methodology idsWorker() on this class. You can implement you code for this operate (line 161 at school.dosdetector.php) to get the notification.PHPIDS_DURATION_IPS_TRIGGER
: The variety of second to examine for IPS (auto-banning) set off.PHPIDS_QUOTA_IPS_TRIGGER
: if inPHPIDS_DURATION_IPS_TRIGGER
seconds, identical IP have extra request than this worth will probably be auto-banned by system.
5. Monitoring
– This package deal got here with a standalone script to observe the site visitors (logged by DosDtector class). You can put this script wherever in your net server (with PHP learn permission), and run this script from browser to entry monitor device. Example: http://yoursite.com/monitor.php.
– This web page will present all of the request (with IP Address, Time, User-Agent, Cookie standing, Request URI, Referer URL) logged by DosDetector. Logged Accesses will probably be cached for two hours for efficiency.
– This web page will present you banned IP tackle (from auto-ban or manual-ban IP Address). You can manual-ban an IP Address for those who see that IP request an excessive amount of and have bizarre entry. Banned IP addresses won’t be clear mechanically. This banned listing solely clear by you or by clear from APC cache.
– You can detect whether or not a request have cookie or not, as a result of a request with out cookie is often a search engine robotic (Googlebot,..) or an automated script crawling/flooding your web site.
Thank you!
[ad_2]
To get this product on 50 p.c contact me on this link