- Site Template
- WordPress Theme
- Blogging Theme
- CMS Theme
- Marketing Template
- eCommerce Theme
- Forum Theme
- Flash Template
- PSD Web Template
- .NET Script
- PHP Script
- HTML5 Code
- CSS Style
- Edge Animate Template
- Muse Template
- TypeEngine Theme
- Static Site Generator
- Sketch Template
CodeCanyon PHP DosDetector Class 4899130
PHP Script \ Addon
Firewall \ Security \ Address \ Monitoring \ Flooding \ Database \ Attack
PHP Script - PHP DosDetector Class 4899130 by @ CodeCanyon
PHP Script \ Addon
Last Update: 10 June 13; Compatible Browsers: IE8, IE9, IE10, Firefox, Safari, Opera, Chrome; Software Version: PHP 5.x; Files Included: PHP.
PHP DosDetector Class Documentation
Release: June 2013
Keyword: security, php, class, firewall, DoS Attack, IDS/IPS
1. What is this class?
This PHP Class used for preventing Denial of Service (DoS) attack to your web server written by PHP. Running this script will monitoring all requests from an IP address and logged it into memory cache (PHP APC Caching). If an IP address sends too much request to your server, it will trigger the Intrustion Preventing System (IPS) and auto-ban this IP Address.
2. System Requirement
- PHP 5.x
- APC Cache ( Learn more. )
- First, copy class.dosdetector.php file to your project, such as ./classes/ directory on your project.
- Next, including class.docsdetector.php file.
- Now, just create an object from this class and call run method before the first line of your project (usally in bootstrap, start up or index file) to start monitoring. You can pass an URL to run method in case banned IP will be redirect to passed URL. If you do not pass this parameter, banned IP will see a default message on screen.
- Example code.
//Put this in the beginning of your all page
$myDosDetector = new DosDetector();
//Default Running with Custom Landing Page for Banned IP Access
// YOUR SITE SOURCE CODE HERE
4. Editable Properties & Constants
- $ignoreIpAddress : IP Address in this array will be ignored by this detector. Usually your Company IP…
- PHPIDS_QUOTA_IDS_TRIGGER : if in a second, an IP Address request more than this value will be trigger method idsWorker() in this class. You can implement you code for this function (line 161 in class.dosdetector.php) to get the notification.
- PHPIDS_DURATION_IPS_TRIGGER : The number of second to check for IPS (auto-banning) trigger.
- PHPIDS_QUOTA_IPS_TRIGGER : if in PHPIDS_DURATION_IPS_TRIGGER seconds, same IP have more request than this value will be auto-banned by system.
- This package came with a standalone script to monitor the traffic (logged by DosDtector class). You can put this script anywhere on your web server (with PHP read permission), and run this script from browser to access monitor tool. Example: http://yoursite.com/monitor.php.
- This page will show all the request (with IP Address, Time, User-Agent, Cookie status, Request URI, Referer URL) logged by DosDetector. Logged Accesses will be cached for 2 hours for performance.
- This page will show you banned IP address (from auto-ban or manual-ban IP Address). You can manual-ban an IP Address if you see that IP request too much and have weird access. Banned IP addresses will not be clear automatically. This banned list only clear by you or by clear from APC cache.
- You can detect whether a request have cookie or not, because a request without cookie is usually a search engine robot (Googlebot,.) or an automatic script crawling/flooding your website.
Keywords: PHP Security, database, dos attack, firewall, flooding, ids, ip, ip address, ips, monitoring, php, php firewall, security.
Android, Builder, Business, Clean, Corporate, Creative, Design, Ecommerce, Email, Fashion, Gallery, Image, Iphone, Jquery, Landing, Magazine, Magento, Marketing, Minimal, Mobile, Modern, Multi, Multipurpose, Online, Parallax, Personal, Photography, Plugin, Portfolio, Product, Responsive, Simple, Slider, Social, Store, Template, Theme, Video, Woocommerce, Wordpress
Show all tags
Show all tags
- ThemeForest Boast Corporate PSD Template 19636159
- ThemeForest Quill Minimal Blog And Magazine Ghost Theme 19623926
- ThemeForest MUKTI One Page Multipurpose PSD Template 19636023
- ThemeForest Consulex Business Consulting and Financial Services HTML Template 19640405
- ThemeForest Sigma Responsive Coming Soon Template 19640360
- ThemeForest Concern Multipurpose HTML Template 19640300
- ThemeForest RedCayenne Cafe & Restaurant HTML Template 19639586
- ThemeForest infinity Multipurpose Business Landing Page 19634241
- ThemeForest Personal CV Resume Template 19639415
- ThemeForest Prokit Instapage Product Landing Page 19632711