On Fri, 30 Sep 2016 17:08:05 -0700, li...@lazygranch.com stated:

>This will pull these hackers off your maillog.
>bzgrep -e auth=0/1 maillog* | sed 's/.*\[\([^]]*\)\].*/\1/g' >iplist
>sort iplist | uniq

Great idea. I modified it slightly since the "sort" was not working
correctly here. I make a bash script.

IPLIST="/var/tmp/iplist.txt"
MAILLOG="/var/log/maillog"

if [[ -e ${IPLIST} ]]; then
   rm ${IPLIST} &> /dev/null
fi

bzgrep -e auth=0/1 ${MAILLOG} | sed 's/.*\[\([^]]*\)\].*/\1/g' | sort -V | uniq 
> ${IPLIST}

I think I will add the ability to create a table for IPFW also.

-- 
Jerry

Reply via email to