简单的防DDos和CC attack 的一点补救措施

其实这些措施也基本没有什么大用,在代理IP 足够多的情况下只能依靠硬件去防守,但是聊胜于无

首先可以看下hivelocity 的一篇文章

https://www.hivelocity.net/kb/how-to-check-if-your-linux-server-is-under-ddos-attack/

1 安装CSF, 这个应该在我的所有服务器上都有安装

2 check the number of active connections sorted by asc

netstat -n | grep ':80' | awk -F' ' '{print $5}' | awk -F':' '{print$1}' | sort | uniq -c | sort -n

By Desc:

netstat -n | grep ':80' | awk -F' ' '{print $5}' | awk -F':' '{print$1}' | sort | uniq -c | sort -n -r

3 install iftop

yum install epel-release -y

yum install iftop -y

iftop -n

 

4 fail2ban 在一定情况下还是有作用的

5 Check average single php-fpm instance memory usage:

ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.