Wednesday, March 17, 2010

Finding out information on a ton of IP's

I made the following script to make life simple.. (atleast for me)

#!/usr/bin/perl
open (ipfile, 'ip.csv');
while () {
chomp;
$nrange = '| /usr/bin/egrep -i "NetRange|Country|OrgName|NET"';
print "$_\n";
my $ips = "$_";
my $output = qx/whois $ips $nrange/;
print $output;

sample: ip.csv
192.168.1.0

:) yey no more manual whois crap.