Configuring the httpd.conf File Mod_Dosevasive
Mod_Dosevasivefirst of all download Mod_Dosevasive form http://www.303030.com/downloads/dosevasive.zip LoadModule dosevasive22_module modules/mod_dosevasive22.dll <IfModule dosevasive22_module> am using apache 2.2 on windows 2008 please read the follwoing topic it will help you alot Mohamed Ali Elsayed 21/8/2010 In Chapter 4, "Configuring the httpd.conf File," we discussed the native Apache directives that can be configured to help mitigate the effects of a Denial of Service (DoS) attack. The directives included Timeout, KeepAlive, and KeepAliveTimeout. While these directives help with the performance of Apache and will lessen the impact of a DoS attack, there is another third-party module that is extremely effective. What Is Mod_Dosevasive?Mod_Dosevasive is an evasive maneuvers module for Apache whose purpose is to react to HTTP DoS and/or Brute Force attacks. It was developed by Jonathan Zdziarski and can be downloaded from his web site: http://www.nuclearelephant.com/. An additional capability of the module is that it is also able to execute system commands when DoS attacks are identified. This provides an interface to send attacking IP addresses to other security applications such as local host-based firewalls to block the offending IP address. Mod_Dosevasive performs well in both single-server attacks, as well as distributed attacks; however, as with any DoS attack, the real concern is network bandwidth and processor/ RAM usage. Keep this in mind as we discuss DoS attacks throughout this book. Installing Mod_DosevasiveAs we discussed in Chapter 3, in order to implement Mod_Dosevasive as a DSO module, we can use the Apache apxs script. The Mod_Dosevasiveapplication comes with two different versions for Apache, one for the 1.3 version (mod_dosevasive.c) and one for the 2.0 version (mod_dosevasive20.c). The following command will compile, install, and activate the module: # ./apxs -cia /tools/mod_dosevasive/mod_dosevasive20.c How Does Mod_Dosevasive Work?Mod_Dosevasive identifies attacks by creating and using an internal dynamic hash table of IP Addresses to URIs pairs based on the requests received. When a new request comes into Apache, Mod_Dosevasive will perform the following tasks:
If any of these checks are true, the client is denied access with the default status code of 403 Forbidden. Once a client has been denied, they will continue to be denied for the duration of the configured block period (default is 10 seconds). If they continue to send requests during this timeframe, they will continue to be denied and forced to wait even longer. Figure 5.3 shows an example of the Mod_Dosevasive process flow.
Figure 5.3. Mod_Dosevasive process flow.
ConfigurationThe Mod_Dosevasive module has default settings, which allow it to work without the need to add additional httpd.conf file directives. While this is certainly easy, you will most likely need the capability to tweak the various settings to set the correct thresholds for your environment. Therefore, you should add the following directives to your httpd.conf file and update as needed:
We will now discuss each of the Mod_Dosevasive directives. Most of this information is taken directly from the README file of Mod_Dosevasive, so proper credit should be given to the developer of this module. DosHashTableSizeThis directive specifies the number of top-level nodes for each apache child process's hash table. Increasing this number will provide faster performance by decreasing the number of iterations required to get to the record, but consume more memory for table space. You should increase this if you have a busy web server. The value you specify will automatically be tiered up to the next prime number in the primes list (see mod_dosevasive.c for a list of primes used). DOSPageCountThis is the threshold for the number of requests for the same page (or URI) per page interval. Once the threshold for that interval has been exceeded, the IP address of the client will be added to the blocking list. DOSSiteCountThis is the threshold for the total number of requests for any object by the same client on the same listener per site interval. Once the threshold for that interval has been exceeded, the IP address of the client will be added to the blocking list. DOSPageIntervalThe interval for the page count threshold; defaults to 1 second intervals. DOSSiteIntervalThe interval for the site count threshold; defaults to 1 second intervals. DOSBlockingPeriodThe blocking period is the amount of time (in seconds) that a client will be blocked for if they are added to the blocking list. During this time, all subsequent requests from the client will result in a 403 (Forbidden) and the timer being reset (e.g., another 10 seconds). Because the timer is reset for every subsequent request, it is not necessary to have a long blocking period; in the event of a DoS attack, this timer will keep getting reset. DOSEmailNotifyIf this value is set, an email will be sent to the address specified whenever an IP address becomes blacklisted. A locking mechanism using /tmp prevents continuous emails from being sent. Note Be sure MAILER is set correctly in mod_dosevasive.c (or mod_dosevasive20.c). The default is "/bin/mail -t %s" where %s is used to denote the destination email address set in the configuration. If you are running on Linux or some other operating system with a different type of mailer, you'll need to change this. DOSSystemCommandIf this value is set, the system command specified will be executed whenever an IP address becomes blacklisted. This is designed to enable system calls to ip filter or other tools. A locking mechanism using /tmp prevents continuous system calls. Use %s to denote the IP address of the blacklisted IP. DOSLogDirChoose an alternative temp directory. By default, "/tmp" will be used for the locking mechanism, which opens some security issues if your system is open to shell users. In the event you have nonprivileged shell users, you'll want to create a directory writable only to the user Apache is running as, then set this in yourhttpd.conf. WhiteListingAs of version 1.8, IP addresses of trusted clients can be whitelisted to ensure they are never denied. The purpose of whitelisting is to protect software, scripts, local searchbots, or other automated tools from being denied for requesting large amounts of data from the server. Whitelisting should not be used to add customer lists or anything of the sort, as this will open the server to abuse. This module is very difficult to trigger without performing some type of malicious attack, and for that reason, it is more appropriate to allow the module to decide on its own whether or not an individual customer should be blocked. To whitelist an address (or range), add an entry to the Apache configuration in the following fashion: DOSWhitelist 127.0.0.1 Wildcards can be used on up to the last three octets if necessary. Multiple DOSWhitelist commands may be used in the configuration. TestingMod_Dosevasive comes with a PERL script called test.pl. Without editing the file, if you execute it, it will send a total of 100 requests for incrementing URLs (based on 0-100) to the localhost address on port 80. It sends the requests at a high rate and should cause Mod_Dosevasive to deny the requests after about 20 requests. Here are the contents of the test.pl script:
If you run the script, you should see output similar to the following: # ./test.pl Mod_Dosevasive SummaryThis module is surprisingly effective at fending off small- to medium-sized request-based DoS attacks and brute force attacks. Its features will prevent you from wasting bandwidth or having a few thousand CGI scripts running as a result of an attack, which will be a valid concern when we discuss some of the advanced alerting mechanisms in later chapters. When used in conjunction with other preventative measures such as router blackholing, this tool is very effective against larger DoS attacks as well. If you do not have an infrastructure capable of fending off any other types of DoS attacks, chances are this tool will only help you to the point of your total bandwidth or server capacity for sending 403s. Without a solid infrastructure and DoS evasion plan in place, a heavy distributed DoS will most likely still take you offline. We will be returning to Mod_Dosevasive in later sections of the book. We will be talking more in-depth about running tests to tweak the directive settings to gain the best ratio for your site, as well as some custom updates that I have made to the modules code to gain increased security benefits. |
آخر اخبارنا
اهم الفاعليات لهذا الشهر
شهادات العملاء
من بين عدة انظمة للمحاسبة وقع اختيارنا على آفاق للمحاسبة لانه مناسب لطبيعة نشاطنا وانتشار فروعنا في مناطق مختلفة
آفاق للحسابات العامة نشكركم على هذا المنتج الرائع والي مزيد من التقدم والرقي لهذا المنتج الرائع
نقاط البيع واصدار الفواتير عبر نظام آفاق بالفعل هو الافضل مع تجربتنا لاكثر من نظام محاسبي كان آفاق الافضل من بينها
الشبكات الإجتماعية
الوسوم
تغريدات تويتر
-
web3jba @web3jba 4h
"برنامج محاسبة: برنامج محاسبة الى كل الشركات التى تقوم بمشاريع ذات تكاليف كثيرة لديك الان… https://t.co/Y9aiYAxLTN"
عرض التغريدة -
alkhateeb_groub @alkhateeb_groub 4h
"شاركنا باسم افضل برنامج محاسبة تعمل عليه ؟؟ مجموعة الخطيب للمحاسبة والتدقيق والتحكيم المالي والاستشارات الضريبية"
عرض التغريدة -
edara_arabia @edara_arabia 4h
"مجانا : برنامج #محاسبة متكامل هذا البرنامج يمكنك من تسجيل الدخل والمصروفات وعمل #ميزانية الشهرية والسنوية... https://t.co/hiWH94zgk3"
عرض التغريدة -
egydrem @egydrem 4h
"#إيجي_موب : برنامج حسابات رائع قد تدفع الكثير من المال فى برنامج معقد لن يفيدك فى شئ وقد تدفع القليل فى برنامج... http://t.co/mcFDTffZ7R"
عرض التغريدة