Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 SQLServer DoS attack prevention
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dave.
Senior Member

USA
1037 Posts

Posted - 15 August 2004 :  01:08:35  Show Profile
Recently, on a forum I moderate we had a problem with a form of a DoS attack. What happened was that someone (With many proxies) sent 55 thousand requests for search.asp to search for one word. This generated so many queries on the SqlServer that the webhost shut down the database.

I'm currently trying to devise a solution to stop this from ever happening again. My first idea was to limit the number of searches per minute for a user, sort of like flood control for search.asp. But since this will still require a query on the SqlDb every time the page is run, then we are still open to the same attack.

So I'm wondering what everyone thinks here, I'd like to NOT disable searching for non-logged on users.

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 15 August 2004 :  02:42:07  Show Profile  Visit Gremlin's Homepage
It's probably not the most efficient, but I'd consider just using a Session Variable and record the time each search.asp is submitted and basically not let it run if there was less then 15 secs or something since the last time. Since you'd be using a session variable then it will limit basically each user without needing to pull anything from the database.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 15 August 2004 :  02:49:44  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Well a quick solution is to just check what the ip address is of the person running the search and if it matchs the previous search ip address then don't run the search. So for a example it would be like (and im very tired so I am sure the code is not 100% right)

if strIPAddress=Session("LastSearchIPAddress") Then
     Response.Redirect("http://www.google.com")
else
     Session("LastSearchIPAddress") = Request.ServerVariables("remote_address")
end if

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 15 August 2004 :  02:51:36  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Sorry I was thinking you should use the application variable not the session. The session would also work as Gremlin said above.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 15 August 2004 :  05:37:18  Show Profile  Visit HuwR's Homepage
If it wasn't for things like NIS it would be as simple as checking the referrer string when the form is posted, if the referrer wasn't your forums search.asp then it is a spoofed search
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 15 August 2004 :  08:46:29  Show Profile  Visit Nathan's Homepage
Brads method is flawed if your forum is slow, becuase one user could in theory search twice (5 minutes apart) and if no one tried to search in between the search would be rejected.

Treating it more like flood control, like Gremlin suggested, will work on either high traffic or slow forums.

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 15 August 2004 :  11:12:52  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Nathan is correct something I was not thinking about in the very late night morning.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Dave.
Senior Member

USA
1037 Posts

Posted - 15 August 2004 :  14:05:32  Show Profile
quote:
Originally posted by HuwR

If it wasn't for things like NIS it would be as simple as checking the referrer string when the form is posted, if the referrer wasn't your forums search.asp then it is a spoofed search



That was actually my first thought, but I'm a NIS user so... :/

I'm going to give the sessions a try, and maybe I'll look at the referrer mod too, thanks guys.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07