Solved

htaccess question

Posted on 2015-01-06
8
75 Views
Last Modified: 2015-01-23
Hello,

I am running a php server and keep getting thousands of requests for a .asp file that is clearly not on the server. I want to throw them off the site, it is crashing the server.

I have this as a rule in my htaccess:

RewriteCond %{THE_REQUEST} ^[A-Z]+\s([^\s]+)\.asp\s
RewriteRule .*$ http://127.0.0.1 [R=301,L]
RewriteRule ^(.*)\.asp$ http://127.0.0.1

Open in new window


but this address is still loading, I am guessing that it is because there is a variable, how can I block these too?

https://domain.com/sm_login.asp?SID=ot8klbtvok43ga6gvchl74pd56

Open in new window


Matt
0
Comment
Question by:movieprodw
  • 4
  • 3
8 Comments
 
LVL 13

Expert Comment

by:Ugo Mena
ID: 40533943
+FollowSymLinks must be enabled for any rules to work, this is a security requirement of the rewrite engine. Normally it's enabled in the root and you shouldn't have to add it, but it doesn't hurt to do so.

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.+)\.asp$ http://redirectToThisLink.html [R,NC]

Open in new window

0
 
LVL 62

Expert Comment

by:gheist
ID: 40534063
Server crashes for other reasons.
Serving 404 errors is very lightweight action within core.

There should be some other deficiency that makes server crash.
Please filter ASP 404 from error logs and check better stuff that may crash your server.
0
 
LVL 1

Author Comment

by:movieprodw
ID: 40534074
Not if you are using magento and the 404 page is a magento loaded page.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 62

Expert Comment

by:gheist
ID: 40534086
Is your apache using a lot of RAM?
0
 
LVL 1

Author Comment

by:movieprodw
ID: 40534088
Ultralites,

That did not work. The URL is still loading and showing the magento 404 page.

RewriteCond %{THE_REQUEST} ^[A-Z]+\s([^\s]+)\.asp\s
RewriteRule .*$ http://127.0.0.1 [R=301,L]
RewriteRule ^(.*)\.asp$ http://127.0.0.1

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.+)\.asp$ http://127.0.0.1 [R,NC]

Open in new window

0
 
LVL 1

Author Comment

by:movieprodw
ID: 40534097
gheist, the ram is very low but I am getting these DDoS style attacks where they are loading thousands of .asp?sid=xxxxxx urls and it is clogging up the bandwidth and using all of the ram
0
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 40534100
It is not DDOS. it is attempt to take over old ASP session (not ASPx), you are compeltely immune to the attack, though your apache configuration could wish better.
At least remove heavy 404 page provided by Magento - it serves no purpose, just does damage and grief.

Could you try to manage moving on to worker MPM and php-cgi linked with mod_fcgid? That will greatly reduce memory consumption - namely you will have small apache like with no modules, and few PHP backends of large RAM
0
 
LVL 1

Author Closing Comment

by:movieprodw
ID: 40565951
Thanks
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question