diff --git a/scripts/broadcast-wpad-discover.nse b/scripts/broadcast-wpad-discover.nse index 0ab099d39..4d1bf8c40 100644 --- a/scripts/broadcast-wpad-discover.nse +++ b/scripts/broadcast-wpad-discover.nse @@ -119,7 +119,7 @@ local function dnsDiscover() if ( status and response[1] ) then return true, { name = name, ip = response[1] } end - until( not(d:match("%.")) ) + until( not(d) or not(d:match("%.")) ) end diff --git a/scripts/ip-geolocation-geoplugin.nse b/scripts/ip-geolocation-geoplugin.nse index 3d9174b5b..a76aaa551 100755 --- a/scripts/ip-geolocation-geoplugin.nse +++ b/scripts/ip-geolocation-geoplugin.nse @@ -41,7 +41,10 @@ local geoplugin = function(ip) local output = {} table.insert(output, "coordinates (lat,lon): "..loc.geoplugin_latitude..","..loc.geoplugin_longitude) - table.insert(output,"state: ".. loc.geoplugin_regionName..", ".. loc.geoplugin_countryName) + -- The JSON response for regionName contains a null sometimes which is represented + -- as a table by the library. + local regionName = ("table" == type(loc.geoplugin_regionName)) and "Unknown" or loc.geoplugin_regionName + table.insert(output,"state: ".. regionName ..", ".. loc.geoplugin_countryName) return output end diff --git a/scripts/membase-http-info.nse b/scripts/membase-http-info.nse index 322605710..a6b77a3d4 100644 --- a/scripts/membase-http-info.nse +++ b/scripts/membase-http-info.nse @@ -112,7 +112,7 @@ local function cmdReq(host, port, url, result) result[item] = { name = name, value = val } end end - return result + return true, result end action = function(host, port) @@ -121,7 +121,11 @@ action = function(host, port) local result for _, u in ipairs(urls) do - result = cmdReq(host, port, u, result) + status, result = cmdReq(host, port, u, result) + end + + if ( not(result) or not(next(result)) ) then + return end local output = tab.new(2)