slowloris – Apache HTTP DoS
Ngay sau khi tool http DoS slowloris release http://ha.ckers.org/slowloris/ đã có mod_antiloris release.
Trước khi cài mod antiloris thử khai thác lỗi này thì hầu như các server chạy apache mà k0 có hình thức bảo về thi đều bị “đơ” cả. Lý do apache giới hạn max_client. trong khi loris gửi tới server những http request k0 hoàn chỉnh, apache phải wait cho http request này time out, default là 120s ( build cho CentOS). Nếu loris gửi liên tục các request này tới webserver thì chỉ trong vài giây apache đã đạt max_client, từ chống phục vụ các client khác.
Có nhiều phương án để chống con slowloris này trước khi có một bản vá của apache
- Dùng iptables chặn những những ip gửi nhiều request liên tục ( Phương án này có thể dẫn đến việc chặn nhầm các proxy)
- Dùng haproxy http://haproxy.1wt.eu/. HAproxy nằm ở front-end. trước apache, haproxy chỉ gửi những http request “đầy đủ” tới apache. Phương án này có lợi nếu bạn muốn load balancer luôn cho hệ thống của mình ![]()
- Dùng mod_antiloris
mod_antiloris limits the number of simultaneous connections per IP address
that are in the “reading request” state
wget ftp://ftp.monshouwer.eu/pub/linux/mod_antiloris/mod_antiloris-0.3.tar.bz2
tar -jxvf mod_antiloris-0.3.tar.bz2
cd mod_antiloris-0.3
sudo /wwwroot/apache2/bin/apxs -a -i -c mod_antiloris.c
sudo /etc/inid.d/http restart
Recent Comments