
06-01-2007, 05:24 PM
|
|
Web Hosting Master
|
|
Join Date: Aug 2002
Posts: 647
|
|
EMERGENCY - Server being attacked via http
my friend's server is being attacked, the http processes shoots up causing the server load to go above 200 in minutes of starting httpd which causes server to die.
this is how the apache web server's access_log would log a normal http request;
------------------------------------------------------
"xx.xxx.xx.xx - - [01/Jun/2007:22:13:21] "GET /folder/name.gif HTTP/1.1" 200 877 "http://www.domain.com/index.htm" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"
------------------------------------------------------
Today when the http load increased we saw hundreds of following requests;
------------------------------------------------------
"xx.xxx.xx.xx - - [01/Jun/2007:22:13:21] "GET /? HTTP/1.1" 200 16305 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
------------------------------------------------------
You see the difference between a legitimate http access log entry and the above one is that the legitimate one shows the filename(GET /folder/name.gif) and domain name being requested whereas the second one shows ("GET /?")
Above requests continously originate from 30 to 40 different ip addresses. Most of them russian ips, and many form US and canada to.
When i do a grep "GET /?" in access log there are thousands of these which started just today.
I cannot block each ips because i feel they have hundreds of IPs to initiate these requests from.
What to do?
Last edited by hostchamp; 06-01-2007 at 05:36 PM.
|

06-01-2007, 05:49 PM
|
|
Web Hosting Master
|
|
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
|
|
GET /? is simply an empty query string being passed to whatever code is handling the root "/" of your site. So in other words, you are seeing hundreds of requests to /.
Ordinarily this shouldn't be a problem, but if your site itself is resource heavy and already performance constrained, I guess I can see it happening.
What you could do is use the URL redirection feature of your web server to send off all such requests to a plain, simple, short, HTML error page, which ought to resolve your resource issue. Look up Redirect for your web server, and redirect any request that *exactly* matches "/?" and nothing else.
__________________
“Even those who arrange and design shrubberies are under
considerable economic stress at this period in history.”
Last edited by mwatkins; 06-01-2007 at 05:56 PM.
|

06-01-2007, 06:20 PM
|
|
Web Host
|
|
Join Date: Jun 2002
Posts: 1,787
|
|
If you know the domain being attacked you can change the dns from the servers IP to 127.0.0.1 and redirect the attackers to their own computer. The owner of the domain won't be happy, but either way the site isn't running. 40 ip's should be hard to block though.
|

06-01-2007, 06:47 PM
|
|
Junior Guru
|
|
Join Date: Dec 2003
Posts: 203
|
|
if its coming from a whole netblock just block the whole /8 example if ips are on a 60.x.x.x just block 60.0.0.0/8 at the firewall.
Russia most likely only has a few /8s block em all?
__________________
Linux VPS Hosting
Fully Managed VPS, Dedicated And Reseller Solutions.
Host Unlimited Domains
|

06-01-2007, 06:47 PM
|
|
Web Hosting Master
|
|
Join Date: May 2003
Location: California, USA, Earth
Posts: 930
|
|
If you don't have it already you should install APF firewall.
Then, just run: apf -d xxx.xxx.xxx.xxx
And the problem is solved, at least temporarily.
BFD works in conjunction with APF and is highly recommended also. While it wont auto block the http attacks, it will stop brute force attacks.
__________________
▌ Blesta - Professional Billing Software
▌ Innovation that benefits the user experience
▌ Trial - Demo | 866.478.7567 | Twitter @blesta
|

06-01-2007, 07:01 PM
|
|
Web Hosting Master
|
|
Join Date: Aug 2002
Posts: 647
|
|
mwatking pls post the syntax for this?
Quote:
Originally Posted by mwatkins
GET /? is simply an empty query string being passed to whatever code is handling the root "/" of your site. So in other words, you are seeing hundreds of requests to /.
Ordinarily this shouldn't be a problem, but if your site itself is resource heavy and already performance constrained, I guess I can see it happening.
What you could do is use the URL redirection feature of your web server to send off all such requests to a plain, simple, short, HTML error page, which ought to resolve your resource issue. Look up Redirect for your web server, and redirect any request that *exactly* matches "/?" and nothing else.
|
|

06-01-2007, 07:03 PM
|
|
Web Hosting Master
|
|
Join Date: Aug 2002
Posts: 647
|
|
How do i do this?
Quote:
Originally Posted by page-zone
If you know the domain being attacked you can change the dns from the servers IP to 127.0.0.1 and redirect the attackers to their own computer. The owner of the domain won't be happy, but either way the site isn't running. 40 ip's should be hard to block though.
|
|

06-01-2007, 07:06 PM
|
|
Web Hosting Master
|
|
Join Date: Aug 2002
Posts: 647
|
|
where can i find a list of all IP blocks for russia so i can just do a iptables /8 blocking?
Quote:
Originally Posted by onthespot
if its coming from a whole netblock just block the whole /8 example if ips are on a 60.x.x.x just block 60.0.0.0/8 at the firewall.
Russia most likely only has a few /8s block em all?
|
|

06-01-2007, 07:11 PM
|
|
Web Hosting Master
|
|
Join Date: Aug 2002
Posts: 647
|
|
I just have iptables which i use to block IPs.
If i have to block each IPs manually in APF then what is it's advantage over iptables?
Is there anyway if a IP hits my access_log x number of times in x number of miutes it gets blocked automatically for sometime?
Quote:
Originally Posted by wshost
If you don't have it already you should install APF firewall.
Then, just run: apf -d xxx.xxx.xxx.xxx
And the problem is solved, at least temporarily.
BFD works in conjunction with APF and is highly recommended also. While it wont auto block the http attacks, it will stop brute force attacks.
|
|

06-01-2007, 07:46 PM
|
|
Web Host
|
|
Join Date: Jun 2002
Posts: 1,787
|
|
/sbin/route add -host 217.160.208.134 reject
change that IP to an IP you want to block and it will be blocked until the next reboot.
Country blacklist
http://spamlinks.net/filter-bl.htm#ip-country
Last edited by page-zone; 06-01-2007 at 07:51 PM.
|

06-01-2007, 08:02 PM
|
|
Web Host
|
|
Join Date: Jun 2002
Posts: 1,787
|
|
Quote:
Originally Posted by hostchamp
Is there anyway if a IP hits my access_log x number of times in x number of miutes it gets blocked automatically for sometime?
|
Yes, if you have the connlimit module loaded. Someone else might have some sytax which would work. I don't.
Or google connlimit
|

06-01-2007, 08:09 PM
|
|
Web Hosting Master
|
|
Join Date: Apr 2002
Location: Australia or US depends
Posts: 5,723
|
|
|

06-01-2007, 08:17 PM
|
|
Web Hosting Master
|
|
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
|
|
Quote:
Originally Posted by hostchamp
mwatking pls post the syntax for this?
|
I don't read minds. What web server are you running? Apache? lighttpd? Cherokee? AOL? A custom Python or Ruby server?
Think logically; if you need to redirect a URL **pattern** then you'll need a tool which can do that.
For Apache 1.3.x and 2.x: mod_rewrite is one method.
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
I am also in agreement with adding a route for IP's or blocks if they fall within a block - reject the connection or route the return to localhost.
__________________
“Even those who arrange and design shrubberies are under
considerable economic stress at this period in history.”
|

06-01-2007, 10:18 PM
|
|
WebHosting Master
|
|
Join Date: Dec 2006
Posts: 4,075
|
|
Quote:
Originally Posted by Techark
|
I highly recommend this.
It blocks people with X number of connections open to the server at the same time.
To fend off DDoS attacks, simply set this to a lower number (say 20).
Then do a mod_evasive on Apache, and set it to 1 to 5.
Browers usually obey this mod_evasive after a few timeouts, so they won't be banned with < 20 connections.
DDoSers however won't stop after a few timeouts and will result in >20 connections and get blocked by the APF.
|

06-02-2007, 02:53 PM
|
|
Aspiring Evangelist
|
|
Join Date: Jun 2005
Location: Internet
Posts: 448
|
|
How do I unblock server IP. Whom do I email or contact?
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|