- 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, Email, Fashion, Gallery, Image, Iphone, Jquery, Landing, Magazine, Magento, Marketing, Minimal, Mobile, Modern, Multi, Multipurpose, Online, Parallax, Personal, Photography, Plugin, Portfolio, Product, Responsive, Retina, Simple, Slider, Social, Store, Template, Theme, Video, Woocommerce, Wordpress
Show all tags
Show all tags
- ThemeForest Minotaur Angular Admin Dashboard 19319935
- ThemeForest Nagual Unique Personal Agency Portfolio WordPress Theme 19237902
- ThemeForest Naptum One Page Parallax PSD Template 19318574
- ThemeForest Future Responsive Email & StampReady Builder 19314349
- ThemeForest JV HugeShop Multipurpose Joomla Template 19317324
- ThemeForest Heraz Creative Portfolio Template 19316555
- ThemeForest Material Hosting WordPress Theme & WHMCS 18147644
- ThemeForest Sportsox Sport Team Clubs HTML Template 19292030
- ThemeForest UpMobile HTML Mobile Template 19311698
- ThemeForest Gazette Responsive Clean & Minimalist Multipurpose Blog Template 19296928