Aşağıdaki script ile tüm maillog incelenip hangi kullanıcı ve hangi iplerin kaç defa smtp den mail attığını öğrenebilirsiniz böyle spam şüpheniz varsa hangi kullanıcıdan çıktığını görebilirsiniz.

#!/bin/sh

A=/tmp/auths.txt
U=/tmp/users.txt
C=/tmp/counts.txt
I=/tmp/ips.txt
 
echo -n '' > $A
for m in `ls /var/log/exim/mainlog*`; do
{
       grep 'P=esmtpa A=login:' $m >> $A
};
done;
 
#show Users
cat $A | cut -d= -f5 | cut -d: -f2 |cut -d\  -f1 | sort -u > $U
 
echo -n '' > $C
for u in `cat $U`; do
{
       echo "`grep -c $u $A` sent by $u" >> $C;
};
done;
 
cat $C | sort -n
 
#now show IPs
cat $A | cut -d= -f3 | cut -d[ -f2 | cut -d] -f1 | sort -u > $I
echo -n '' > $C
for i in `cat $I`; do
{
       echo "`grep -c $i $A` sent by $i" >> $C;
};
done;
 
cat $C | sort -n
 
rm -f $A $U $C $I
 
exit 0;

Comments

    1. admin Article Author

      normal olarak aslında directadmin için hazırlanmış bir script bu. bu script ile bir log dosyası oluşturuyorsa sunucunuz ve verilerinde doğru olduğunu varsayarsak mutlaka böyle bir kullanıcı olmalıdır.

Atlıhan Dündar için bir cevap yazın Cevabı iptal et