mirror of
https://github.com/nmap/nmap.git
synced 2026-08-31 23:40:57 +00:00
NDMP fixes. Closes #930
This commit is contained in:
parent
ce86585b16
commit
9358ab0164
4 changed files with 31 additions and 7 deletions
|
|
@ -54,6 +54,7 @@ action = function(host, port)
|
|||
|
||||
status, msg = helper:getFsInfo()
|
||||
if ( not(status) ) then return fail("Failed to get filesystem information from server") end
|
||||
if ( msg.header.error == ndmp.NDMP.ErrorType.NOT_AUTHORIZED_ERROR ) then return fail("Not authorized to get filesystem information from server") end
|
||||
helper:close()
|
||||
|
||||
local result = tab.new(3)
|
||||
|
|
|
|||
|
|
@ -50,15 +50,22 @@ action = function(host, port)
|
|||
if ( not(status) ) then return fail("Failed to get server information from server") end
|
||||
helper:close()
|
||||
|
||||
local major, minor, build, smajor, sminor = hi.hostinfo.osver:match("Major Version=(%d+) Minor Version=(%d+) Build Number=(%d+) ServicePack Major=(%d+) ServicePack Minor=(%d+)")
|
||||
port.version.name = "ndmp"
|
||||
port.version.product = vendorLookup(si.serverinfo.vendor)
|
||||
port.version.ostype = hi.hostinfo.ostype
|
||||
if ( hi.hostinfo.hostname ) then
|
||||
port.version.extrainfo = ("Name: %s; "):format(hi.hostinfo.hostname)
|
||||
end
|
||||
if ( major and minor and build and smajor and sminor ) then
|
||||
port.version.extrainfo = port.version.extrainfo .. ("OS ver: %d.%d; OS Build: %d; OS Service Pack: %d"):format(major, minor, build, smajor)
|
||||
|
||||
-- hostinfo can be nil if we get an auth error
|
||||
if ( hi.hostinfo ) then
|
||||
if ( hi.hostinfo.hostname ) then
|
||||
port.version.extrainfo = ("Name: %s; "):format(hi.hostinfo.hostname)
|
||||
end
|
||||
|
||||
local major, minor, build, smajor, sminor = hi.hostinfo.osver:match("Major Version=(%d+) Minor Version=(%d+) Build Number=(%d+) ServicePack Major=(%d+) ServicePack Minor=(%d+)")
|
||||
if ( major and minor and build and smajor and sminor ) then
|
||||
port.version.extrainfo = port.version.extrainfo .. ("OS ver: %d.%d; OS Build: %d; OS Service Pack: %d"):format(major, minor, build, smajor)
|
||||
end
|
||||
|
||||
port.version.ostype = hi.hostinfo.ostype
|
||||
end
|
||||
|
||||
nmap.set_port_version(host, port)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue