������Ѷ
���ೣ������
-
����ũ���������ֻ����пͻ���������������584204
-
Windows�Ż���ʦ��������416898
-
90��Ů��(��Ƶ��������)��������366961
-
����ũ���������ֻ����пͻ���������������365699
-
�첥�ֻ�����������325855
1 ��˾������ÿ������SSH�����ı����ܷ��ˣ����Ǿ��ڸ������ƴ���ʵ���Ļ����ϸı������½ű������в�ͬ��
#!/bin/bash
#Prevent SSH attack
SLEEPTIME=30
lastb -n 500| grep -v "^$" | grep -v "btmp" | awk '{print $3}' | sort | uniq -c | grep -v "��˾IP" |sort -nr > attack.log
while true
do
while read line
do
IP=`echo $line | awk '{print $2}' `
TIME=`echo $line | awk '{print $1}' `
if [ "$TIME" -gt 10 ];then
grep "$IP" deny.log &> /dev/null
if [ "$?" -ne "0" ]; then
echo "sshd: $IP" >> /etc/hosts.deny
fi
fi
done < attack.log
/bin/sleep $SLEEPTIME
done
2 ���Ϸ�����Ϊ������������Щ���̻�Ī������������Ҫ����Щ“����Ⱥ��”���ϵؽ��м��أ���������������������������д�����½ű���ʵ��(��httpd����Ϊ��)��
#/bin/bash
SLEEPTIME=30
while true
do
id=`ps aux | grep httpd | grep -v "grep" | wc -l`
if [ $id -lt 1 ]; then
echo "---`date +"%F %H:%M:%S"`-----httpd restart." >> /u/scripts/httpd_monitor.log
/etc/init.d/httpd start
fi
sleep $SLEEPTIME
done
PS�����Ͻű�����Ҫʹ��nohup���ں�ִ̨�У�����ʹ�üƻ�����Ҳ���ԣ�

DNFÿ��ǩ���ͺ�
lol7�������̵�
LOL�����Ҷ���ô
LOLӢ�۳ɾͱ�־
�����г�����ȷ
��У��ѧ������
������Ȧ��ô