Block certain user agents

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 41
Joined: 25 May 2012, 17:31

Block certain user agents

02 Sep 2015, 18:10

Hello,

My website has been falling victim to a ddos style attack. There are multiple IP addresses all creating search queries at the same time and bogging down the server. One common thing with them is the user agent string. Here are some examples:
(Windows+NT+5.2;+rv:2.0b13pre)+Gecko/20110304+Firefox/4.0b13pre
(Windows+NT+6.1;+Win64;+x64;+rv:2.0b11pre)+Gecko/20110129+Firefox/4.0b11pre
(X11;+Linux+x86_64;+rv:2.2a1pre)+Gecko/20110324+Firefox/4.2a1pre

they all have a similar pre version that I don't normally see.

Is there a way to block any of these with "pre" in the string?

User avatar
Posts: 41
Joined: 25 May 2012, 17:31

Re: Block certain user agents

03 Sep 2015, 13:49

After reviewing the logs this would also block legit people. What about this instead. I changed the name of the search page, but the bad IP addresses will keep hitting the old page for a while. Is there a way for me to automatically block those IP addresses or at least record them into a file?

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Block certain user agents

04 Sep 2015, 19:03

Hello Johnny,

>I changed the name of the search page, but the bad IP addresses will keep hitting the old page for a while.
>Is there a way for me to automatically block those IP addresses or at least record them into a file?

You may have the following rules to block:

RewriteCond %{REQUEST_URI} ^/old-search-page$ [NC]
RewriteRule .? - [F]

However, recording the IPs into the file is not something out software can do.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 24 guests