mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Played a round of nse_check_globals and fixed a bunch of reported problems.
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
local bin = require "bin"
|
local bin = require "bin"
|
||||||
local packet = require "packet"
|
local packet = require "packet"
|
||||||
local stdnse = require "stdnse"
|
local stdnse = require "stdnse"
|
||||||
local tab = require "tab"
|
local tab = require "tab"
|
||||||
local target = require "target"
|
local target = require "target"
|
||||||
|
|
||||||
--- The following file contains a list of decoders used by the
|
--- The following file contains a list of decoders used by the
|
||||||
-- broadcast-listener script. A decoder can be either "ethernet" based or IP
|
-- broadcast-listener script. A decoder can be either "ethernet" based or IP
|
||||||
-- based. As we're only monitoring broadcast traffic (ie. traffic not
|
-- based. As we're only monitoring broadcast traffic (ie. traffic not
|
||||||
@@ -238,7 +238,7 @@ Decoders = {
|
|||||||
elseif ( route_type == 259 ) then
|
elseif ( route_type == 259 ) then
|
||||||
-- external route, from a different routing protocol
|
-- external route, from a different routing protocol
|
||||||
pos, size, nexthop = bin.unpack(">Si", data, pos)
|
pos, size, nexthop = bin.unpack(">Si", data, pos)
|
||||||
local orig_rtr_oct1, orig_rtr_oct2, orig_rtr_oct3, orig_rtr_oct4
|
local orig_rtr_oct1, orig_rtr_oct2, orig_rtr_oct3, orig_rtr_oct4, ext_proto_id, ext_metric
|
||||||
pos, orig_rtr_oct1, orig_rtr_oct2, orig_rtr_oct3, orig_rtr_oct4 = bin.unpack(">CCCC", data, pos)
|
pos, orig_rtr_oct1, orig_rtr_oct2, orig_rtr_oct3, orig_rtr_oct4 = bin.unpack(">CCCC", data, pos)
|
||||||
orig_router = orig_rtr_oct1 .. '.' .. orig_rtr_oct2 .. '.' .. orig_rtr_oct3 .. '.' .. orig_rtr_oct4
|
orig_router = orig_rtr_oct1 .. '.' .. orig_rtr_oct2 .. '.' .. orig_rtr_oct3 .. '.' .. orig_rtr_oct4
|
||||||
pos, orig_as, arbtag, ext_metric = bin.unpack(">iii", data, pos)
|
pos, orig_as, arbtag, ext_metric = bin.unpack(">iii", data, pos)
|
||||||
@@ -687,4 +687,4 @@ Decoders = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ local coroutine = require "coroutine"
|
|||||||
local http = require "http"
|
local http = require "http"
|
||||||
local nmap = require "nmap"
|
local nmap = require "nmap"
|
||||||
local stdnse = require "stdnse"
|
local stdnse = require "stdnse"
|
||||||
|
local string = require "string"
|
||||||
local table = require "table"
|
local table = require "table"
|
||||||
local url = require "url"
|
local url = require "url"
|
||||||
_ENV = stdnse.module("httpspider", stdnse.seeall)
|
_ENV = stdnse.module("httpspider", stdnse.seeall)
|
||||||
|
|||||||
@@ -814,7 +814,7 @@ end
|
|||||||
-- data are undefined.
|
-- data are undefined.
|
||||||
function smb_read(smb, read_data)
|
function smb_read(smb, read_data)
|
||||||
local status
|
local status
|
||||||
local pos, netbios_length, length, header, parameter_length, parameters, data_length, data
|
local pos, netbios_data, netbios_length, length, header, parameter_length, parameters, data_length, data
|
||||||
local attempts = 5
|
local attempts = 5
|
||||||
|
|
||||||
stdnse.print_debug(3, "SMB: Receiving SMB packet")
|
stdnse.print_debug(3, "SMB: Receiving SMB packet")
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
local bin = require "bin"
|
||||||
local bit = require "bit"
|
local bit = require "bit"
|
||||||
local dns = require "dns"
|
local dns = require "dns"
|
||||||
local ipOps = require "ipOps"
|
local ipOps = require "ipOps"
|
||||||
@@ -299,13 +300,13 @@ local RD = {
|
|||||||
offset = offset + 4
|
offset = offset + 4
|
||||||
offset, lat, lon, alt = bin.unpack(">III", data, offset)
|
offset, lat, lon, alt = bin.unpack(">III", data, offset)
|
||||||
lat = (lat-2^31)/3600000 --degrees
|
lat = (lat-2^31)/3600000 --degrees
|
||||||
latd = 'N'
|
local latd = 'N'
|
||||||
if lat < 0 then
|
if lat < 0 then
|
||||||
latd = 'S'
|
latd = 'S'
|
||||||
lat = 0-lat
|
lat = 0-lat
|
||||||
end
|
end
|
||||||
lon = (lon-2^31)/3600000 --degrees
|
lon = (lon-2^31)/3600000 --degrees
|
||||||
lond = 'E'
|
local lond = 'E'
|
||||||
if lon < 0 then
|
if lon < 0 then
|
||||||
lond = 'W'
|
lond = 'W'
|
||||||
lon = 0-lon
|
lon = 0-lon
|
||||||
@@ -329,6 +330,7 @@ function get_rdata(data, offset, ttype)
|
|||||||
elseif RD[typetab[ttype]] then
|
elseif RD[typetab[ttype]] then
|
||||||
return RD[typetab[ttype]](data, offset)
|
return RD[typetab[ttype]](data, offset)
|
||||||
else
|
else
|
||||||
|
local field
|
||||||
offset, field = bin.unpack("A" .. bto16(data, offset-2), data, offset)
|
offset, field = bin.unpack("A" .. bto16(data, offset-2), data, offset)
|
||||||
return offset, ("hex: %s"):format(stdnse.tohex(field))
|
return offset, ("hex: %s"):format(stdnse.tohex(field))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -64,10 +64,10 @@ Default installations of older versions of frontpage extensions allow anonymous
|
|||||||
|
|
||||||
if data and data.status and data.status == 200 then
|
if data and data.status and data.status == 200 then
|
||||||
--server does support frontpage extensions
|
--server does support frontpage extensions
|
||||||
fp_version = string.match(data.body,"FPVersion=\"[%d%.]*\"")
|
local fp_version = string.match(data.body,"FPVersion=\"[%d%.]*\"")
|
||||||
if fp_version then
|
if fp_version then
|
||||||
-- do post request http://msdn.microsoft.com/en-us/library/ms446353
|
-- do post request http://msdn.microsoft.com/en-us/library/ms446353
|
||||||
postdata = "method=open+service:".. fp_version .."&service_name=/"
|
local postdata = "method=open+service:".. fp_version .."&service_name=/"
|
||||||
data = http.post(host,port,path .. "/_vti_bin/_vti_aut/author.dll",nil,nil,postdata)
|
data = http.post(host,port,path .. "/_vti_bin/_vti_aut/author.dll",nil,nil,postdata)
|
||||||
if data and data.status then
|
if data and data.status then
|
||||||
if data.status == 200 then
|
if data.status == 200 then
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ local http = require "http"
|
|||||||
local stdnse = require "stdnse"
|
local stdnse = require "stdnse"
|
||||||
local shortport = require "shortport"
|
local shortport = require "shortport"
|
||||||
local string = require "string"
|
local string = require "string"
|
||||||
|
local table = require "table"
|
||||||
local url = require "url"
|
local url = require "url"
|
||||||
|
|
||||||
description = [[
|
description = [[
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ local mysql = require "mysql"
|
|||||||
local nmap = require "nmap"
|
local nmap = require "nmap"
|
||||||
local shortport = require "shortport"
|
local shortport = require "shortport"
|
||||||
local stdnse = require "stdnse"
|
local stdnse = require "stdnse"
|
||||||
|
local string = require "string"
|
||||||
local table = require "table"
|
local table = require "table"
|
||||||
local vulns = require "vulns"
|
local vulns = require "vulns"
|
||||||
local openssl = stdnse.silent_require "openssl"
|
local openssl = stdnse.silent_require "openssl"
|
||||||
|
|||||||
Reference in New Issue
Block a user