From b683234f45b483f995bea7989265d549c82061a8 Mon Sep 17 00:00:00 2001 From: patrik Date: Mon, 4 Jun 2012 04:37:29 +0000 Subject: [PATCH] o [NSE] Applied patch from Daniel Miller that fixes bug in several scripts and libraries http://seclists.org/nmap-dev/2012/q2/593 [Daniel Miller] --- CHANGELOG | 3 +++ nselib/dns.lua | 2 +- scripts/traceroute-geolocation.nse | 3 ++- scripts/wsdd-discover.nse | 8 ++------ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f728f36ab..857d7144b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [NSE] Applied patch from Daniel Miller that fixes bug in several scripts and + libraries http://seclists.org/nmap-dev/2012/q2/593 [Daniel Miller] + o [NSE] Added the script smb-ls that lists files on SMB shares and produces output similar to the dir command on Windows. [Patrik Karlsson] diff --git a/nselib/dns.lua b/nselib/dns.lua index 8fa8965f9..fd02bf195 100644 --- a/nselib/dns.lua +++ b/nselib/dns.lua @@ -746,7 +746,7 @@ end -- @param fqdn containing the fully qualified domain name -- @return encQ containing the encoded value local function encodeFQDN(fqdn) - if ( not(fqdn) or #fqdn == 0 ) then return end + if ( not(fqdn) or #fqdn == 0 ) then return string.char(0) end local parts = stdnse.strsplit("%.", fqdn) local encQ = "" diff --git a/scripts/traceroute-geolocation.nse b/scripts/traceroute-geolocation.nse index 355e9d648..7bc601252 100644 --- a/scripts/traceroute-geolocation.nse +++ b/scripts/traceroute-geolocation.nse @@ -4,6 +4,7 @@ local json = require "json" local stdnse = require "stdnse" local tab = require "tab" local table = require "table" +local ipOps = require "ipOps" description = [[ Lists the geographic locations of each hop in a traceroute and optionally @@ -97,7 +98,7 @@ action = function(host) name = ("%s"):format(hop.ip) end local rtt = tonumber(hop.times.srtt) * 1000 - if ( not(ipops.isPrivate(hop.ip) ) ) then + if ( not(ipOps.isPrivate(hop.ip) ) ) then local lat, lon, reg, ctry = geoLookup(hop.ip) table.insert(coordinates, { hop = count, lat = lat, lon = lon }) tab.addrow( output, count, ("%.2f"):format(rtt), name, ("%d,%d %s (%s)"):format(lat, lon, ctry, reg) ) diff --git a/scripts/wsdd-discover.nse b/scripts/wsdd-discover.nse index e402342e1..d749106dd 100644 --- a/scripts/wsdd-discover.nse +++ b/scripts/wsdd-discover.nse @@ -50,12 +50,8 @@ discoverThread = function( funcname, host, port, results ) local helper = wsdd.Helper:new(host, port) helper:setTimeout(timeout) - if ( func ) then - local status, result = helper[funcname](helper) - if ( status ) then table.insert(results, result) end - else - stdnse.print_debug("ERROR: Failed to call function: %s", funcname) - end + local status, result = helper[funcname](helper) + if ( status ) then table.insert(results, result) end condvar("broadcast") end