I found myself in the situation where I had to whois a large number of IP addresses and play with the output in Excel.
Thanks to Ben Schmitz's Net::Whois::IP Perl extension for looking up the whois information for IP addresses and some Google searching to locate some decent usage example (found in the whois.snortalog file in Jérémy Chartier's SnortAlog), I could put together the following lame script:
#!/usr/bin/perl require "whois.snortalog"; use Net::Whois::IP; $k = $ARGV[0]; whois(); print $ARGV[0] . "\t" . $inetnum . "\t" . $netname . "\n";
It expects an IP address in argument and outputs it along with its NetRange and NetName separated by tabulations.
Please post a comment if you improve it (e.g., adding error handling, etc.).
