Hi All,

`cat /var/log/secure | grep "refused connect" |awk '{print $9}'|sed 's/::ffff://g'|uniq -c | sort -nr |head -2 | awk '{print $2}' >/root/sample`
for IP in `cat /root/sample`;
iptables -A INPUT -s $IP -j DROP

With this script it ll create a file sample,in that file generate the most number of refused connect IP's, with that i need a shell script to Create a report based on the Blocked IP list.
Report should contain the following :

--- Date, Blocked IP, country of origin, no of attempts, status

Hariharan V.