diff --git a/CHANGELOG b/CHANGELOG index 143701ed5..bfe4787b3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [NSE] Fixed a bunch of global access errors in various libraries reported by + the nse_check_globals script. [Patrik] + o [NSE] Added url-snarf. The script sniffs the network for URLs in HTTP traffic and prints the URL together with the originating IP. [Patrik] diff --git a/nselib/iax2.lua b/nselib/iax2.lua index 57727ccce..4c5c9ee4b 100644 --- a/nselib/iax2.lua +++ b/nselib/iax2.lua @@ -137,7 +137,7 @@ IAX2 = { -- @param key number containing the element number to retrieve -- @return ie table containing the info element if it exists getIE = function(self, key) - for _, ie in ipairs(r.ies or {}) do + for _, ie in ipairs(self.ies or {}) do if ( key == ie.type ) then return ie end diff --git a/nselib/membase.lua b/nselib/membase.lua index ddbd64b15..e38bdae8c 100644 --- a/nselib/membase.lua +++ b/nselib/membase.lua @@ -163,7 +163,7 @@ TAP = { -- @return status true on success, false on failure parse = function(self) if ( 24 > #self.data ) then - stdnse.print_debug("%s: Header packet too short (%d bytes)", SCRIPT_NAME, #self.data) + stdnse.print_debug("membase: Header packet too short (%d bytes)", #self.data) return false, "Packet to short" end local pos diff --git a/nselib/mongodb.lua b/nselib/mongodb.lua index 565ac8329..1e7540980 100644 --- a/nselib/mongodb.lua +++ b/nselib/mongodb.lua @@ -623,12 +623,12 @@ local function printBuffer(strData) print(out) end -function test() - local res - res = versionQuery() - print(type(res),res:len(),res) - local out= bin.unpack('C'..#res,res) - printBuffer(res) -end +-- function test() +-- local res +-- res = versionQuery() +-- print(type(res),res:len(),res) +-- local out= bin.unpack('C'..#res,res) +-- printBuffer(res) +-- end --test() diff --git a/nselib/pppoe.lua b/nselib/pppoe.lua index 3dfd2de02..fdab4acbe 100644 --- a/nselib/pppoe.lua +++ b/nselib/pppoe.lua @@ -74,7 +74,7 @@ LCP = { -- MRU if ( 1 == opt.option ) then - opt.value = select(2, bin.unpack(">S", self.raw)) + opt.value = select(2, bin.unpack(">S", opt.raw)) end return LCP.ConfigOption:new(opt.option, opt.value, opt.raw) end, @@ -297,7 +297,7 @@ LCP = { parse = function(data) local ack = LCP.ConfigAck:new() ack.header = LCP.Header.parse(data) - ack.options = LCP.ConfigOptions.parse(data:sub(#tostring(req.header) + 1)) + ack.options = LCP.ConfigOptions.parse(data:sub(#tostring(ack.header) + 1)) return ack end, diff --git a/nselib/redis.lua b/nselib/redis.lua index 233ec80be..795602f6f 100644 --- a/nselib/redis.lua +++ b/nselib/redis.lua @@ -102,7 +102,7 @@ Response = { end table.insert(results, data) end - return true, { data = results, type = MULTIBULK } + return true, { data = results, type = Response.Type.MULTIBULK } end return false, "Unsupported response" diff --git a/nselib/vulns.lua b/nselib/vulns.lua index e24cbbf07..1dbbd2cb7 100644 --- a/nselib/vulns.lua +++ b/nselib/vulns.lua @@ -1205,10 +1205,10 @@ local l_filter_vuln = function(vuln_table, filter) if filter.id_type then if not vuln_table.IDS or not next(vuln_table.IDS) or - not vuln_table.IDS[id_type] then + not vuln_table.IDS[filter.id_type] then return false elseif filter.id then - return (vuln_table.IDS[id_type] == filter.id) + return (vuln_table.IDS[filter.id_type] == filter.id) end end end diff --git a/nselib/vuzedht.lua b/nselib/vuzedht.lua index e023c9c24..394766762 100644 --- a/nselib/vuzedht.lua +++ b/nselib/vuzedht.lua @@ -299,7 +299,7 @@ Response = { fromString = function(data) local find = Response.FIND_NODE:new(data) if ( find.header.proto_version < 13 ) then - stdnse.print_debug("ERROR: Unsupported version %d", self.header.proto_version) + stdnse.print_debug("ERROR: Unsupported version %d", find.header.proto_version) return false end diff --git a/nselib/xdmcp.lua b/nselib/xdmcp.lua index ab7405c95..1687b5724 100644 --- a/nselib/xdmcp.lua +++ b/nselib/xdmcp.lua @@ -310,7 +310,7 @@ Helper = { createSession = function(self, auth_names, authr_names, disp_no) local info = nmap.get_interface_info(self.host.interface) if ( not(info) ) then - return false, ("Failed to get information for interface %s"):format(host.interface) + return false, ("Failed to get information for interface %s"):format(self.host.interface) end local req = xdmcp.Packet[xdmcp.OpCode.QUERY]:new(auth_names)