This file descriptor that is created will affect your process ULIMIT number. Please raise your hand if you know what ULIMIT is. OK, ok, in in short, ULIMIT is a number of files, a system parameter that specifies how many file descriptors your process can open. Usually, process starts with a pretty low limit, which is 1024, and it can be raised by the user to be infinite.
The problem is that what infinite means? Infinite to the single process, but system-wide, the number is still a finite number, so eventually your process can take all the possible file descriptors, but at some point, well, there will be no file descriptor for nobody, including your process, and that's a problem.
Finally, when we exit the operating system layer, we get to the application layer. For instance, node, in order to keep a socket, needs to have a lot of callbacks, streams and so forth, related to your single socket. Once again, lots of RAM. At some point, this RAM will finish. We always talk about virtual RAM, but there is physical RAM that at some point will just finish. That's the problem. And that brings us to the slow-lorist attack. The slow-lorist attack is pretty unique because each client connects and never finishes the response. In this case, as you can see, the red line is dashed and by that I mean incomplete request, so it never sends the last byte. And as you can see, there is no green line because the server could never actually receive the full request and server response. Over the course of time, more and more clients keep connecting and never disconnect, and this leads to service interruptions because at some point the server will not be able to accept new connections due to lack of file descriptor, or RAM, or BOT.
What is the problem here? If you look at your logs in your monitoring system you will see no bandwidth. You will probably only see a fall in the outgoing bandwidth because the server will not be able to respond anymore, but the incoming bandwidth will be close to nothing so you will really not set any alarm. Because it's nearly impossible to distinguish whether nobody is connecting or somebody's connecting but never sending the data which is a horrible mess. Which brings to another very simple question. How do we stop it? And this is when things get horrible. Because in short, first of all, if you are using Node or similar applications, please don't put them directly in contact with the public. Always have a reverse proxy or IPI gate or something like that in front because these software are more suited for this job of preventing these kind of attacks. Node or similar tools are general-purpose tools so they're not suited for this thing. So don't do that. But if you have to, for any reason, unfortunately, I can tell you that none of the strategies you can possibly implement will be accurate. The reason being there are two main ways to stop a DDoS attack from happening. The first one is a temporary move which is ban the offending IPs for a while. Of course, makes no sense because we all know how easy it is to spawn a new instance on any cloud and get a new IP. But for a temporary relief, this might work.
Comments