From 801e69e32353f13aeb45591d41152936cc8c8512 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 24 Feb 2013 02:50:03 +0000 Subject: [PATCH] Update ip-geolocation-geoplugin.nse for a new data format. The response seems to be plain JSON now, with nothing extraneous. Reported by Robin Wood. http://seclists.org/nmap-dev/2013/q1/232 --- CHANGELOG | 3 +++ scripts/ip-geolocation-geoplugin.nse | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 6076a73aa..7bbb684e6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [NSE] Changed ip-geolocation-geoplugin to use the web service's new + output format. Reported by Robin Wood. + o Limited the number of open sockets in ultra_scan to FD_SETSIZE. Very fast connect scans could write past the end of an fd_set and cause a variety of crashes: diff --git a/scripts/ip-geolocation-geoplugin.nse b/scripts/ip-geolocation-geoplugin.nse index 7475c1404..93d432f33 100644 --- a/scripts/ip-geolocation-geoplugin.nse +++ b/scripts/ip-geolocation-geoplugin.nse @@ -38,7 +38,7 @@ end -- No limit on requests local geoplugin = function(ip) local response = http.get("www.geoplugin.net", 80, "/json.gp?ip="..ip, nil) - local stat, loc = json.parse(response.body:match("geoPlugin%((.+)%)")) + local stat, loc = json.parse(response.body) if not stat then return nil end local output = {}