Just a one-liner today.
grep refused /var/log/secure | perl -ne '@l = $_; map { /from ::ffff:((?:\d{1,3}\.){3}\d{1,3}\b)/; $h{$1}++; } @l; END {map { print "$_ = $h{$_}\n" if $h{$_} > 10;} keys %h; }'
This will print a list of all IPs that have received a 'refused connection' message more than 10 times and print how many times each has been refused.
6.18.2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment