Skip to Content
Web Application Defender's Cookbook
book

Web Application Defender's Cookbook

by Ryan C. Barnett, Jeremiah Grossman
December 2012
Intermediate to advanced
552 pages
13h 16m
English
Wiley
Content preview from Web Application Defender's Cookbook
Recipe 14-3: Blocking the Client Source Address
This recipe shows you how to use ModSecurity to blacklist the client source address.
Ingredients
  • jwall tools
    • jwall-rbld
    • AuditConsole
  • ModSecurity
    • @rbl operator
    • setvar action
Carefully consider whether you should blacklist the source IP address of an identified attacker. The downsides of this approach involve issues of accuracy and persistence. An IP address does not uniquely equate to a particular user. If you block a client IP address, you may inadvertently also block other innocent users who happen to be using that IP address too. In addition, this type of blocking is merely a speed bump for the attacker. He can simply change the path of his attack traffic to go through another compromised site or proxy server. In addition to evasions, blocking based solely on client IP addresses may also impact non-malicious users who happen to be sharing a proxy server. This technique, however, is not totally without value, because it does potentially buy you a bit of time to regroup. You can use a number of different methods to block a specific client IP address.
IP Blacklisting in ModSecurity
The easiest method of blocking an IP address within ModSecurity is to use the OWASP ModSecurity Core Rule Set and simply set a variable within the IP-based persistent collection. The following rules in the modsecurity_crs_10_setup.conf file initiate the per-IP/User-Agent combination persistent storage using the initcol action:
# -- [[ Global ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Web Site Cookbook

Web Site Cookbook

Doug Addison
Web Application Development with PHP 4.0

Web Application Development with PHP 4.0

Tobias Ratschiller, Till Gerken, Zeev Suraski, Andi Gutmans

Publisher Resources

ISBN: 9781118417058Purchase book