通过iptables防火墙降低cc攻击
来源:互联网 发布:影音先锋替代软件 编辑:程序博客网 时间:2024/06/05 19:58
#! /bin/bash
#date :20170517
#function:record tcp max numbers of connection
while true
do
ss|awk -F "[ :]+" '{++S[$6]}END{for(key in S) print S[key],key}'|uniq -c|sort -rn -k1|head -10 >ss.txt
while read line
do
ip=`echo $line|awk '{print $3}'|grep "127.0.0.1"`
count=`echo $line|awk '{print $2}'`
if [ $count -gt 30 ] && [ `iptables -L -n |grep "$ip"|wc -l` -lt 1 ]
then
iptables -I INPUT -s $ip -j DROP
echo "$line is dropped" >>record-ip.txt
#echo $line `date` >>record-ip.txt
fi
done <ss.txt
sleep 30
done
#date :20170517
#function:record tcp max numbers of connection
while true
do
ss|awk -F "[ :]+" '{++S[$6]}END{for(key in S) print S[key],key}'|uniq -c|sort -rn -k1|head -10 >ss.txt
while read line
do
ip=`echo $line|awk '{print $3}'|grep "127.0.0.1"`
count=`echo $line|awk '{print $2}'`
if [ $count -gt 30 ] && [ `iptables -L -n |grep "$ip"|wc -l` -lt 1 ]
then
iptables -I INPUT -s $ip -j DROP
echo "$line is dropped" >>record-ip.txt
#echo $line `date` >>record-ip.txt
fi
done <ss.txt
sleep 30
done
阅读全文
0 0
- 通过iptables防火墙降低cc攻击
- iptables防cc攻击
- iptables 实现防御CC攻击
- iptables预防DDOS和CC攻击配置
- 不用防火墙自动对付CC攻击
- 方案:不用防火墙自动对付CC攻击
- iptables防DDOS攻击和CC攻击设置
- 使用iptables防止SYN Flood攻击和CC攻击
- iptables防DDOS攻击和CC攻击设置
- iptables防DDOS攻击和CC攻击设置
- 用iptables来防止web服务器被CC攻击
- 不用防火墙自动对付CC攻击防范vbs
- android 通过iptables设置网络防火墙
- linux下通过iptables命令设置防火墙
- SYN攻击的原理,攻击工具,以及防护手段/使用iptables应对SYN攻击、CC攻击、ACK攻击
- CC攻击
- CC攻击
- 企业网站防CC攻击软件防火墙和WEB防火墙大比较
- PCA和协方差的理解
- Node.js搭建博客步骤(express+swig+mongoose+body-parser)
- 约瑟夫问题
- python中常用的九种预处理方法分享
- 轻音乐 钢琴曲 搜集
- 通过iptables防火墙降低cc攻击
- 使用SoapUI 测试Web Service
- 让404页面变得更加实用
- Conversion to Dalvik format failed with error 1
- k-近邻算法
- 项目中使用百度地图记录
- JavaWeb——程序开发体系结构
- Android Studio 通过配置build.gradle打包签名文件。生成xxx.apk
- Linux基础-10(bash)