[solved] DDoS - long requests

Discussion in 'General' started by IanD, May 6, 2014.

  1. IanD

    IanD Member


    We are currently on the receiving end of a distributed DDoS attached (luckily not very big though).

    They have the clients 'POST'ing to a URL that we have disabled access to via htaccess so it points to a 403 page.

    But even with this, it is seriously taking resources on our web servers so I'm looking at how we can free up the resources. On the Top50 Request sorted by Request Time, it is 100% full of this:*****V2-"POST /Uxi6h HTTP/1.1"*****V2-"POST /Uxi6h HTTP/1.1"*****V2-"POST /Uxi6h HTTP/1.1"*****V2-"POST /Uxi6h HTTP/1.1"*****V2-"POST /Uxi6h HTTP/1.1"

    Some requests are still processing after 500+ seconds it seems - how can stop this? this can't be normal and I can only presume an intentional part of the attack to consume server resources.

    Is there is a setting in LiteSpeed to say if the request is not complete after say 30 seconds, kill it?


  2. NiteWave

    NiteWave Administrator

    I think 2 related settings are:
    lsws web admin -> Server -> General -> External Application Abort: Yes
    lsws web admin -> Server -> Tuning -> Connection Timeout (secs): default is 300.
    you can try to reduce the timeout.
  3. mistwang

    mistwang LiteSpeed Staff

    Try a rewrite rule like

    RewriteRule Uxi6h - [E=blockbot:1]
  4. IanD

    IanD Member

    Thank you for your replies.

    I have modified our rewrite to for the 'blockbot' and our Connection Timeout was already only 30 seconds, External Application Abort seems to be yes by default.

    But we are still seeing:

    ClientKaMRIn/TotalOut/TotalVHostHandlerPRequest"POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1"
  5. mistwang

    mistwang LiteSpeed Staff

    Please check log for message like
    at INFO level, if the rewrite rule works properly, otherwise, need to make sure the rewrite rule can block those URL.
  6. IanD

    IanD Member

    Ah yes - sorry there was an extra space in Rewrite rule, now it is working!

    Around 8k IPs blocked in the 1st minute.
  7. IanD

    IanD Member

    Even though we are now blocking all the IPs in LiteSpeed that request the URL, the request queue is still full of:"POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1""POST /Uxi6h HTTP/1.1"

    should they no longer be there now?
  8. NiteWave

    NiteWave Administrator

    how about the access log? does they exist in access log as well ?
  9. IanD

    IanD Member

    Yes: - - [07/May/2014:15:43:35 +0000] "POST /Uxi6h HTTP/1.1" 403 4114 "-" - - [07/May/2014:15:43:33 +0000] "POST /Uxi6h HTTP/1.1" 403 20 "-" - - [07/May/2014:15:42:26 +0000] "POST /Uxi6h HTTP/1.1" 200 3948 "-" - - [07/May/2014:15:43:10 +0000] "POST /Uxi6h HTTP/1.1" 403 20 "-" - - [07/May/2014:15:43:30 +0000] "POST /Uxi6h HTTP/1.1" 403 20 "-" - - [07/May/2014:15:43:34 +0000] "POST /Uxi6h HTTP/1.1" 403 20 "-" - - [07/May/2014:15:43:33 +0000] "POST /Uxi6h HTTP/1.0" 403 3983 "-" - - [07/May/2014:15:43:30 +0000] "POST /Uxi6h HTTP/1.1" 403 20 "-" - - [07/May/2014:15:43:24 +0000] "POST /Uxi6h HTTP/1.1" 403 3983 "-"

    It looks like LiteSpeed is not blocking the request until it has finished (maybe?) and therefore the requests are using up all the resources and we have some requests lasting for 600+ seconds and the IP is not in the ban list.

    I presume they are added when finally the incoming request finishes?

    The amount of data they are posting is not too big, maybe 10-100kb each request but it's having a big impact.

Share This Page