Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 2009 21:58:35 +0200
From:      Ruben de Groot <mail25@bzerk.org>
To:        Fabian Keil <freebsd-listen@fabiankeil.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: slowloris, accf_http and POST requests
Message-ID:  <20090623195835.GA95137@ei.bzerk.org>
In-Reply-To: <20090623172319.1343511f@fabiankeil.de>
References:  <20090622112607.GA80249@ei.bzerk.org> <200906220845.23920.npapke@acm.org> <20090622171516.GA82862@ei.bzerk.org> <20090622223556.GC76275@dan.emsphone.com> <20090623083930.GA90810@ei.bzerk.org> <20090623172319.1343511f@fabiankeil.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 23, 2009 at 05:23:19PM +0200, Fabian Keil typed:
> Ruben de Groot <mail25@bzerk.org> wrote:
> 
> > On Mon, Jun 22, 2009 at 05:35:56PM -0500, Dan Nelson typed:
> > > In the last episode (Jun 22), Ruben de Groot said:
> > > > 
> > > > My main concern here is if applying the trivial patch I posted would
> > > > break anything in the http protocol layer. And if not, why isn't the
> > > > POST method included in the http accept filter in the first place?
> > > 
> > > The filter wasn't designed to be an anti-DOS tool; it was an
> > > optimization to save some context switches at the beginning of every
> > > request.  POSTs are
> > 
> > I know this. But in this particular case, it *works* as an anti-DOS
> > tool. And a pretty good one too.
> 
> How did you verify this?

By using the slowloris script against my own servers.
Running the script from a single client pc:

./slowloris.pl -dns myserver.domain.tld -port 80 -timeout 2000 -num 500 -tcpto 5 -httpready

brings apache to its knees. No more connections are accepted as there
are allready MaxClients processes running (150) and they're all 
just sitting there waiting.
With accf_http just slightly adjusted as posted, nothing happens at all.
Apache just doesn't see the connections, even with multiple clients
running the DOS.
(Off course, there'll be memory buffers in the kernel filling, but
from that I haven't seen any negative side effects yet)

> accf_http doesn't require a complete request but will also
> pass the connection to the userland if its buffer is full.

Haven't seen that, but it sounds sane.

> If you continue to send headers that will happen eventually and if
> you're impatient, you simply have to send a bit more headers at the
> beginning to reach the application faster.

Yes. A real and prolonged DDOS is hard to counter. And the accept filter
was not designed for that. It was just an observation about this
particular script.

cheers,
Ruben




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090623195835.GA95137>