Slashdot Mirror


Attack On a Significant Flaw In Apache Released

Zerimar points out a significant flaw in Apache that can lead to a fairly trivial DoS attack is in the wild. Apache 1.x, 2.x, dhttpd, GoAhead WebServer, and Squid are confirmed vulnerable, while IIS6.0, IIS7.0, and lighttpd are confirmed not vulnerable. As of this writing, Apache Foundation does not have a patch available. From Rsnake's introduction to the attack tool: "In considering the ramifications of a slow denial of service attack against particular services, rather than flooding networks, a concept emerged that would allow a single machine to take down another machine's web server with minimal bandwidth and side effects on unrelated services and ports. The ideal situation for many denial of service attacks is where all other services remain intact but the webserver itself is completely inaccessible. Slowloris was born from this concept, and is therefore relatively very stealthy compared to most flooding tools."

203 comments

  1. So slashdot... by santax · · Score: 5, Funny

    be prepared to feel the slashdot-effect yourself for once!

    1. Re:So slashdot... by jamie · · Score: 4, Informative

      We have a hardware load-balancer and a software reverse proxy (varnish) in front of our apache.

      I kinda doubt this would work on us.

      Note, I am not inviting anyone to try. It might work great for all I know :(

    2. Re:So slashdot... by Deagol · · Score: 1

      I was wondering the same thing as well. I run a small site with varnish on the front end. Anyone know how attacks like this work against servers behind a forward proxy?

    3. Re:So slashdot... by Anonymous Coward · · Score: 1, Interesting

      A beefy hardware load balancer won't save you from this unless the load balancer is in full HTTP proxy mode (which yours probably is). A different problem that's harder to deal with is slow reads on a dynamic content pages that are not cached (and won't be) and whose size is greater than the LB's 4 or 8K TCP buffer size.

    4. Re:So slashdot... by dominious · · Score: 1

      We have a hardware load-balancer and a software reverse proxy (varnish) in front of our apache.

      I kinda doubt this would work on us.

      Note, I am not inviting anyone to try. It might work great for all I know :(

      Thanks for the info! What a better way to find out than to post this on /. ?

  2. Re:Well its not just Apache by santax · · Score: 0

    I thought IIS wasn't affected by this? At least the current versions. But I sure hope there will be a fix very soon, cause this really is a big deal.

  3. Re:Well its not just Apache by The+End+Of+Days · · Score: 3, Informative

    You may have missed the 'not' in the summary there.

  4. Re:Well its not just Apache by Anonymous Coward · · Score: 0

    while IIS6.0, IIS7.0, and lighttpd are confirmed not vulnerable
    You didnt even read the summary?! Wow...

  5. Re:Well its not just Apache by segedunum · · Score: 1

    IIS is not vulnerable, as confirmed in TFAs and the summary. Seems as though a DoS attack has affected some peoples' eyes.

  6. What about ... by Anonymous Coward · · Score: 2, Funny

    Opera Unite?

  7. Re:Well its not just Apache by Anonymous Coward · · Score: 0

    RTFS

    "while IIS6.0, IIS7.0, and lighttpd are confirmed not vulnerable"

  8. WTH? This is an absolutely trivial attack by Rogerborg · · Score: 3, Insightful

    It's just holding sockets open; that's the "Hello, world!" of DOS attacks.

    I'm finding it hard to believe that Apache is genuinely vulnerable to this. Did nobody see it coming? For real?

    --
    If you were blocking sigs, you wouldn't have to read this.
  9. Why not IIS? by MBCook · · Score: 3, Interesting

    Why isn't IIS vulnerable? Does it just assume the headers are done after some amount of time? Does it have a limit to the number of headers it accepts?

    Can this even be fixed without technically breaking the protocol (since it sounds like what's going on is correct behavior, theoretically)?

    --
    Comment forecast: Bits of genius surrounded by a sea of mediocrity.
    1. Re:Why not IIS? by nicolas.kassis · · Score: 2, Interesting

      What I'm thinking, is this basically another time where those not vulnerable were actually not respecting the spec?

    2. Re:Why not IIS? by Opportunist · · Score: 4, Funny

      If the vulnerability is based on correct, standard conform behaviour of the server, I can see why IIS isn't susceptible to it.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    3. Re:Why not IIS? by Rogerborg · · Score: 0, Troll

      Yup. I'm further thinking that since this is such a stupidly trivial attack, that it was all that MS could think to defend against, and that no Apache developer believed that any self respecting attacker would stoop so low.

      --
      If you were blocking sigs, you wouldn't have to read this.
    4. Re:Why not IIS? by Amouth · · Score: 5, Informative

      unless you are using Session()'s in asp in IIS then one thread in IIS handles multiple connections.

      what this is doing is opening a connection (getting a thread to work it) and holding it open (keeping the thread busy) and just keep asking for new ones.

      it is very common (always i think) for Apache and allot of web servers to have a max thread's so that the site under heavy traffic doesn't open more connections than it can handle.

      where IIS also has a worker thread limit - there is no limit *(you can set one - but not on by default) on how many concurrent connections can be managed by a thread (and new incoming connections are passed to the thread with the lowest current work load - not always the one with less connections)..

      if you do what they are doing here i can see IIS behavior would be to slowly pile all these slow - no work connections into one thread and the others would happily go about doing actual work..

      where apache would slowly lose access to workable threads as this keeps them busy.

      this isn't an exploit on the http or tcp protocol - it is an exploit based on the behavior of the web server based on it's best practices for managing it.

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    5. Re:Why not IIS? by Anonymous Coward · · Score: 2, Informative

      More likely IIS survives because it uses a worker pool threading model (no thread/process is dedicated to a connection, so a connection only takes up memory for the state, not for the thread).

      Apache had, and probably still has, a process/thread-per-connection model.

      So with all due respect, it looks like a proper design decision is what is protecting IIS here:
      http://www.kegel.com/c10k.html
      http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/a63ee1c2-04d6-44dc-b4d6-678eb3117bf9.mspx?mfr=true

    6. Re:Why not IIS? by Malc · · Score: 5, Insightful

      Does the HTTP spec say anything about the server application timing out the connection? Seems like reasonable behaviour to me. I would be surprised if this isn't a configurable option in Apache too.

      People love to hate it, but IIS has matured in to a very good web server. It's my choice over Apache.

    7. Re:Why not IIS? by MBCook · · Score: 1

      Makes sense.

      But wouldn't you run into the connection limit of the OS at some point? Or is that just way too high to be a practical problem (say 16 million)?

      --
      Comment forecast: Bits of genius surrounded by a sea of mediocrity.
    8. Re:Why not IIS? by CarpetShark · · Score: 1

      IIS has matured in to a very good web server.

      Yes, but which one?

    9. Re:Why not IIS? by Amouth · · Score: 1

      well the connection limit for a single host is the number of available ports for outbound traffic (to return data to the client)

      by default (from memory here) i want to say IIS is set up to use ~4k ports for outbound - i do know that can be changed to allow ports 1024+ to be used meaning the number of avaliable ports would be ~64.5k

      and that is per host ip - and unless you have the site bound to a specific host ip address (instead of using site headers - iis will respond on an alternate ip (if it has one) when another is out of ports (infact i think it round robbins - i can't remember)

      Where this could be a problem for iis is with SSL as SSL has to be bound to an IP and the max amount of ports for that IP is going to be less than the number of ports that the client can send from. So yes this type of exploit could cause an outage in IIS - it is much less likely (based on default config) than apache - and is only realistically likely when trying to attack an SSL supporting site. (like they are hard to find)

      About the only IIS server that this is going to bring down is the small personal or single server setups used by small biz. any type of clustered hosting or even virtual hosting - the worst case is that someone can block SSL connections to a site (unless the whole server is horridly configured - which we never ever can leave out of the equation - but even then with IIS6+ it would take effort to make your server very vulnerable to this)

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    10. Re:Why not IIS? by raju1kabir · · Score: 1

      unless you have the site bound to a specific host ip address (instead of using site headers - iis will respond on an alternate ip (if it has one) when another is out of ports

      How would that be of any use? The client on the far end is directing incoming traffic based on source IP (among other characteristics). TCP packets that arrive from random IPs are discarded.

      --
      "Patriotism is your conviction that this country is superior to all other countries because you were born in it." -- GBS
    11. Re:Why not IIS? by Bemopolis · · Score: 5, Funny

      Why isn't IIS vulnerable

      My guess is that the DoS attack is so slow that, by the time it would have completed, the server has already crashed for a different reason.

      --
      "I guess the moral of the story is, don't paint your airship with rocket fuel." -- Addison Bain
    12. Re:Why not IIS? by Amouth · · Score: 1

      the incoming traffic is always going to IP:80

      the return traffic from IIS is going coming from avaliable Ips':port

      if you bind a website in IIS to an ip instead of "any avaliable ip" then the return tcp connection is forced to be sorced from the ip that is also the reciving

      if you have it set to "any avaliable ip" and the box has 2 ip's your client may request data on IPA:80 and get a reply from IPB:port

      there for your avaliable ports for reply (limiting the max connection's) would be MaxPorts* Available IP's.

      give a Host 2 ip's and it has more ports than the attacking client (assuming a single attacker) bind the site to an ip and now the attacker has more ports than the host so it will work (this is going to be a given for SSL sites as they don't support host headers)

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    13. Re:Why not IIS? by raju1kabir · · Score: 3, Informative

      if you have it set to "any avaliable ip" and the box has 2 ip's your client may request data on IPA:80 and get a reply from IPB:port

      If a client sends a SYN to 10.1.1.1:80 and gets an SYN-ACK from 10.5.5.5:80 then the client will not associate the two as being related, and will keep waiting for a response from 10.1.1.1:80 until timing out.

      You would need to have some sort of DNS arrangement that encouraged clients to make their requests to your various IPs. You can't just respond from a different IP than the client contacted.

      --
      "Patriotism is your conviction that this country is superior to all other countries because you were born in it." -- GBS
    14. Re:Why not IIS? by amicusNYCL · · Score: 1

      no Apache developer believed that any self respecting attacker would stoop so low.

      That's a brilliant approach to security.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    15. Re:Why not IIS? by amicusNYCL · · Score: 1

      Is it really correct and standard to hold a session open for a client that isn't sending any data, while excluding other clients in the process? Where in the spec does it say to do that?

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    16. Re:Why not IIS? by Timothy+Brownawell · · Score: 1

      well the connection limit for a single host is the number of available ports for outbound traffic (to return data to the client)

      A TCP connection is identified by the source IP:port and destination IP:port. Your web server typically will listen on only one port (80) and probably on a single IP, and TCP has 64k ports available. So, the theoretical limit is 64k connections from each and every computer with a routable IP address. Which is completely insane, so what really matters are the limits your OS puts on how many open sockets/file descriptors there can be (per process, or across the entire system), and if that's high enough then things like how much memory your OS+webserver consumes per open connection.

    17. Re:Why not IIS? by RollingThunder · · Score: 1

      It may be that once they hit 90% of the session limits, that it starts killing off the longest-idle sessions.

    18. Re:Why not IIS? by PitaBred · · Score: 1

      Doesn't IIS leave sessions "half open" generally? Some kind of IE accelerator trick? Or did they stop doing that?

    19. Re:Why not IIS? by Anonymous Coward · · Score: 1, Informative

      That's great, but others like myself have been burned too many times with hacked IIS boxes to ever return. Thanks but fool me once... or something like that..

    20. Re:Why not IIS? by shutdown+-p+now · · Score: 1

      I'm further thinking that since this is such a stupidly trivial attack, that it was all that MS could think to defend against, and that no Apache developer believed that any self respecting attacker would stoop so low.

      Or maybe they're relying on the attacker correctly setting the evil bit as per the specification, while Microsoft is flagrantly ignoring the spec as usual.

    21. Re:Why not IIS? by shutdown+-p+now · · Score: 1

      A TCP connection is identified by the source IP:port and destination IP:port. Your web server typically will listen on only one port (80) and probably on a single IP, and TCP has 64k ports available. So, the theoretical limit is 64k connections from each and every computer with a routable IP address.

      Not really. Yes, the server application listens at a specific IP:port - typically 80 in case of HTTP. However, when you accept() a client connection on the socket you're listening on, you get a new socket for that connection, which is associated with a new, unique port on the server. So you can only have as many client connections on the server as you have ports.

    22. Re:Why not IIS? by KingMotley · · Score: 1

      You were right up until you said new unique port. That is incorrect. You remain on the same port, but on a new socket.

    23. Re:Why not IIS? by KingMotley · · Score: 1

      Your understanding of how TCP connections work is very flawed.

      well the connection limit for a single host is the number of available ports for outbound traffic (to return data to the client)

      Incorrect.

      by default (from memory here) i want to say IIS is set up to use ~4k ports for outbound - i do know that can be changed to allow ports 1024+ to be used meaning the number of avaliable ports would be ~64.5k

      Sort of, but you are talking about the ports a client a may to establish a connection to a server. This has no use at all for a server that is already bound to a single port.

      and that is per host ip - and unless you have the site bound to a specific host ip address (instead of using site headers - iis will respond on an alternate ip (if it has one) when another is out of ports (infact i think it round robbins - i can't remember)

      Incorrect. If the server were to respond on a different IP (or port for that matter) than the one the client initially requested, it would be discarded.

      Where this could be a problem for iis is with SSL as SSL has to be bound to an IP and the max amount of ports for that IP is going to be less than the number of ports that the client can send from. So yes this type of exploit could cause an outage in IIS - it is much less likely (based on default config) than apache - and is only realistically likely when trying to attack an SSL supporting site. (like they are hard to find)

      Completely incorrect. SSL does not *HAVE TO* be bound to an IP (although it usually is). The max ports is irrelevant, it will only use one. No, IIS wouldn't be vulnerable. The rest is garbage.

      About the only IIS server that this is going to bring down is the small personal or single server setups used by small biz. any type of clustered hosting or even virtual hosting - the worst case is that someone can block SSL connections to a site (unless the whole server is horridly configured - which we never ever can leave out of the equation - but even then with IIS6+ it would take effort to make your server very vulnerable to this)

      Incorrect.

    24. Re:Why not IIS? by Anonymous Coward · · Score: 0

      ZING!

      Thanks OSS Greg! :D

    25. Re:Why not IIS? by wjsteele · · Score: 0, Flamebait

      I guess that's a good thing... you've raised the level of compentence of IIS Admins by leaving. Thanks, Bill

      --
      It's my Sig and you can't have it. Mine! All Mine!
    26. Re:Why not IIS? by DavidTC · · Score: 1

      Apache only times out when it isn't 'making progress'. There's no way to say 'I don't care if they're still doing stuff, if they haven't finished making a request in X seconds close the connection'.

      --
      If corporations are people, aren't stockholders guilty of slavery?
    27. Re:Why not IIS? by Amouth · · Score: 1

      the iis worker proccess when accepting a connection goes ahead and establishes a server side out bound port to talk back to the client

      and yes iis will send info out one ip that was sourced on a diffrent - and it will lie about the source.. trust me if you do multi home without BGP and your up stream providers actualy check header info you will see this happen.

      my logic isn't flawed - it just how iis behaves - and the whole conversation on this branch is WHY apache is vulnerable and why IIS isn't (or at least not normally)

      and as for SSL being bound to an IP your right it doesn't have to be a single ip it can be a range. BUT if you are hosting more than a single SSL site on the same server you must assign each one their own ip(s) instead of using the "any available" option under iis - which limits the number of available address and there for ports for it to source a reply from

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    28. Re:Why not IIS? by RiotingPacifist · · Score: 1

      While i agree that its a by choice that IIS (rather than fluke) is immune to this, i disagree that the worker-pool threading model is superior. It has advantages in terms of performance (somewhat limited on a modern os) but is both more complex and less secure (theoretically anyway, although implementation (see complexity) counts more)).

      --
      IranAir Flight 655 never forget!
    29. Re:Why not IIS? by Bargeld · · Score: 1

      @Amouth:
      This is just completely wrong. WTB mod points...

      Seriously man, fire up a sniffer and try it, see for yourself.

      --
      "I hate to advocate drugs, alcohol, violence, or insanity to anyone. But they've always worked for me." --Dr. Hunter S.
    30. Re:Why not IIS? by KingMotley · · Score: 1

      the iis worker proccess when accepting a connection goes ahead and establishes a server side out bound port to talk back to the client

      No, it doesn't, and it won't. Please test this yourself before coming back and arguing this again.

      and yes iis will send info out one ip that was sourced on a diffrent - and it will lie about the source.. trust me if you do multi home without BGP and your up stream providers actualy check header info you will see this happen.

      No, it won't. I am currently multi homed across many networks, and I tell you without a doubt that is incorrect. You are most likely confusing the difference between a network interface and an IP address.

      my logic isn't flawed - it just how iis behaves - and the whole conversation on this branch is WHY apache is vulnerable and why IIS isn't (or at least not normally)

      Yes, this whole conversation is why apache is vulnerable and IIS isn't, but the reasons you gave are wrong.

      and as for SSL being bound to an IP your right it doesn't have to be a single ip it can be a range. BUT if you are hosting more than a single SSL site on the same server you must assign each one their own ip(s) instead of using the "any available" option under iis - which limits the number of available address and there for ports for it to source a reply from

      Again, a very limited view of what happens, but mostly correct. "it can be a range" is incorrect, as you yourself say, it can be "any available", which is not a range. So you've contradicted yourself. The most common behavior is to assign each site their own IP address, but that is only so that you can use the default incoming port. You CAN assign multiple sites to the same IP address, each residing on it's own port, and things will function just fine. Unfortunately, poorly designed (likely corporate) firewalls may refuse to connect to that port, but that's another issue.

    31. Re:Why not IIS? by Anonymous Coward · · Score: 0

      Too bad for you it only runs on a toy operating system.

    32. Re:Why not IIS? by Anonymous Coward · · Score: 0

      the incoming traffic is always going to IP:80

      the return traffic from IIS is going coming from avaliable Ips':port

      You better go read about how tcp works, because clearly you don't have a clue.

  10. Why isn't IIS affected? by Anonymous Coward · · Score: 0

    Does it timeout the HTTP header from the initial open or what?

  11. Boring by Anonymous Coward · · Score: 5, Insightful

    Talk about a boring exploit: no chance for expanding the attack into anything other than a DOS, and if it becomes widespread enough, fairly trivial to fix... (just kill the oldest waiting client that does not have a full header when the last client is taken.) I'd be embarrassed to publish something like this....

    1. Re:Boring by 42forty-two42 · · Score: 1

      Surely it's far more embarrassing for the person on the receiving end of the attack.

    2. Re:Boring by aztektum · · Score: 1

      I'd be embarrassed to publish something like this....

      Says the Anonymous Coward

      --
      :: aztek ::
      No sig for you!!
    3. Re:Boring by Anonymous Coward · · Score: 0

      Meh, slightly. It's a minor design bug, and one that will be negated by the smarter firewalls out there. Allowing hundreds of open TCP connections from one source to a web server is very rarely a good idea.

    4. Re:Boring by Anonymous Coward · · Score: 0

      Unless the source is AOL. Lots of sites would lose a lot of revenue if the army of AOL users couldn't access their site. Their super proxies throw a wrench into this concept. Of course there are tons of sites that couldn't care less about AOL users too, so for them that's a perfectly reasonable solution.

    5. Re:Boring by amicusNYCL · · Score: 1

      fairly trivial to fix ...
      I'd be embarrassed to publish something like this

      So why isn't it fixed? Let me guess: it's a case of all of the Apache developers saying "you have access to the code, you fix it, it's trivial."

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    6. Re:Boring by LingNoi · · Score: 2, Interesting

      No, no they wouldn't.

      However like what normally happens whenever some Linux exploit comes out. It's something ridiculously trivial to fix and the windows crowd on slashdot lap it up like it is an "end of the world" scenario. Congratulations on continuing the trend.

    7. Re:Boring by The+End+Of+Days · · Score: 1

      Seems like what really happens is the rabid defenders run in to distract from the issue with lame bullshit about Microsoft being worse anyway. Congrats on jumping on that trend yourself.

    8. Re:Boring by LingNoi · · Score: 1

      I never said Microsoft was worse. You made that up.

    9. Re:Boring by RiotingPacifist · · Score: 1

      Yeah either that or only just fucking heard about this DOS and its gone on the bottom of a fairly long todo list. And while its a fairly lame attack its down to a minor design flaw, so it will require more work than GP suggests. I also get the impression that the problem is that Apache is trying to do too much, prevent the server demanding too much from the OS by limiting processes, when the OS should prevent Apache from doing that itself, but hey I'm the sort of noob that still thinks DDOS/DOS is a firewall problem not a server problem.

      --
      IranAir Flight 655 never forget!
  12. iptables helps by samjam · · Score: 4, Informative

    You can have perlbal or any reverse proxy on the same machine but listening on a different port and then use iptables to redirect like this

    # iptables -t nat -A -PREROUTING -d ! 127.0.0.1 -p tcp -m tcp --dport 8080 -j REDIRECT --to-ports 80

    and then you don't need to change your apache configuration - and having apache listen on a different port to what users see can break some scripted sites if they read the port number from the apache config.

  13. Seems to be a general problem. by Z00L00K · · Score: 4, Insightful

    And the only resolution right now that I can see is to have a connection timeout.

    At least the problem is a denial of service problem and not a problem with intrusion so the damage is easily rectified - restart the web server. Not that you really want to restart it.

    And I suspect that other services can be vulnerable to this type of attack too, not only web servers.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    1. Re:Seems to be a general problem. by Rogerborg · · Score: 1

      the damage is easily rectified - restart the web server

      And you get raped again as soon as it comes back up. How does restarting it help?

      --
      If you were blocking sigs, you wouldn't have to read this.
    2. Re:Seems to be a general problem. by sjames · · Score: 2, Interesting

      A connection timeout should be fine. Just start the clock upon accept(). Give the client a generous but limited amount of time to send headers. If the timer expires before the empty line is received, close the connection.

      Bonus points for not getting the thread pool involved until the header is complete.

      Extra credit for a config option to send a flood of junk to the client and THEN close the socket. That could make attackers considerably more visible to their upstream provider.

    3. Re:Seems to be a general problem. by sjames · · Score: 2, Interesting

      Nothing like replyoing to yourself.

      Double extra credit if the junk you send back looks enough like downloading music that the RIAA accidentally joins the forces of good and comes down on the attacker due to ISP snooping but not enough like downloaded music to get you actually busted.

    4. Re:Seems to be a general problem. by TheLinuxSRC · · Score: 1

      It will take some time to ramp up the used connections again (assuming that, as the article states, this exploit is fairly slow). While certainly not a real fix, this could be an effective temporary solution until a better solution is available.

    5. Re:Seems to be a general problem. by Anonymous Coward · · Score: 0

      At least the problem is a denial of service problem and not a problem with intrusion so the damage is easily rectified

      That's not necessarily true. As another blog post (linked to from TFA) points out, DoS attacks can be used to facilitate intrusions in cases where timing is of importance or used as a diversion.

    6. Re:Seems to be a general problem. by micheas · · Score: 1

      Fairly slow has been under a minute on most of the servers I tested it on.

      Fortunately my servers are configured to be able to run either lighttpd or apache. (in case I have a problem with one.)

      So I can pick my poison.

    7. Re:Seems to be a general problem. by amicusNYCL · · Score: 1

      the damage is easily rectified - restart the web server

      Good idea, mitigate a DoS attack by taking the server offline.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    8. Re:Seems to be a general problem. by Anonymous Coward · · Score: 0

      Also, the whole point of this vulnerability is the ability for a single computer to be able to do the damage. It's not hard to mitigate a single IP Address in iptables. Sure, the Attacker will just swap to using a proxied IP, but restarting the server would be necessary to get the log entries to reveal the information necessary to ban the user.

      It's a war of escalation that the sys admin cannot win without an underlying permanent fix.

    9. Re:Seems to be a general problem. by Hurricane78 · · Score: 1

      Well, then reinstall!

      And if that does not help, buy a new computer!

      It's the Windows philosophy! It can't be wrong! :P

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
  14. Other Web Servers....Proxies......? by segedunum · · Score: 1
    Could you potentially get around this if you're proxying to another web server, say lighttpd or Mongrel, or will this just blanketly affected Apache if you have it in front? I'm gathering the latter from the article:

    At the moment I'm not sure what can be done in Apache's configuration to prevent this attack - increasing MaxClients will just increase requirements for the attacker as well but will not protect the server completely. One of our readers, Tomasz Miklas said that he was able to prevent the attack by using a reverse proxy called Perlbal in front of an Apache server.

    Nginx is a threaded web server and the new darling on the block for people on VPSs and looking for a fast an low resource web server. I wonder how that fares?

    1. Re:Other Web Servers....Proxies......? by natbudin · · Score: 2, Informative

      I just tried it against nginx 0.6.37. The attack appears to work there as well.

    2. Re:Other Web Servers....Proxies......? by sakti · · Score: 1

      > Nginx is a threaded web server...

      I thought nginx was strictly an async based server like lighttpd? Every resource I find states this and the 2 are often compared due to this.

      --
      "It is better to die on one's feet than to live on one's knees." - Albert Camus
  15. Possible work-around by Norsefire · · Score: 3, Interesting
    From the source:

    if ( $delay < 166 ) {
    print <<EOSUCKS2BU;
    Since the timeout ended up being so small ($delay seconds) and it generally
    takes between 200-500 threads for most servers and assuming any latency at
    all... you might have trouble using Slowloris against this target. You can
    tweak the -tcpto flag down to 1 second but it still may not build the sockets
    in time.
    EOSUCKS2BU
    }

    Lower Apache's timeout to below 166 seconds.

    1. Re:Possible work-around by Bootvis · · Score: 5, Funny

      The thing that is really amazing about this hack: Human readable perl!

      --
      Read, refresh, repeat.
    2. Re:Possible work-around by dword · · Score: 1

      If you understand "EOSUCKS2BU", you need to get laid.

    3. Re:Possible work-around by Anonymous Coward · · Score: 2, Funny

      Sex makes people stupid?

    4. Re:Possible work-around by amicusNYCL · · Score: 1

      Why would you ever need a timeout that high? When is a 30 second timeout not enough?

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    5. Re:Possible work-around by Anonymous Coward · · Score: 0

      If you have any system that requires the ability to upload, then it's a race against the timeout.

      That simple enough for you?

    6. Re:Possible work-around by KingMotley · · Score: 1

      Many many times, actually.

    7. Re:Possible work-around by amicusNYCL · · Score: 1

      It sounds like Apache needs more than one timeout, then. Sitting there with an open connection with no data going through and receiving a stream of post data are two different situations that should be handled differently. A timeout for when the connection is essentially open but idle should not come into play when the server receives a content-length header and is receiving data that hasn't reached the content length yet.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    8. Re:Possible work-around by amicusNYCL · · Score: 1

      ..but you can't give an example?

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    9. Re:Possible work-around by Anonymous Coward · · Score: 0

      30 seconds may be enough for YOU, but there's two of you involved when you're in..... wait..... what were we talking about?

    10. Re:Possible work-around by KingMotley · · Score: 1

      I could, but I didn't.

  16. Re:Well its not just Apache by El_Muerte_TDS · · Score: 1

    Wait, you mean the summary on /. is finally correct!?
    So... I did see a pig fly past the windows.

  17. OpenBSD's pf has some mitigation features by possible · · Score: 2, Informative

    OpenBSD's pf firewall has some options that can help mitigate the "single attacker, single source IP" version of this attack. Of course if the attackers decide to spread the attack out over multiple source IPs like a DDoS, this becomes much harder to deal with until Apache has a patch.

    Filter rules that create state entries can specify various options to control the behavior of the resulting state entry. The following options are available:

    max number Limit the maximum number of state entries the rule can create to
    number.
    If the maximum is reached, packets that would normally create state
    fail to match this rule until the number of existing states decreases
    below the limit. no state Prevents the rule from automatically creating a state entry. source-track This option enables the tracking of number of states created per
    source IP address.

    The total number of source IP addresses tracked globally can be
    controlled via the

    src-nodes runtime option.

    max-src-nodes number When the source-track option is used,
    max-src-nodes will limit the number of source IP addresses that
    can simultaneously create state.
    This option can only be used with source-track rule. max-src-states number When the source-track option is used,
    max-src-states will limit the number of simultaneous state
    entries that can be created per source IP address.
    The scope of this limit (i.e., states created by this rule only or
    states created by all rules that use source-track) is dependent
    on the source-track option specified.
    1. Re:OpenBSD's pf has some mitigation features by Anonymous Coward · · Score: 0

      How about something useful like iptables instructions.

    2. Re:OpenBSD's pf has some mitigation features by santax · · Score: 1

      Why don't you go ask that on the openbsd maillist? Be sure to use the Anonymous Cowardon name though, for extra lulz.

    3. Re:OpenBSD's pf has some mitigation features by El_Muerte_TDS · · Score: 2, Informative

      Something like:

      iptables -I INPUT -p tcp --dport 80 -m state --state NEW -m recent --update --seconds 60 --hitcount 5 --rttl --name SSH -j DROP

      limits to 5 new connections per 60 seconds

    4. Re:OpenBSD's pf has some mitigation features by raju1kabir · · Score: 3, Interesting

      Many browsers will open more connections than this, resulting in "broken" image links on pages. I've tried all kinds of connection limits to protect against simple DOS attacks, but always have problems with corpororations whose standard desktop configs include IE/Firefox set to open way more connections than would be polite.

      It becomes politically challenging to cause those users to have a problem, especially since they don't see it with other sites. The perception is always that my server has a problem, and it doesn't matter how clearly I explain what's actually happening and how inappropriate it is to have 1000 PCs all set to open 30 connections to each web site they visit.

      --
      "Patriotism is your conviction that this country is superior to all other countries because you were born in it." -- GBS
    5. Re:OpenBSD's pf has some mitigation features by Anonymous Coward · · Score: 1, Interesting

      Since OpenBSD's version of httpd is basically a fork of regular Apache, has anyone tested this against OpenBSD's httpd?

    6. Re:OpenBSD's pf has some mitigation features by garaged · · Score: 1

      a standard HTTP page this days makes something around 20 connections per page

      Than would break a lot of pages, most of them

      --
      I'm positive, don't belive me look at my karma
    7. Re:OpenBSD's pf has some mitigation features by Anonymous Coward · · Score: 0

      I thought browsers were limited (by default) to 2 connections.

    8. Re:OpenBSD's pf has some mitigation features by Anonymous Coward · · Score: 0

      Why would you think that?

    9. Re:OpenBSD's pf has some mitigation features by PitaBred · · Score: 1

      Blame the jackasses who spew those Ups yur pipelines! Firefox tweaks all over the 'net.

    10. Re:OpenBSD's pf has some mitigation features by jargoone · · Score: 1

      Maybe because it's (usually) true.

    11. Re:OpenBSD's pf has some mitigation features by VGPowerlord · · Score: 1

      Perhaps because they read the HTTP/1.1 specification, section 7.1.4, the line that reads "A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy."

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    12. Re:OpenBSD's pf has some mitigation features by VGPowerlord · · Score: 1

      Sorry, section 8.1.4. I was looking at the draft of the RFC to replace RFC2616 rather than RFC2616 itself when I wrote this.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    13. Re:OpenBSD's pf has some mitigation features by shallot · · Score: 1

      [...OpenBSD pf...]

      How about something useful like iptables instructions.

      Heh. Anyway, you can use the connlimit module:

      iptables -A INPUT -p TCP --syn --dport www \
      -m connlimit --connlimit-above 5 \
      -j REJECT --reject-with tcp-reset

  18. Re:[Sounds Stupid] by segedunum · · Score: 2, Interesting

    Having read this more this just strikes me as incredibly stupid. Did they publish this? Surely we're just talking about a timeout implementation here where the web server will say "Ahhhh, well you didn't complete that header, bye, bye"?

  19. Re:Well its not just Apache by sys.stdout.write · · Score: 3, Funny

    I'm just waiting for a "Get The Facts" campaign for "IIS vs Apache" on the Microsoft website, along with a completely accurate comparison chart!

  20. Our system may be safe by cjb-nc · · Score: 3, Interesting

    Obviously need to verify this, but we already run mod_cband with a per-IP connection limit of 5. This is in place to stop the over-zealous "download accelerators" from taking all our connections and DOS'ing us. I expect it would stop a single attacker using this attack, but we'd still be vulnerable to a concerted attack by MaxChildren/5 IPs.

    1. Re:Our system may be safe by id · · Score: 2, Informative

      mod_cband has been tested and doesn't have any effect.

  21. Lingering connections handling by moon3 · · Score: 3, Insightful

    If you keep lingerers for more then 160 seconds then no wonder this is possible.

    It should be non-issues on better designed servers that keep an eye on connections anyway. Any single IP spawning lots of unfinished connections gets flagged fast and remembered for the future, so it will get limited access and bandwidth, marked as abuser etc. This is serving 101.

    1. Re:Lingering connections handling by FrozenGeek · · Score: 1

      That creates the possibility of a new form of attack. Consider a website for a local business (pizza joint, etc). I have DHCP from the main ISP in the area. I attack the business's server using the attack from the article. The business flags my IP. I request a new IP from the ISP and do it all over again. Repeat ad nauseum. All those IPs that the business flagged because of me now get limited access at that server. But I'm not using those IPs. Other customers of the ISP (and the local business) are using them - with limited access.

      --
      linquendum tondere
    2. Re:Lingering connections handling by mindstrm · · Score: 1

      In most cases you won't get a new IP - you'll get the same one.

    3. Re:Lingering connections handling by HeronBlademaster · · Score: 1

      Quite true. In a year of DHCP on my fiber service back in Utah, my IP only changed once - and that's because the network changed ownership (and therefore a new IP range was used). This sort of thing is the norm for always-on connections; you can't go changing your customers' IP addresses mid-connection or their sessions get all screwed up.

      Not-always-on connections might be "vulnerable" to this type of thing, but if you're bored enough to red-flag the IP range of a dialup provider on a local business' webserver, you have serious issues.

    4. Re:Lingering connections handling by Atti+K. · · Score: 1

      That depends on the ISP. My connection is PPPoE based, and most of the time bringing the connection down and up again is all it takes to get a new IP address (from a quite large pool).

      --
      .sig: No such file or directory
  22. Re:Well its not just Apache by Kokuyo · · Score: 1

    Tjat would have been your screen saver.

  23. Not a flaw, easily configured around by Anonymous Coward · · Score: 3, Informative

    http://httpd.apache.org/docs/2.2/mod/core.html#timeout

    The issue is that the default configuration waits 5 minutes for the full request, which is painfully to long a period of time. Drop that from 300 to 5, and the "attack" goes away. If you are running the default Apache config in production, you shouldn't be.

    1. Re:Not a flaw, easily configured around by ID000001 · · Score: 3, Informative

      http://httpd.apache.org/docs/2.2/mod/core.html#timeout

      The issue is that the default configuration waits 5 minutes for the full request, which is painfully to long a period of time. Drop that from 300 to 5, and the "attack" goes away. If you are running the default Apache config in production, you shouldn't be.

      seem like a potential fix, can anyone confirm?

    2. Re:Not a flaw, easily configured around by TheLinuxSRC · · Score: 2, Insightful

      From the article:

      "...the server will open the connection and wait for the complete header to be received. However, the client (the DoS tool) will not send it and will instead keep sending bogus header lines which will keep the connection allocated."

      In other words.. the connection is not allowed to "timeout" as there is (bogus) traffic on the connection.

    3. Re:Not a flaw, easily configured around by Anonymous Coward · · Score: 0

      The timeout starts when the client initiates the connection. It isn't reset on each character received from the client.

    4. Re:Not a flaw, easily configured around by dlgeek · · Score: 2, Insightful

      The problem with that is it will break nontrivial uploads using POST since they won't complete in 5 seconds. The real solution is to not count threads or connections below a certain utilization threashold towards the capped max and kill them once you hit real starvation.

    5. Re:Not a flaw, easily configured around by Cajun+Hell · · Score: 1

      If you are running the default Apache config in production, you shouldn't be.

      That's one of the most damning things you can say about a package.

      --
      "Believe me!" -- Donald Trump
    6. Re:Not a flaw, easily configured around by GuldKalle · · Score: 1

      Wouldn't this also affect file uploading? I'm not sure, but I think those are sent as part of the HTTP header.

      --
      What?
    7. Re:Not a flaw, easily configured around by Anonymous Coward · · Score: 3, Informative

      Th work-around works fine.

      I downloaded the Slowloris and was able to take down a default apache install, however with keepalive disabled and a timeout of 5, the attack became inneffective.

      This may be a problem for sites with users that do long-running POSTs, but since we don't have any of those, all I can say is "It works here . . . "

      For more info: http://httpd.apache.org/docs/trunk/misc/security_tips.html

    8. Re:Not a flaw, easily configured around by myz24 · · Score: 1

      Did you read the doc? Seems like they thought of that situation. Here is the info

      The total amount of time it takes to receive a GET request.
      The amount of time between receipt of TCP packets on a POST or PUT request.
      The amount of time between ACKs on transmissions of TCP packets in responses.

    9. Re:Not a flaw, easily configured around by Anonymous Coward · · Score: 1, Informative

      That was tested by the Slowloris guys and it looks like it worked -sorta. See http://ha.ckers.org/blog/20090617/slowloris-http-dos/#comment-105386 for more information.

  24. HTTP hints at a solution by greed · · Score: 5, Informative

    HTTP 1.1 specifies a status code for "Request Timeout" (408) and "Gateway Timeout" (504).

    What is needed, therefore, is a timer running for receiving the complete header, and a second one for accepting the body. The timer for the body can be controlled by the type of request and the Content-Length header. (With, of course, a specific cap.)

    Currently, Apache 2.2 has a single timeout value for all types of requests, but it is interpreted differently for the different types.

    If your server only handles GETs, the obvious thing is to crank that number down. Unfortunately, for PUTs, the TimeOut value affects inter-packet time in the request, not overall request time.

    Strangely, the timeout doesn't seem to run in 2.2.10 and 2.2.11 before data is received. Oh dear. That's an even simpler DoS.

    #!/usr/bin/env perl

    use IO::Socket::INET;
    use strict;
    use constant DEFAULT_PORT => "http";

    MAIN: {
    if(@ARGV<1 or @ARGV>2) {
    die "Usage: $0 host [port]\n";
    }
    my($host)=shift;
    my($port)=@ARGV?shift:DEFAULT_PORT;

    my(@sockets);

    for(my $cnt=0;$cnt<1000;++$cnt) {
    my $socket=new IO::Socket::INET(PeerAddr=>$host,
    PeerPort=>$port,
    Proto=>"tcp");
    unless(defined($socket)) {
    die "Cannot create socket to $host:$port--$!\n";
    }
    $socket->print("\r\n");
    push(@sockets,$socket);
    print " Have ".@sockets." open.\n";
    }
    }

    Not quite as stealthy, though. At least as above.

    1. Re:HTTP hints at a solution by greed · · Score: 5, Funny

      BTW, is there a self-mod value for "I'm not sure I should have posted that"?

    2. Re:HTTP hints at a solution by arjennienhuis · · Score: 1

      A HTTP response can not start until the whole request has finished. So sending a status code is impossible.

      The same problem happens if you try to POST a file that is too large. The webserver knows this after the Content-Length header but cannot respond until after you send the whole file. The only thing the webserver can do is to close the connection.

    3. Re:HTTP hints at a solution by shutdown+-p+now · · Score: 1

      No, but there's a "+5, Thanks anyway!". And looks like you're getting it already.

    4. Re:HTTP hints at a solution by psydeshow · · Score: 1

      That's informative, but I thought the point about GET vs. POST and PUT was confusing.

      To be clear, the Timeout directive can be set low without affecting the ability of people to upload large files to the server. Timeout only applies to the time between packets, which should be a few hundred milliseconds apart under most circumstances, right?

      From the httpd manual:

      The TimeOut directive currently defines the amount of time Apache will wait for three things:

            1. The total amount of time it takes to receive a GET request.
            2. The amount of time between receipt of TCP packets on a POST or PUT request.
            3. The amount of time between ACKs on transmissions of TCP packets in responses.

      We plan on making these separately configurable at some point down the road. The timer used to default to 1200 before 1.2, but has been lowered to 300 which is still far more than necessary in most situations. It is not set any lower by default because there may still be odd places in the code where the timer is not reset when a packet is sent.

    5. Re:HTTP hints at a solution by Covener · · Score: 1

      Maybe you're on an OS with a dataready or HTTP accept filter. Timeout applies to reading the entire first line of the request.

    6. Re:HTTP hints at a solution by Anonymous Coward · · Score: 0

      BTW, is there a self-mod value for "I'm not sure I should have posted that"?

      Just run your script against slashdot so that no one can read your post.

    7. Re:HTTP hints at a solution by QuoteMstr · · Score: 1

      Actually, you can check that a server will allow a certain-sized upload. You do that using the HTTP 1.1 expect mechanism: the user-agent sends the normal headers plus a expect: 100-continue header. The server, after it reads the client headers but before it reads the body, replies with either a 100 continue or some error depending on the headers it saw, which can include content-length. The user-agent just holds off on sending the body until it receives a go-ahead from the server.

  25. Why wouldn't the following setting by McNihil · · Score: 1

    mitigate it somewhat:

    In httpd.conf

    #
    # Timeout: The number of seconds before receives and sends time out.
    #
    Timeout 120

    Unless of course this timeout is for after the header is received only... which I don't think it is... but as they say... assumption is the mother of all f*ckups.

    1. Re:Why wouldn't the following setting by The+MAZZTer · · Score: 1

      When in doubt, pull out PuTTY and test it!

    2. Re:Why wouldn't the following setting by Anonymous Coward · · Score: 0

      That's a per-packet timeout and not an overall request timeout.

  26. Re:WTH? This is an absolutely trivial attack by Lord+Ender · · Score: 2, Informative

    No, it's not. It's holding an HTTP session open. That is not the same thing as a TCP socket.

    --
    A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
  27. What a timely posting (not) by BuhDuh · · Score: 1

    2009-06-18 15:25:37 New Apache DOS Tool (Index,The Internet) (pending)

    --
    Enlightenment? It's just a flush in the pan.
  28. Re:Not *such* a big deal by jginspace · · Score: 1
    Correct, IIS is not affected. The good news is that it's difficult to get much milage attacking from a Windows box. From TFA:

    Windows users: You probably will not be able to successfuly execute a Slowloris denial of service from Windows even if you use Cygwin. I have not had any luck getting Slowloris to successfuly deny service from within Windows, because Slowloris requires more than a few hundred sockets to work (sometimes a thousand or more), and Windows limits sockets to around 130, from what I've seen. I highly suggest you use a *NIX operating system to execute Slowloris from for the best results, and not from within a virtual machine, as that could have unexpected results based on the parent operating system.

  29. I can just hear the words... by petrus4 · · Score: 1

    ...of one of the 14 year olds who uses this, as she runs the script.

    "Dodge this." ;)

  30. Re:WTH? This is an absolutely trivial attack by Anonymous Coward · · Score: 0

    I'm finding it hard to believe that Apache is genuinely vulnerable to this. Did nobody see it coming? For real?

    10.4.9 408 Request Timeout

          The client did not produce a request within the time that the server
          was prepared to wait. The client MAY repeat the request without
          modifications at any later time.

    It makes no mention of a default or required timeout.
    This is just a case of the specs being written long (10 years this month) before people started adding protection measures into the specs. Luckily, unlike SMTP specs, this is easy to fix without breaking t'internet.

  31. Re:WTH? This is an absolutely trivial attack by dword · · Score: 4, Informative

    Let me make this clearer for those that aren't very technical: It's holding an HTTP session open and Apache has a limited number of simultaneous HTTP sessions.
    All someone has to do is send about 100 requests to your website and leave them open without sending any further information. Nobody else will be able to connect to your web server for a long time. The weekend is coming, so I'm expecting lots of downtime for government sites in the next couple of days...

  32. It dont want to work for me by Anonymous Coward · · Score: 0

    Apache 2.2.10 mpm_worker, anyone know how to set up that lil script to DoS it ? ive tried setting 10000 connections and its still dont want to stop working

  33. Re:Well its not just Apache by McNihil · · Score: 1

    Just tested on www.microsoft.com and I sat there in the header negotiating part for over 3 minutes before the pipe broke on remote end (I didn't do anything.) Slight change in that slowloris makes IIS* vulnerable too.

    Heck one could even make it so that the header requests go out at 8 bit/s or less and just whallop any server with a lot of these requests... and have the requests FULLY valid.

    Its simple for an admin to block the IP so its not that big of an issue unless it is employed as a DDoS.

  34. Re:Here it comes... by Anonymous Coward · · Score: 0

    Next up: Emacs: better than vi or way better than vi?

    Better than vi (c'mon, what decade is this?), waaaay worse than vim.

  35. Am i the only one who thinks that it's retarded... by Anonymous Coward · · Score: 0, Offtopic

    that I should have to reboot my MacBook for a freaking web browser update? And a minor release, at that. I just rebooted last week for a damned QuickTime update (also ridiculous). Come on, Apple engineers. Get your freaking head in the game!

  36. HTTP, not apache by CarpetShark · · Score: 1

    The article states that this is like a syn flood, but on the HTTP level, rather than the TCP level. So essentially, it sounds like a flaw in previous understanding of HTTP, which will now be rectified by patching servers INCLUDING Apache.

    It's a pity the reports of affected servers wasn't more comprehensive though; I'd like to know where Cherokee and nginx stand.

    1. Re:HTTP, not apache by sakti · · Score: 1

      > I'd like to know where Cherokee and nginx stand.

      I think the async based servers are all immune to this as it depends on the limitation of the thread/process overhead on the number of connections that can be handled concurrently.

      So nginx should be immune as I know it is async based. I'm not sure about cherokee and can't seem to find any quick answers. But you should be able to find out if you dig a bit.

      --
      "It is better to die on one's feet than to live on one's knees." - Albert Camus
  37. Re:Am i the only one who thinks that it's retarded by knavel · · Score: 0, Offtopic

    Apple, you can't bring that weak ass stuff up in this humpy bumpy! And you know this, baby! WOOOO!

  38. Attack of a 1000 snails. by leuk_he · · Score: 2, Informative

    This type is already known as "attack by a 1000 snails" type attack. It is harder to defned against than you would think. A user can be slow, but coders are hesitant to drop users that ar too slow or too fast.

    A user kan just keep the TCP/IP alive by sending one byte every x seconds. If this is patched at http header level, you will see you can do the same kind of attack on the application, that can have limited php or perl sessions.

    1. Re:Attack of a 1000 snails. by orangesquid · · Score: 1

      So you have a new set of settings:

      Idle-Timeout: 15 # no bytes sent in 15 sec, close
      Unfinished-request-timeout: 1800 # any request not finished in 15min, close
      Unfinished-nonPOST-request-timeout: 60 # any non-POST (so POST uploads are still treated fairly) request not finished in 60sec, close
      Snail-threshold: 24K/10 # "greedy snail" threshold is 24K uploaded in 10 sec
      Max-connections: 200 # max # of simult conns
      Max-snails: 40 # max # of greedy snails
      Max-snails-from-IP-before-ignore: 2/5/3600 # 2 max simult snails or 5 snails in 1 hr will "ignore" IP
      Max-snails-from-netblock-before-ignore: 20/100/3600/24 # 20 max simult snails or 100 snails in 1 hr will "ignore" netblock
      Max-snails-from-IP-before-block: 5/12/1800 # 5 max simult snails or 12 snails in 30 min will block IP
      Max-snails-from-netblock-before-block: 4K/1800/24 # 4K snails within 30 min from a /24 netblock will be blocked
      Snail-IP-ignore-time: 300 # "ignore" is a 5min block for a snail IP
      Snail-netblock-ignore-time: 3600 # "ignore" is a 1hr block for a snail netblock
      Snail-IP-block-time: 3600 # block a snail IP for an hour
      Snail-netblock-block-time: 86400 # block a snail netblock for a day

      People can still uploads. Even if all your uploaders are POTS modem users, you can still take 40 of them at once, leaving 160 connections open for non-snails.
      This could be extended to several levels of snails to also handle DDOS snail attacks from high-speed users who stay just above the first-level snail threshold.

      This still doesn't account for high-throughput DOS nor DDOS attacks, but that's already something well-studied.

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
  39. Re:Well its not just Apache by Mister+Whirly · · Score: 1

    No, that's just the Swine Flu.

    --
    "But this one goes to 11!"
  40. Re:Well its not just Apache by Anonymous Coward · · Score: 0

    Its just ironic that not so long ago, the Microsoft website was running on a set of Sun Web servers under Solaris. :)

  41. DDOS! by GNUPublicLicense · · Score: 1

    Oh God! Apache web server having a security hole! Better write this day down. The others web servers have already an endless list of days written down, and they are not deployed like apache...

    1. Re:DDOS! by Shados · · Score: 1

      Apache and IIS have had pretty much no remotely exploitable holes in years (in the core. Of course some extensions and modules had issues), so whenever either have one found, its news.

  42. Ideal Fix by physburn · · Score: 0, Redundant

    The ideal fix, would be to have a variable timeout on open connection, depending on how many open ones there are. A simple thing like auto timing out the oldest connection once the a near maximum number of connections are open should be enough. Apache should also be limit the number of connections from any one IP address, to a small number. Hope these go in Apache soon.

  43. Re:Well its not just Apache by nxtw · · Score: 2, Interesting

    Just tested on www.microsoft.com and I sat there in the header negotiating part for over 3 minutes before the pipe broke on remote end (I didn't do anything.) Slight change in that slowloris makes IIS* vulnerable too.

    Keeping idle sessions open on the server for some period of time is not the flaw. The flaw is that some servers (in default configurations) only handles so many of these idle sessions open before reaching a limit and refusing to accept any new sessions, and that this limit is sufficiently low, and that one client can easily reach this limit.

    This particularly affects web servers that fork separate processes to service multiple requests at the same time - and this includes the default configuration of Apache 2 on many systems. (Last I checked, PHP's Apache module implementation only works well with the forking proces model because of thread safety issues.)

    IIS does not use this antiquated process model - it's threaded. Apache can be configured to use a threaded model too. Unfortunately, thread-unsafe code is still common.

  44. Many othere services are probably vulnerable by karl.auerbach · · Score: 1

    Sendmail and other servers are probably vulnerable to this kind of thing. And it is not necessarily the server application itself may not be where the core of the server slowdown occurs. For example, if one were to spread this kind of attack across several different types of TCP-based protocols (SMTP/SMTPS, IMAP(S), HTTP(S), DNS(tcp version), etc then the operating system's TCP engine might start suffer from too many TCP control blocks. (And it isn't just the memory occupied - some silly implementation might do a sequential scan rather than hash lookups when matching incoming packets to TCP connection blocks.)

    There is another version of this kind of attack in which rather than sending incomplete data the attacker simply is extremely lazy about sending TCP ACKs - it does so only enough to keep the connection alive. Yet another alternative is that the attacker maintains a TCP receive window that is just a tad too small to contain what the attacked machine is trying to send back.

    There is a flip side of this - one can build an email server that is closely integrated with the TCP stack so that incoming mail is validated while the TCP connection is open. Then if the incoming mail is bogus the machine can go into slow ACK/small receive window mode and try to constipate the TCP stack of the spamming machine. Unfortunatly that technique was more useful before hordes of bots were used as spam amplifiers.

    1. Re:Many othere services are probably vulnerable by AaronW · · Score: 1

      My mail server (Postfix) actually takes advantage of this. I have it configured to tarpit known spam sources (from RBL) and hold the connections open without sending a response.

      --
      This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
    2. Re:Many othere services are probably vulnerable by Anonymous Coward · · Score: 0

      Are you referring to SYN flooding, grandpa?

    3. Re:Many othere services are probably vulnerable by Akatosh · · Score: 1

      Oh, sendmail isn't probably 'vulnerable', it definitely is. That's why sendmail has FEATURE(`conncontrol', ,`terminate'), to limit simultaneous sessions per client. Spammers have been abusing it for eons. I put vulnerable in quotes because that feature is configurable, but not a default. If your daemon doesn't have a way of dealing with these things (apache does with a module), there's always

      iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 10 -j DROP

    4. Re:Many othere services are probably vulnerable by karl.auerbach · · Score: 1

      Syn flooding is very old hat - from the 1970's.

      I'm talking about attacks in which the attacker connects to the server, sends the protocol hello sequence, but either does not do a TCP ack or does not provide a sufficient receive window. In both cases the sender (the TCP stack of the machine under attack) sits waiting for a TCP state change that never occurs.

    5. Re:Many othere services are probably vulnerable by Atti+K. · · Score: 1

      I would be interested in how do you do that.

      --
      .sig: No such file or directory
  45. Re:WTH? This is an absolutely trivial attack by suso · · Score: 2, Interesting

    Yes, I agree. I've seen a handful of attacks like this over the years. Maybe not exactly this one, but Apache has been vulnerable to this for years and I thought all webservers were. And I thought people just knew about it already. This one is a tough one to fix, its not like Apache can just patch something. It sounds like an architectural change is needed.

  46. Re:WTH? This is an absolutely trivial attack by Xeriar · · Score: 3, Informative

    A simple connlimit declaration in IPTables shuts this down fairly easily...

  47. Re:Well its not just Apache by McNihil · · Score: 1

    What are you talking about? There is settings in IIS regarding max connections as well and presumably would be effected in the same manner if these are set too low. This has nothing to do with fork (process) or non forked (lightweight process) method of serving.... or are you telling me that IIS is currently completely on Fiber level instead of their "Threads" ?

    Either way at some point you still need to do some poll on the master socket to peek if there is some requests coming your way so you can relegate it to one of the threads in the pool. Thread pool starvation and all that... you can't really fully escape this (there I even got a pun included.)

  48. Re:Well its not just Apache by Critical+Facilities · · Score: 1

    Wait, you mean the summary on /. is finally correct!?

    No. Here is the link to the article. Not sure what to tell ya about the pig, though. Maybe check the dosage on your meds? ;-)

  49. Re:Well its not just Apache by nxtw · · Score: 1

    What are you talking about? There is settings in IIS regarding max connections as well and presumably would be effected in the same manner if these are set too low. This has nothing to do with fork (process) or non forked (lightweight process) method of serving.... or are you telling me that IIS is currently completely on Fiber level instead of their "Threads" ?

    The problem is a combination of a single client being able to reach the maximum connection limit in the default configuration, and this is more likely on servers that use a forking model (becuase they must set lower limits to avoid exhausting resources.) It does not mean that servers that use a forking process model are inherently vulnerable, and I never said that it did.

    Servers found to be invulnerable to this specific attack might have a default configuration that sets the session limit high and limits the amount of requests from a single host, or they might handle idle connections differently when the amount of idle connections is sufficiently high.

  50. Re:WTH? This is an absolutely trivial attack by amicusNYCL · · Score: 3, Informative

    Not really, it just means you need more than one attacker.

    --
    "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
  51. Re:WTH? This is an absolutely trivial attack by ToasterMonkey · · Score: 2, Interesting

    A simple connlimit declaration in IPTables shuts this down fairly easily...

    Will that work for anyone using load balancers (read: people with sites worth hitting)?

  52. Are web servers really this dumb? by Anonymous Coward · · Score: 0

    Our little crappy web server even has more brains than that. Are you seriously telling me Apache never concidered this case and has no effective anti-dos measures to close slow clients when there is connection pressure?

    Holding open connections is the hallmark of any DOS 101 implimentation.

    Its hard to believe this is the case and I refuse to believe this somehow constititues a new discovery. Its absurd.

  53. Re:Well its not just Apache by Anonymous Coward · · Score: 0

    IIS does not use this antiquated process model - it's threaded

    Isn't fork() copy-on-write? Why isn't the only difference between a threaded and a fork based server whether or not each instance has its own heap? [ Which doesn't seem too terrible... ]

  54. Re:WTH? This is an absolutely trivial attack by anomalizer · · Score: 1

    I cannot believe that in this day and age, people have not come across this simple attack. Wonder why this is even considered a discovery.

  55. Re:Well its not just Apache by Anonymous Coward · · Score: 0

    IIS threads service multiple connections, news at 11.

  56. Link to the specific article by Megane · · Score: 4, Informative

    If you're going to post links to isc.sans.org, can you please post links to the specific article, and not just the main page?

    Here is the link to the specific article: http://isc.sans.org/diary.html?storyid=6601

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  57. Re:Not *such* a big deal by Anonymous Coward · · Score: 0

    Linux. Still the preferred OS of evil overlords!

  58. Re:Am i the only one who thinks that it's retarded by Anonymous Coward · · Score: 0, Offtopic

    Well, come on, you're using a Mac. It's not like you're doing any actual *work*...

  59. I am perplexed... by Anonymous Coward · · Score: 0

    .. as to how this even managed to get onto slashdot, but I suppose this is not the first time this has happened either.

    If the entire script kiddie populous would utilize this method for attacking webservers, every sysadmins job would get a whole lot simpler. You don't need DoS mitigation devices to protect yourself against this attack, you can run a cron'd shell script that would do the same, or a single iptables rule that limits the amount of connections made per second.

    Even in a DDoS scenario, this is trivial to protect against, considering it cannot be spoofed.

    If more people would have experience with attempting to deal with spoofed syn flood DDoS's against HTTP, maybe less people would actually pay attention to something as ridiculous as this.

    Also to note, there's a reason why the author of the security focus article titled it as 'a cheesy Apache / IIS DoS vuln..'.

    gg

  60. Re:WTH? This is an absolutely trivial attack by linuxwebadmin · · Score: 1

    I second this assertion. Iptables could easily deal with this attack.

    --
    Show me packet captures and log entires, or it never happened.
  61. Re:WTH? This is an absolutely trivial attack by Chris_Jefferson · · Score: 3, Interesting

    No, that won't work. Apache will drop connections which aren't making "useful progress".

    However, it's definition of "useful progress" is flawed -- you can keep sending HTTP headers, and it will keep the connection open. You only have to send one every few seconds, so it's a very low bandwidth DOS attack.

    --
    Combination - fun iPhone puzzling
  62. Queuing and timeout by pdxp · · Score: 2, Informative

    IIS worker processes have a request queue. Whether or not you use asynchronous functions to handle requests, there is a fixed maximum number of threads each worker process will run to process requests. While reading from a socket, the worker thread does block but more threads are not spawned to handle connections. Instead, the worker process puts new requests into a queue until more threads are available.

    I believe this works because there is a timeout associated with the completion of a request. Sure, it might be difficult to distinguish a slow DoS from a slow client, but it wouldn't be impossible to set a reasonable time limit on non-POST requests. That would be a relatively easy way to fix the issue in Apache.

    As far as POST goes... well, that's a different (and valid) way to perform a slow DoS attack:

    Server: What would you like? Ham bacon spam, or spam eggs bacon spam with spam?
    Client: I'm actually here to deliver some SPAM!
    Server: How much SPAM?
    Client: SPAM, SPAM, SPAM.... (3 hours later) ... SPAM SPAM SPAM...

    Slowloris can do this too. By default, IIS only reads the up to first 48KB of post data (I see much smaller numbers in practice), at which point the request is sent to an extension/app. Before this, the request doesn't leave the kernel-mode driver (http.sys). The apps can easily ignore the data or read more (on a timeout). I wouldn't be surprised if Lighttpd did the same thing (sans kernel driver).

    1. Re:Queuing and timeout by rgviza · · Score: 1

      On Apache the request timeout directive is TimeOut.

      It does not impact the response timeout. In my tests setting it to 2 seconds broke the tool but did not break normal POSTs and GETs. I saw no lag even with Slowloris running against the server.

      Setting it to 5 seconds caused noticeable lag for a browser request.

      This will probably work with busy servers but the lag times will be much longer. The directive only affects how long the server will wait _after the request stream starts_. Your browser will wait for much longer for an ack from the server, which it will need to do if your server is getting DoS'd with this tool. On a busy server clients would see very long wait times but the lag times they'll see with a 2 second timeout beats the crap out of the default 8.19 minute timeout.

      Tests only done with Apache. Why they have an 8 minute default request timeout, I have no idea.

      -Viz

      --
      Don't kid yourself. It's the size of the regexp AND how you use it that counts.
    2. Re:Queuing and timeout by smoker2 · · Score: 1
      Who has an 8 minute timeout ?
      Mine's 5 minutes, and I've not changed it from default (2.0.54 ) :

      # Timeout: The number of seconds before receives and sends time out.
      #
      Timeout 300

      #
      # KeepAlive: Whether or not to allow persistent connections (more than
      # one request per connection). Set to "Off" to deactivate.
      #
      KeepAlive Off

      #
      # MaxKeepAliveRequests: The maximum number of requests to allow
      # during a persistent connection. Set to 0 to allow an unlimited amount.
      # We recommend you leave this number high, for maximum performance.
      #
      MaxKeepAliveRequests 100

      #
      # KeepAliveTimeout: Number of seconds to wait for the next request from the
      # same client on the same connection.
      #
      KeepAliveTimeout 15

  63. Re:[Sounds Stupid] by shutdown+-p+now · · Score: 1

    How long would you set the timeout?

    Let's say it's 3 seconds (if you want to support crappy dialup connections from South Africa, that sounds about right). That means that an attacker can block out your server for 3 seconds... at a time. As soon as you kill his connections, he just recreates them anew. Or, better yet, determines your timeout, and then disconnects just before your server would drop the connection (so that the logs look more benign).

  64. Re:Well its not just Apache by pdxp · · Score: 1

    Actually, IIS does use the process model, but each worker process is threaded and talks directly to the kernel-mode HTTP server.

  65. Re:Well its not just Apache by Anonymous Coward · · Score: 0

    IIS does not use this antiquated process model - it's threaded.

    Well, processing requests in separate processes has the advantage that a crashing application module has no chance of bringing the server down. You may call it antiquated when you have found a method to guarantee that software never crashes. This will also give you the right to call the Halting theorem antiquated...

  66. Re:Well its not just Apache by nxtw · · Score: 1

    Well, processing requests in separate processes has the advantage that a crashing application module has no chance of bringing the server down. You may call it antiquated when you have found a method to guarantee that software never crashes. This will also give you the right to call the Halting theorem antiquated...

    And yet all those web servers that don't use forking are stable enough that they haven't been rewritten...

  67. Re:WTH? This is an absolutely trivial attack by Anonymous Coward · · Score: 0

    Yes. In good load balancers (again, people with sites worth hitting) you can define rules to block or limit connections.

  68. Linux behaves differently by Anonymous Coward · · Score: 0

    It is maybe interesting to notice that at least my current Linux webserver does respond to TCP connection attempts with the normal three packet handshake SYN - SYN/ACK - ACK, but the sockets are not created in ESTABLISHED state. They are still in state syn received. Only when the client sends some data will the socket go into ESTABLISHED state. On this system, a connection that does not actually send some data to the server, will not block a socket or an Apache worker process.

    As soon as the client sends some data, the Apache TimeOut timer starts running, which will close the connection sooner or later. Of course, the default of 300 seconds is way to long. And yes, the number of processes and the rate at which they are generated is configurable also.

    BTW, Squid uses a much shorter timeout, but is usually limited by the number of sockets per process. However, this is a limit that has to be increased on the operating system before squid can benefit. Apparently, the thread model also has its limitations. I guess it would be surprising if there were a single solution that is perfect for all types of applications. This also means that a webserver like apache must be configured for the application. Have you configured your server?

  69. Re:Not *such* a big deal by Nicolay77 · · Score: 2, Informative
    --
    We are Turing O-Machines. The Oracle is out there.
  70. (Un)fortunately, lighttpd is not vulnerable by Xtifr · · Score: 1

    I might subscribe to your theory if it weren't for the fact that lighttpd, which is a first-rate open-source web server, is explicitly listed as not vulnerable.

  71. IIS makes my life miserable. by Anonymous Coward · · Score: 0

    People love to hate it, but IIS has matured in to a very good web server. It's my choice over Apache.

    I wish I felt the same way, since I have to run several IIS servers. I find Apache is more reliable, easier to configure, and makes better use of my cheap commodity hardware. I spend twice as much effort maintaining IIS as I do on the same number of Apache servers. I would honestly take a pay cut if they'd replace my IIS with Apache, because my life would be more enjoyable so the improvement would be worth more than money to me.

    We probably have different needs, since we seem to have had different experiences.

  72. Re:Well its not just Apache by DavidTC · · Score: 2, Informative

    You can use fcgid to run PHP in a different process, and then safely run apache multi-threaded. Just FYI for those using PHP.

    It's also a good deal faster, and more stable to boot.

    --
    If corporations are people, aren't stockholders guilty of slavery?
  73. Re:WTH? This is an absolutely trivial attack by DavidTC · · Score: 1

    I wonder if there's some way of using iptables to close very slow connections. But you need to do it to the outgoing speed.

    Something you can say 'If this connection sends less than 10k outwards in a minute, close it'.

    Then, these connections would be, if I understand correctly, be closed after a minute.

    But, only like other methods, wouldn't block legit access from the same IP, which would interfer with proxies. And it would allow http keepalive connections that actually send data.

    Granted, it would also close the keepalive connections that some webbrowers hang around keeping open even when there's no data, too, but those things usually are killed by the web server after 15 seconds or so anyway.

    --
    If corporations are people, aren't stockholders guilty of slavery?
  74. ...but does it actually work? by vamidus · · Score: 1

    did anyone confirm this? i am currently attacking my own server with slowloris.pl 0.7 and see no DoS. my setup: Apache/2.2.3 (Debian) sitting behind SmoothWall Express 3 firewall. i see the packets passing through the firewall. i have been running the attack script for some time now and it said it sent 90943 packets when i gave up and killed it. my config files are pretty standard, almost out of the box. can anyone post about a successful DoS using slowloris.pl 0.7?

    --
    èåæç©
  75. Re:Well its not just Apache by McNihil · · Score: 1

    "becuase they must set lower limits to avoid exhausting resources."

    I would say that on a high traffic site the settings are hardly defaults. Maybe you remember one of the first pthread implementations on Linux that actually spawned things as if it was processes with shared memory. It wasn't a big deal then and it certainly isn't now that things are more hidden within one process space instead, if one looks at the threded model approach (I have done ample... and I mean AMPLE fork vs. thread testing scenarios throughout my coding ventures and I have come to realize that only some coders that seem to have drunk the Fiber cool-aid abject the idea of forking. At the end of the day it matters little because the generally bungle on race-contention instead.)

    Granted a fork is heavier memory wise and uses semaphores rather than simple mutexes (but one only needs to use semaphores if sending data between processes) but with today's hardware and with the amount of memory it is less of a problem. Also the O(1) scheduler in Linux for instance would work quite effectively as well from that kind of resource scheduling point of view. I would rather have my internet banking done over a forked approach than inside of a threaded approach for security reasons, but I digress.

    All this is a non issue... maybe it is an issue running Apache on Windows but I wouldn't do that in any case.

    BTW: By default the thread pool would be 2048:

    http://msdn.microsoft.com/en-us/library/ms682453(VS.85).aspx

    Now I have had far more forked apache's running than that on Solaris/Linux/Irix (I go way back... maybe not as much as I would like in this case BUT still more than most.)

  76. Re:WTH? This is an absolutely trivial attack by brunoacf · · Score: 1

    It's just holding sockets open; that's the "Hello, world!" of DOS attacks.

    Yeah, a very effective 'Hello World', unfortunately.

  77. Hmm. by reiisi · · Score: 1

    It seems to me that if you have a single thread responding to multiple requests, a single slip in the code anywhere past the the pool is going to open every connection to the pool to every other.

    If not, the pool will have to have some sort of wall between connections, and there will be a way to attack the wall.

    Thus, IIS may not be "vulnerable" to this version of the attack, but it will be vulnerable to an attack modified to whatever attempt IIS makes at putting up a wall, and it will also (because we know that no programer or pool of programers is perfect) be vulnerable to all sorts of cross-talk between connections.

    --
    Computer memory is just fancy paper, CPUs just fancy pens with fancy erasers; the 'net is just a fancy backyard fence.
  78. embarrassing? by reiisi · · Score: 1

    Well, it is a little embarrassing to have your elementary students give you the "kancho".

    --
    Computer memory is just fancy paper, CPUs just fancy pens with fancy erasers; the 'net is just a fancy backyard fence.
  79. bubbles, bugs and glitches by coward901283 · · Score: 1

    the bubble: everyone is vulnerable. well at least one year ago (or something) every kind of http server was. the bug: there is no bug. this is one of the flaws we live with that would require on-the-fly fixes (by sysadmin). im not sure how this became a news headline. ah wait. i also remember the "dns exploit" that was (re-)"discovered" and "fixed" by cisco,microsoft and some john doe. i also remember djb telling them ages before about it - and ofcourse providing the fix as well. but no one heard about it until the companies decided they're ready to make some profit from it. open your eyes, people. the glitch: there is. a quite-general fix was described above by someone (killing the oldest unfinished requests) but on a heavy attack this could also kill legit requests. one should really customize a tcp pattern-based filter depending on the attack combined with safe application layer rules. p.s. the "timeout" settings are useless. you can fingerprint that and force timeout resets on the server side with minimum bandwidth consumptions. see an old article with source code, etc (i think you need to fix a small compilation error to be able to use it): http://pub.mud.ro/~cia/computing/apache-httpd-denial-of-service-example.html

  80. flaw In Apache ? by viralMeme · · Score: 1

    This affects a number of webservers that use threaded processes and ironically attempt to limit that to prevent memory exhaustion - fixing one problem created another..

    1. fingerprint the timeout on serverside
    2. dig the sitemap from target
    3. build a list of browsers to advertise to server during request
    4. buy proxies from black market
    5. start requests thru proxies to target

  81. shame by samjam · · Score: 1

    My shame, I think I got the port numbers for dport and to-port the wrong way around....

    sam

  82. Python based version of this attack method. by Motoma · · Score: 1