[Dshield] IP Address --> Country Script

Brian Jameson bjameson at cix.co.uk
Tue Dec 16 10:49:51 GMT 2003


Allan Liska wrote

>Hello,

>Does anyone have a script that will identify the country of origin of
>an IP Address (realizing, of course, that this is not an exact
>science).  I would prefer something that can be run from the command
>line, so I can enter in large numbers of IP Addresses -- or even
>better -- something that can query a file.
>
>
>Thank you for your time.
>
>
>allan
>- --
>Allan Liska
>allan at allan.org

Alan,
	You could try Bill Weinman's whois perl script from http://whois.bw.org. I
was thinking of using this in an anti SPAM routine and The test results look
good. combine it with grep and voila! e.g. whois 207.46.134.221 | grep
"ountry:" returns Country:    US. NB the grep "ountry:" is deliberate as
Bill Weinmans's script return Country: or country depending on the neck of
the woods being investigated.
regards,
Brian




More information about the list mailing list