hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : EMERGENCY - Server being attacked via http
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

EMERGENCY - Server being attacked via http

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 06-01-2007, 05:24 PM
hostchamp hostchamp is offline
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.
Reply With Quote


Sponsored Links
  #2  
Old 06-01-2007, 05:49 PM
mwatkins mwatkins is offline
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.
Reply With Quote
  #3  
Old 06-01-2007, 06:20 PM
page-zone page-zone is offline
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.

Reply With Quote
Sponsored Links
  #4  
Old 06-01-2007, 06:47 PM
onthespot onthespot is offline
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

Reply With Quote
  #5  
Old 06-01-2007, 06:47 PM
pphillips pphillips is online now
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

Reply With Quote
  #6  
Old 06-01-2007, 07:01 PM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647
*

mwatking pls post the syntax for this?

Quote:
Originally Posted by mwatkins View Post
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.

Reply With Quote
  #7  
Old 06-01-2007, 07:03 PM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647
How do i do this?

Quote:
Originally Posted by page-zone View Post
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.

Reply With Quote
  #8  
Old 06-01-2007, 07:06 PM
hostchamp hostchamp is offline
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 View Post
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?

Reply With Quote
  #9  
Old 06-01-2007, 07:11 PM
hostchamp hostchamp is offline
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 View Post
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.

Reply With Quote
  #10  
Old 06-01-2007, 07:46 PM
page-zone page-zone is offline
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.
Reply With Quote
  #11  
Old 06-01-2007, 08:02 PM
page-zone page-zone is offline
Web Host
 
Join Date: Jun 2002
Posts: 1,787
Quote:
Originally Posted by hostchamp View Post
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

Reply With Quote
  #12  
Old 06-01-2007, 08:09 PM
Techark Techark is offline
Web Hosting Master
 
Join Date: Apr 2002
Location: Australia or US depends
Posts: 5,723

__________________
Techark Web Hosting
Cloud Servers and Managed Dedicated Servers with Live Proactive Monitoring
My Blog of Random Thoughts

Reply With Quote
  #13  
Old 06-01-2007, 08:17 PM
mwatkins mwatkins is offline
Web Hosting Master
 
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
Quote:
Originally Posted by hostchamp View Post
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.”

Reply With Quote
  #14  
Old 06-01-2007, 10:18 PM
tsj5j tsj5j is offline
WebHosting Master
 
Join Date: Dec 2006
Posts: 4,075
Quote:
Originally Posted by Techark View Post
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.

Reply With Quote
  #15  
Old 06-02-2007, 02:53 PM
Cool Surfer Cool Surfer is offline
Aspiring Evangelist
 
Join Date: Jun 2005
Location: Internet
Posts: 448
How to unblock Server IP

How do I unblock server IP. Whom do I email or contact?

__________________
www.xpindia.com hosting.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Authorities Seize Suspected Duqu Botnet Control Servers from Indian Web Host Web Hosting News 2011-11-01 14:33:21
Web Host iWeb Launches New Support Packages Web Hosting News 2011-10-12 21:07:41
Oracle is the Latest Vendor to Apply Patch for Apache Killer Flaw Web Hosting News 2011-09-19 14:43:58
Web Host Codero Improves Customer Control Panel Web Hosting News 2011-07-26 18:10:36
Spanish Authorities Arrest Three for Sony Playstation Network Hack, Get Hacked Web Hosting News 2011-06-13 17:40:27


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?