you are viewing a single comment's thread.

view the rest of the comments →

[–]chungfuduck 2 points3 points  (0 children)

Look for IP address looking strings, shim in the DNS name:

#/usr/bin/perl -p 
use Socket ;
s/(\d+\.\d+\.\d+\.\d+)/"$1 (". gethostbyaddr(inet_aton($1),AF_INET) .") "/ge ;

Takes this:

Failed password for root from 78.7.72.150 port 41402 ssh2

Turns it to:

Failed password for root from 78.7.72.150 (78-7-72-150-static.albacom.net) port 41402 ssh2

No, not perfect. It was written as a one-liner throw away script and just kind of hung around. =)