Skip to content

Commit 830fe93

Browse files
committed
ddos1
1 parent fdb04f6 commit 830fe93

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
cc_iptables
22
===========
33

4-
收集处理CC攻击各类脚本,包括NGINX日志中的CC攻击IP处理。
4+
收集处理DDOS、CC攻击各类脚本,包括NGINX日志中的CC攻击IP处理。
55

66

7-
收集处理CC攻击各类脚本,包括NGINX日志中的CC攻击IP处理。
8-
97
[email protected]:ppabc/cc_iptables.git
108

119
[email protected]:ppabc/cc_iptables.git

ddos1.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
##http://blog.liuts.com/post/101/#topreply
3+
/bin/netstat -na|grep ESTABLISHED|awk ¡®{print $5}¡¯|awk -F: ¡®{print $1}¡¯|sort|uniq -c|sort -rn|head -10|grep -v -E ¡¯192.168|127.0¡ä|awk ¡®{if ($2!=null && $1>4) {print $2}}¡¯>/tmp/dropip
4+
5+
for i in $(cat /tmp/dropip)
6+
do
7+
/sbin/iptables -A INPUT -s $i -j DROP
8+
echo "$i kill at `date`">>/var/log/ddos
9+
done

0 commit comments

Comments
 (0)