Nmap Development mailing list archives

Re: geoip in nse script


From: Robin Wood <robin () digininja org>
Date: Tue, 19 Feb 2013 14:01:12 +0000

On 19 February 2013 13:43, Robin Wood <robin () digininja org> wrote:

On 19 February 2013 13:41, Henri Doreau <henri.doreau () gmail com> wrote:

2013/2/19 Robin Wood <robin () digininja org>:
Hi
Has anyone done any work on running geoip lookups from an nse script?

Robin

The NSE collection already contains a handful IP geolocation scripts
(see [1][2]...). If I remember correctly, some of them had limitations
due to terms of use of external resources.

Regards

[1] http://nmap.org/nsedoc/scripts/ip-geolocation-geobytes.html
[2] http://nmap.org/nsedoc/scripts/ip-geolocation-maxmind.html

--
Henri


I was looking for geoip not ip-geo, should have looked harder, thanks.

Robin


I've had a look at ip-geolocation-geoplugin and that seems to do what I
need but it has a bug. I've not got time to debug it properly but around
line 43 the script is doing a json.parse on the response body after it has
had a string match applied to it. The string match doesn't seem to be
needed any more so removing the match and passing the response.body
directly to parse fixes the bug.

There may be a better way to fix this but it works for me so thought I'd
report it.

I'm going to look at the other scripts as well to see what they are like.

Robin
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: