If you are using Linux (Ubuntu and Debian in my case) and are being haunted by unresponsive, CPU and memory hogging Java applications you might find this piece of information useful:
- Check if you are using OpenJDK by issuing “java -version” in a terminal.
- If something with “OpenJDK” comes up, follow instructions (in german, but you get the point) on how to switch to the Java JDK from Oracle.
Netbeans now runs like a breeze now. Enjoy :)
In a Slowloris attack a client (or a botnet) opens a large amount of connections to a web server and holds them open. It does not send complete requests so you might find no request of the attacker in an Apache log — quite devious. So… The malicious client continues to open new connections using incomplete requests while Apache is waiting for complete requests in order to serve the client. Meanwhile, regular clients cannot open new connections and thus do not get to be served by the host — the site gets unresponsive.
I just wanted to share my experience with anti slowloris measurements on small-scale Apache webservers.
Apache 2.2.15 comes with mod_reqtimeout. The module’s default settings work out of the box. During my own local slowloris attack http latency fluctuated quite a lot but Apache remained responsive. If you are using Apache 2.2.15, go for mod_reqtimeout and you are done.
Debian 5.0 provides Apache 2.2.9 only and there is no mod_reqtimeout for this version.
My first choice for Apache 2.2.9 was mod_qos which I got compiled smoothly. When an attack is launched, http latency rises sharply for about five seconds. After that, latency normalizes quickly. A quite impressive result. OTOH, while there were no obvious problems reported by site users, the module spammed Apache’s error log with backtraces which forced me to search for another solution.
Next option was mod_antiloris which is a very small module with just over 5 kb of source. It compiled smoothly and worked out of the box. There are no configuration options though. During an attack, http latency rises quickly and remains high. The site gets somewhat less responsive but Apache continues to answer requests. Not as impressive as mod_qos but at least it does not clog error.log with backtraces so I am sticking with mod_antiloris for the time being.
Keep in mind that I have only tested attacks from a single client. A botnet executing a slowloris attack is a completely different story.
And BTW: YMMV.
If you have a different approach for plain Debian systems, feel free to comment.