防DDOS攻击案例 -- ddos deflate

1.安装ddos deflate

[root@localhost src]# wget http://www.inetbase.com/scripts/ddos/install.sh   下载这个安装脚本
[root@localhost src]# chmod +x install.sh  执行权限
[root@localhost src]# ./install.sh   执行脚本安装
Installing DOS-Deflate 0.6


Downloading source files....   安装中


[root@localhost ddos]# pwd
/usr/local/ddos 
[root@localhost ddos]# vim ddos.conf   改配置文件
19 APF_BAN=0    开启调用防火墙规则
30 BAN_PERIOD=600   被禁ip在黑名单中存在的秒数

2.模拟ddos攻击(我这里用内网)

[root@localhost ~]# yum -y install httpd  在这台服务器安装
[root@localhost ~]# echo "welcome to hya" > /var/www/html/index.html 
[root@localhost ~]# systemctl  start httpd

[root@localhost ddos]# vim ddos.sh 
117 netstat -ntu | awk '{print $4}' | cut -d: -f5 | sort | uniq -c | sort -nr > $BAD_IP_LIST     ##因为我们用的内网 所以把$5 改为$4 外网的话则不用改

###用另一台服务器进行压测
[root@localhost ~]# ab -n 1000 -c 10 http://192.168.253.110/index.html

查看
[root@localhost ddos]# cat ignore.ip.list   黑名单存在这个ip
127.0.0.1
192.168.253.110
[root@localhost ddos]# iptables -L -n     防火墙也屏蔽
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
DROP       all  --  192.168.253.110      0.0.0.0/0  

3.删除ddos deflate

[root@localhost ~]# wget http://www.inetbase.com/scripts/ddos/uninstall.ddos   下载删除脚本

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

胖胖不胖、

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值