Webmaster Your Webmaster Resources Webmaster

Www Yourwebmasterresources R Your Webmaster Resources Webmaster Szh Recreation Centers Fairview Asp Your Webmaster Resources A Close to perfect .htaccess ban list - Part 3 Apache Web Server forum at WebmasterWorld

Www Yourwebmasterresources R Your Webmaster Resources Webmaster Szh Recreation Centers Fairview Asp Your Webmaster Resources


Www Webmaster esearchm searcho Recreation r Webmaster e Szh Asearchp Your e Your rh Szh s Www asearchc Www z Recreation esearchr Www h Your s Www Fairview S Centers e Centers r Webmaster h Fairview is Fairview a Centers c Www W Resources e Webmaster rsearchh Recreation asearchtsearchr Www




msg:1506453
 7:06 am on Nov 21, 2003 (gmt 0)
Yes, the information you provided was of great help. Thank you very much for sharing your knowledge, Wizcrafts. I really do appreciate it..

I will make sure to review this topic more thoroughly so that I get a better grasp on how .htaccess files work. Another thing I'll have to look into is what exactly my web host does and does not support.
jackson




msg:1506454
 4:41 am on Nov 24, 2003 (gmt 0)
Wow ... a man goes out after lunch, comes back for breakfast only to find that the whole menu's changed ...

Was looking over htaccess things back in February this year. 9 months and so many pages later (not to mention all the side branches) and we're almost looking at a different animal.

Quick question - where do error pages now fit into the htaccess scheme of things?

I'm putting in the finishing touches to a project - as in building on one of these CMS things. Thus far their htaccess file consists of the following lines:

ErrorDocument 400 /error.php?400
ErrorDocument 401 /error.php?401
ErrorDocument 403 /error.php?403
ErrorDocument 404 /error.php?404
ErrorDocument 500 /error.php?500

From all of the foregoing I should know where to put in most of the code. What I would like to find out, should the above lines appear at the beginning or be used at the end?
Wizcrafts




msg:1506455
 5:17 am on Nov 24, 2003 (gmt 0)
Jackson asked:
"Quick question - where do error pages now fit into the htaccess scheme of things?"

I personally have my error document redirects placed in the top section, before my deny from or Rewrite conditions or rules. I doubt that this matters to the interpreter, but it makes logical eyeball sense to me to see it first.

On the other hand, Rewrite Conditions and their associated RewriteRules should be placed in descending order based on their priority, so that the worst offenders can be blocked, or redirected as fast as possible, without having to parse the entire file to match a User Agent, Referer, or IP address. I accomplish this by placing all of my fixed IP deny from rules before the RewriteCond rules. The next section contains the Rewrite conditions, with the most serious threats dealt with at the top of the list, and the broad IP ranges and search query restrictions at the bottom of that group.

Wiz
jackson




msg:1506456
 4:01 am on Nov 25, 2003 (gmt 0)
wiz,

thanks for the follow up. Was thinking the same thing. Had it that way before but noticing that the "landscape" had changed some what and this wasn't mentioned or made obvious, ended up wondering what people were doing now.

Put the said file into action and it was doing its work right away. Will leave it serving up 403's for awhile to get a feel for what is happening out there before making changes and going the next step - as in putting in traps and the like. Thanks again.
Wizcrafts




msg:1506457
 4:34 am on Nov 25, 2003 (gmt 0)
Jackson and Synthetic;

In case you haven't been welcomed yet, welcome to WebmasterWorld!

I'm happy to hear that our collective advise is helping you fight off the Borg.

Your logs will help you to formulate the placement order of the rules. It is possible to have multiple RewriteRules, each ending in [L]. This means that if the condition matches that the rule is applied and processing halts there. That's why we try to move the worst offenders to the top of the list, or create special case rules for the likes of the FormMail spammers.

Another thing to watch is how many 403s you are serving. If the number becomes very high, and the custom 403 page is 2 or 3 kb, you might want to consider writing a smaller (100 -200 bytes) main 403 file that just says "Access Denied" and provide a link in it to another 403(b) page that offers explanations about your policies and restrictions. I have two 403 pages like that. Sometimes I end up 403-ing visitors who have inherited a dirty IP, and I offer an explanation to them as to why they were denied access.

Wiz
jackson




msg:1506458
 2:49 am on Nov 26, 2003 (gmt 0)
Wiz, I'll take a look at the 403 number in due course. At the moment I'm getting a "feel for things" on this new site. Been an interesting exercise.

Here is what seems to be a new one for the books. Well, a variation on a theme at least. Got this on my log today:

162.33.101.4 - - [25/Nov/2003:15:58:34 -0600] "POST /_vti_bin/_vti_aut/fp30reg.dll HTTP/1.1" 401 - "-" "-"

Needless to say this a frontpage thing. Have never used it and don't intend to. The web host provides fp extensions and I have left them in - to assess their merits and the "unwanted attention" they may receive.

The question that begs here is - if I put in that fp mod rewrite, will this stop this particular type of intrusion?

As an aside, didn't find anything here on fp30reg.dll. However, a search throws up reems on security exploits relating to the use of this particular file.
Wizcrafts




msg:1506459
 3:28 am on Nov 26, 2003 (gmt 0)
Jackson;
It looks like some script kiddie has just discovered a 2001 FrontPage buffer overrun flaw and is testing to see if he can find a vulnerable version. This is highly unlikely, as Microsoft pushed out patches for it in the early summer of 2001, with a lot of publicity.

The entry you quoted does not contain the needed 259+ byte data string to overflow the buffer. I guess the S.K. is first testing for the presence of FrontPage 2000, then, if it exists, he will test for a return value of the .dll file to see if it is the unpatched version (unlikely), and then send a 259 byte attack to try to bring down the stupidly unpatched server.

If you are worried about this attempted test for an exploit, and another one I just saw, just use this code:

RewriteCond %{} (MSOffice¦_vti¦sumthin) [NC,OR]
RewriteRule .* - [F]

Don't forget to replace the broken pipes with solid ones.

Happy hunting
Wiz

jackson




msg:1506460
 3:40 am on Nov 26, 2003 (gmt 0)
Wiz,

Thanks for getting back on this one so quickly.

Strange - have that item in as:

RewriteCond %{} ^/(MSOfficeŚ_vti) [NC,OR]

Do you think removing ^/ would have any effect?

On another matter, what's the verdict on LinkWalker. In the early sections of this thread it was included but seems to have disappeared off the "hotlist". Got hit by that as well.
jdMorgan




msg:1506461
 3:46 am on Nov 26, 2003 (gmt 0)
Regardless of any additional .htaccess code, you probably won't see a change in the server response. That's because according to the posted log entry, skiddie is getting a 401-Authorization Required response. Even with an additonal - [F] rule on that URI, the 401 is going to take precedence over 403-Forbidden.

Jim
qWww Yourwebmasterresources R Your Webmaster Resources Webmaster Szh Recreation Centers Fairview Asp Your Webmaster Resources A Close to perfect .htaccess ban list - Part 3 Apache Web Server forum at WebmasterWorld d Your Webmaster Resources iWww Yourwebmasterresources R Your Webmaster Resources Webmaster Szh Recreation Centers Fairview Asp Your Webmaster Resources A Close to perfect .htaccess ban list - Part 3 Apache Web Server forum at WebmasterWorld l Your Webmaster Resources