Hace unos días, RSnake, de ha.ckers, publicó una herramienta llamada Slowloris, capaz de provocar una denegación de servicio en Apache, saturándolo de peticiones, aunque dejando el resto de los servicios de la máquina afectada disponibles y sin problemas, ya que actúa a nivel de aplicación, es decir, el ataque sólo afecta a Apache en sí.
La herramienta en cuestión es un script realizado en Perl, que por cierto, no sólo requiere tener instalado el intérprete, sino que precisa además de una serie de librerías, tal y como se indica en la web del autor:
perl -MCPAN -e ‘install IO::Socket::INET’
perl -MCPAN -e ‘install IO::Socket::SSL’
El ataque consiste básicamente en abrir muchos threads contra una página web y dejar las peticiones a medias. Declara que va a enviar datos pero, realmente, nunca llega a hacer el resto del PUT.
Slowloris holds connections open by sending partial HTTP requests. It continues to send subsequent headers at regular intervals to keep the sockets from closing. In this way webservers can be quickly tied up. In particular, servers that have threading will tend to be vulnerable, by virtue of the fact that they attempt to limit the amount of threading they’ll allow. Slowloris must wait for all the sockets to become available before it’s successful at consuming them, so if it’s a high traffic website, it may take a while for the site to free up it’s sockets. So while you may be unable to see the website from your vantage point, others may still be able to see it until all sockets are freed by them and consumed by Slowloris. This is because other users of the system must finish their requests before the sockets become available for Slowloris to consume. If others re-initiate their connections in that brief time-period they’ll still be able to see the site. So it’s a bit of a race condition, but one that Slowloris will eventually always win – and sooner than later.
Para mas información pueden mirarse esto: Slowloris [ha.ckers]
La herramienta ha provocado un impacto grande, además, el problema no tiene una solución fácil, de hecho, a fecha de hoy no hay ninguna solución que sea “completa”, ya que la mayoría de las “soluciones” restarían funcionalidad a los sistemas afectados, aunque ya se hayan publicado algunas alternativas, más bien para minimizar el ataque, en Security By Default.
Cabe destacar la herramienta PyLoris, una implementacion del slowloris pero en python (quizás mas entendible, en cuanto a código se refiera), eso si, este programa no es apto para kiddies
.
Tambien me gustaría mencionar el gran trabajo de c1c4tr1z (voodoo-labs & undersecurity [afiliado!]), ya que basandose en una prueba de concepto colgada en milw0rm (Link al PoC) ha desarrollado una versión en C intentando replicar este ataque.
/***
* apache_dos.c - C1c4Tr1Z <c1c4tr1z@voodoo-labs.org> * C version of the D.O.S proof-of-concept by evilrabbi (http://www.milw0rm.com/exploits/8991) * voodoo-labs 2009 (http://voodoo-labs.org) & undersecurity (http://foro.undersecurity.net) * compile: gcc -o apache_dos apache_dos.c -lpthread ***/ Code completo aquí: apache_dos.c (undersecurity)


5 comments
Comments feed for this article
Julio 4, 2009 a 4:00 am
seth
“tener instalado el lenguaje de programación” no será el interprete?
por que decis que el pyloris no es para kiddies? es muy facil de usar
agrego lo que dice en motomastyle: ” Apache, dhttpd, and Squid all show weakness to this brand of attack, while IIS, lighthttpd, and nginx seem to resist it well.”
saludos
nos vemos en security 0verl0ad
Julio 4, 2009 a 10:33 pm
Lix
Ey Seth, lo del Pyloris lo agregué yo porque cuando lo baje nada mas sacarlo al ejecutarlo me dio error en la sintaxis, y era porque
class SlowLoris():
options = None
threads = 0
connections = 0
Habia que remplazarlo por
class SlowLoris:Saludos!
Julio 4, 2009 a 10:56 pm
eudax
Se agradece el apunte, seth, ya lo corregí
Y también gracias a Lix, que completó una buena parte del artículo.
Un saludo!
Julio 5, 2009 a 12:20 am
seth
seth@debian:~/pltools$ ls |grep pyloris
pyloris-1.6.py
seth@debian:~/pltools$ python py* localhost
PyLoris, a Python implementation of the Slowloris attack (http://ha.ckers.org/slowloris).
[STATUS]: 8 worker threads. 39 open connections.^CTraceback (most recent call last):
File “pyloris-1.6.py”, line 170, in
SlowLoris()
File “pyloris-1.6.py”, line 98, in __init__
time.sleep(self.options.wait)
KeyboardInterrupt
seth@debian:~/pltools$ cat py* |grep “class SlowLoris”
class SlowLoris():
seth@debian:~/pltools$
yo tengo esa linea igual que vos y no me da error
Julio 5, 2009 a 1:17 am
Lix
Pues a mi me dio error tio, además:
http://docs.python.org/tutorial/classes.html
class ClassName :
no class ClassName():