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.
Showing posts with label security. Show all posts
Showing posts with label security. Show all posts
6.18.2009
Subscribe to:
Posts (Atom)
