PERFORMING DDOS ATTACKS IN A WEB PAGE2011年1月6日
Last month, I scanned Lava’s security theme blog and found there are many awesome articles talking about new web technology and web security. In this post, Lava brings forth a method about improving the performance of web-based DDoS technique, with HTML5 features: Cross Origin Requests(OCR) and WebWorker.
For some reasons, Lava didn’t release POC. I am very interested in it, so I wrote code and make up four test cases to test this technique. They are:
- perform 5000 GET requests by img object in a simple loop
- perform 5000 GET requests by COR object in a simple loop
- perform 5001 GET requests by COR object in a timer callback with 4ms delay (Minimum delay for setTimeout and setInterval in HTML5 spec)
And then I wrote a python script to collect the information from my Nginx’s access log. Here is the result:
Obviously, the first three tests have very similar performance figures, because they all eat out the processor’s time as possible. Although using WebWorker may improve the performance in multi-processor machine theoretically, the bottleneck is not the speed the requests being created, and the new web techniques seems do little help about improving the DDoS performance.
In my test, I open 5k connections in one time. If I increase the number to 10k or even more, most of the connections will lose, for I cannot find enough records from web server’s access log. I don’t dive into the source of Webkit, but I guess there are some limits making the browser refuse to send large numbers of request in a short time.
The real reason that make the request faster is the performance of modern browsers. In my laptop, Chrome can do 5k requests in about 20sec. Say in other words, if we construct our DDOS code carefully (thanks for Lava’s help), We can send 15k request per minute. That’s a very large number.
‘Referer’ field in request header may leak the information of infectant web page. To avoid this is very simple, just create a new blank iframe and let the code run in it.