Forum Moderators: phranque

Message Too Old, No Replies

Block access based on query string

         

sun818

5:06 pm on Nov 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I saw this tip on another web site. I noticed in my raw logs that random IPs are trying queries with a common query string of adodb. I figure this is some sort of SQL injecting hack attempt? Anyway, I am going to try something like this in my .htaccess file. Is this very resource intensive?

RewriteEngine On

# Block access when 'custompluginfile' in querystring
RewriteCond %{QUERY_STRING} .*custompluginfile.* [NC]
RewriteRule ^(.*)$ $1 [F,L]

Samizdata

1:10 pm on Nov 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Untested, but I would have thought this should work:

# If query string contains "adodb"
RewriteCond %{QUERY_STRING} adodb
# Block it without mercy
RewriteRule .* - [F]

I would not expect resources to suffer.

...