contents
##### ### ## ### ######## ### ## ### ###TM####### ####### ####### ######## ####### ####### ########## ### ### ### ### ### ### ### ### #### ## ## ## ### ## ## ## ## ##### ### ### ## ### ### ### ## ### ######### ####### ## ######## ### ####### ## ############ ### ## ######## ### ### ## #######Anti-Hammer Proprotect your valuable server resources for genuine clients..(c) 2004->tomorrow! corz.orgThanks to everyone who gave feedback on the betas!Itstory..0.9.8.2+ Improved checking for malformed referer information.0.9.8+ SEO-Aware "magic" index requests.0.9.7.*+ Added the ability to disable access for bad URL's, like /etc/passwd+ Added ability to validate User Agent strings, to protect againstknown bad bots, spiders and so forth.+ You can now also disallow access to client who send an empty useragent string.+ Added ability to ban IP Addresses from a simple IP Address list.0.9.6+ Added the ability to validate referers and white/black list goodand bad referers. There's a couple of new preferences (it's alwaysworth checking new versions of software for new preferences!) anda fair chunk of new code.Search from the top for 'validate_referers' for all the juicydetails.~ Fixed a bug where new visitors could have their hammer count set to/almost/ the first trigger level.0.9.5~ Minor fix for potentially logging error.0.9.4Enter Anti-Hammer Pro..+ The Data set used to create the individual client ID's can now beeasily configured (a simple list). You can use everything (thedefault), or else identify clients by a smaller set of data, evena single element, i.e. the IP address, which could be useful in anumber of situations.+ Improved documentation.~ Minor clean-ups and fixes.-=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=- -=-0.9.3.2The end of the line for Ant-Hammer FREE!+ You now have the option to perform a quick DNS lookup of theIP Address of bad clients, and have this added to the logging.This was already enabled, you now have the option to *disable* it,if required.+ Anti-Hammer now send a valid "Retry-After" header, which is set tothe client's current hammer delay + 1 second.+ Added a link to the Anti-Hammer page, should lessen the wtf-factor.0.9.2+ You can now choose whether to allow your specified clients (aka"exemptions") to either completely bypass anti-hammer (currentexemption method)..$anti_hammer['allow_bots'] = true;Or else specify an integer, representing a hammer_time, in1/100th Second, which will apply to *only* these clients..$anti_hammer['allow_bots'] = 50;This setting would enable your specified clients to hammer the siteat a rate of two hits-per-second, but no faster.Effectively, we now have two hammer rates, one for known goodclients, and one for everyone else.0.9+ Good bots & spiders can now be allowed to bypass the hammer. This isachieved through the use of standard spider IP lists, as publishedhere..http://www.iplists.com/along with a simple ini file, detailing which user-agent links towhich IP list. A working ini, and more details, will be included inthe preference section (above), as well as the release.0.8.*+ Anti-Hammer now sends a proper 503 (service temporarily unavailable)message, rather than a 200 OK message. This will be useful insituations where valid bots are temporarily hammering, and is morecorrect in this scenario. The reource *will* be back, if they cutout the crazy hammering!If you are running under cgi/*suexec (non-module), the extrarequired header is automatically sent.In use, this causes many bots to back-off immediately. Excellent!~ Improved the ban resetting (which needs to work independantly of theGarbage collection mechanism). After the ban time, the client'scut-off is wiped, and their start time set to *now*, just like a newclient, however, their hammer_count is set to one hammer below thefirst trigger level. In other words, a single hammer gets them theNO Hammer! page; and to the final page quicker than new clients.Even if you use rolling triggers, Anti_hammer will still use thefirst ban level to calculate this number, so set that to whateveryou want.~ ban_times and ban_levels have been renamed to waiting_times andtrigger_levels, to avoid confusion with the ban_time (for the newtotal cut-off). These also make more sense, as they are not bans,simply delays.0.7.*+ Added rolling ban times. Rather than have set limits which theclient can cross, this simply increments the ban time with each andevery hammer attempt. 1-2-3-4-5-6-7.. etc. cut-off still functionsas before for each system (rolling or preset levels).This was, in fact, the original system, which I replaced with thelevel presets early on, but it's kinda fun, and the code is simple.~ Removed the file-tools.php include statement, and put the functionsdirectly into here (slightly renamed). I figure anyone smart enoughto be including my file-tools, will be smart enough to figure outhow to put that back, if required.+ More things are configurable, like the page title. Why not!0.6.*+ Added capability to work with clients who do not accept, or havechosen not to accept (read: disabled) cookies.Basically, we write a "fake" session. The fake session uses aserialized array in a flat file, just like regular php sessions, andis created before they even get receive their first page. From thatpoint on, they are known (by Anti-Hammer) by this ID.The name of the client's session ID file is the session ID itself;an MD5 of all the known usable client data concatenated together.~ php session usage is still available as an option, if required.+ Added Garbage Collection for the fake session files. Both how oftenthis happens (every 'so-many' requests), and how old is considered"stale", are configurable.+ Ban time is now configurable (in hours). Remember to ensure thatGarbage Collection isn't happening before this time.+ Added penultimate message for cut-off. You get one *final* warning!~ Cleaned-up the code regarding sessions. We now make a clean break,converting whichever type of session data into a local array, andthen work with that. At the end, we write the pertinent data back towhichever type of session is being utilized (built-in or php).0.5.*+ You can now configure a cut-off point. When the number of violationsreaches this number, their pages simply die. This is disabled bydefault. This point is, of course, configurable. (actually, I gotcalled away in the middle of this, so I'll need to check how far Igot!)0.4.*+ Added user preferences for lots of the settings, voilation levels,times, etc. Added error checking for these, so they should be fairlyfoolproof (good movie, by the way, "Foolproof", 2003).0.3.*+ Added configurable protection skipping for certain file types(usually associated files and such). This replaces a nasty hack thatlived at the top of the script.+ Added skipping for generated images, too (GD images, etc.). This canalso be used to skip other tpyes. See the preferences for moredetails.+ Added configurable messages. I'll likely put this out eventually,it's kinda useful.0.2.*+ Added ignored areas, for chat scripts and such. places where eitherhammering is allowed, or is dealt with by the local script.*/