Apache overloaded with unwelcome requests: ?DoS attack

Posted on 2004-09-10
Last Modified: 2010-03-04
Our Apache 2.0.47 server is receiving a huge number of requests (average of a couple per second all day) for pages unrelated to the hosted websites. This was filling up the access_log and error_log with entries like: - - [10/Sep/2004:08:46:52 -0700] "GET HTTP/1.0" 200 18166 "-" "-"

I downloaded the latest patches (under Linux Mandrake 9.2) and the messages keep going but the server is now replying with a 403 (forbidden) message: - - [10/Sep/2004:10:30:45 -0700] "GET HTTP/1.1" 403 373

The current error_log messages:

[Fri Sep 10 10:28:14 2004] [error] [client] client denied by server configuration: proxy:

1) What is going on here? (Hacked...?)
2) With the 403 messages, the next entry is the return message size, usually about 0.5KB. Can I safely assume that the content is simply the "forbidden" message text - not some other stuff?
3) Can anything else be done to prevent the unwanted traffic?
4) Is more serious work needed - reinstalling?

The error_log has this "client denied by server configuration: proxy:" string. Is this related to the Apache settings? Should they be changed? Is the following the place to look/change:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^proxy:.*  -  [F]
    RewriteRule ^(.*\/perl\/.*)$  http://%{HTTP_HOST}:8200$1 [P]
    RewriteRule ^(.*\/cgi-perl\/.*)$  http://%{HTTP_HOST}:8200$1 [P]

I have tried adding lines to the hosts.deny file, but the number of IP addresses is too large.
The firewall only allows Web and SSH through. The server is set to listen on 80 and 443.

Question by:apgw
  • 3
  • 2

Expert Comment

ID: 12040423
As your title suggests, it sounds like a DOS attack, not a hack of your system.  In fact, it sounds like DDOS.

Here is a conceptual solution - let me know what you think.

The basic idea would be to not reply at all to the attacks.  Replying, even with 403, just shows them they reached you.
If you stop replying, the attacks may slow down.
At the least, it will have the attackers waiting for the replies instead of able to process and re-attack.
It would also remove a little load off your server.

You could try putting another server in front of the real one to just filter out the attacks, again, the idea is to remove load from your real server.

HTH - Cajun

Author Comment

ID: 12047565
Thanks for the comments. I am not sure how I would put in another server as a filter: would this be on the same machine? Also, upstream of the server is the router - maybe that is the place for a block of some kind, so that the packets don't reach the server at all. Currently it has the following firewall rules in place:

Description                                             Source   Destination              Protocol
"Allow Virtual Server FTP"                        WAN,*   LAN,   TCP,21
"Allow Virtual Server HTTP"                      WAN,*   LAN,   TCP,80
"Allow Virtual Server HTTPS"                    WAN,*   LAN,   TCP,443
"Allow SSH"                                            WAN,*   LAN,   TCP,22
"Allow to ping WAN port"                          WAN,*   LAN,   ICMP,8
"Allow msmsgs ( 14830) 34   *.*     LAN,   UDP, 14830 - 34041
"Allow msmsgs ( 7483) 209   *.*     LAN,   TCP, 7483 - 20957
"Deny Default"                                            *.*     LAN,*                      IP (0),*
"Allow Default"                                         LAN,*    *.*                         IP (0),*

The last 2 lines are not editable, but one can add new allow/deny lines.
Upstream of that is the Cisco switch. Possibilities here?

Expert Comment

ID: 12050975
It depends on the firewall.  Really, you need something more sophisticated than a simple firewall, because you want to block based on the message content, not the IP addresses (there were too many, you said).

As for putting a server upstream, I had in mind an actual physical server, so as to take the load off the real server.  It is your call as to whether the load is so damaging to your business as to make it worthwhile to put in another server.

I will look more into what you can do.  But being the object of a Distributed DOS attack is special - how did you achieve that?  You must have a popular website for someone to go to that trouble.

Author Comment

ID: 12087100
I am thinking that the site was found by some automated system because of the earlier hole in the security (it was returning 200 messages [OK]). Since installing the patches (it is now returning 400 messages) the traffic is slowing down slowly - instead of a few per second it is more like one every 2-3 seconds, as if our automated 'hacker' was counting refusals and dropping the requests after a certain period. So the impact on website page retrieval is now minimal.

I am surprised that no one else gave any suggestions on this question! Any other ideas?

Accepted Solution

CajunBill earned 300 total points
ID: 12090129
Sounds like you have it under control now.
If there is some other way I can help, let me know.

Other ideas:

This link talks about what you can do to avoid unknowingly being a source of attacks on others:

Here is a more recent document:

- Cajun

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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