mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 00:19:01 +00:00
Add Tight VNC auth type
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
local shortport = require "shortport"
|
||||
local stdnse = require "stdnse"
|
||||
local string = require "string"
|
||||
local vnc = require "vnc"
|
||||
|
||||
description = [[
|
||||
@@ -88,6 +89,48 @@ action = function(host, port)
|
||||
v:disconnect()
|
||||
end
|
||||
|
||||
if v:supportsSecType(v.sectypes.TIGHT) then
|
||||
if not v.socket:get_info() then
|
||||
-- reconnect if necessary
|
||||
v:connect()
|
||||
v:handshake()
|
||||
end
|
||||
status, data = v:handshake_tight()
|
||||
if not status then
|
||||
stdnse.debug1("Failed to handshake Tight: %s", data)
|
||||
else
|
||||
local mt = {
|
||||
__tostring = function(t)
|
||||
return string.format("%s %s (%d)", t.vendor, t.signature, t.code)
|
||||
end
|
||||
}
|
||||
local tunnels = {}
|
||||
for _, t in ipairs(v.tight.tunnels) do
|
||||
setmetatable(t, mt)
|
||||
tunnels[#tunnels+1] = t
|
||||
end
|
||||
if #tunnels > 0 then
|
||||
result["Tight auth tunnels"] = tunnels
|
||||
end
|
||||
if #v.tight.types == 0 then
|
||||
none_auth = true
|
||||
result["Tight auth subtypes"] = {"None"}
|
||||
else
|
||||
local subtypes = {}
|
||||
for _, t in ipairs(v.tight.types) do
|
||||
if t.code == 1 then
|
||||
none_auth = true
|
||||
end
|
||||
setmetatable(t, mt)
|
||||
subtypes[#subtypes+1] = t
|
||||
end
|
||||
result["Tight auth subtypes"] = subtypes
|
||||
end
|
||||
end
|
||||
-- Reset the connection for further tests
|
||||
v:disconnect()
|
||||
end
|
||||
|
||||
if v:supportsSecType(v.sectypes.TLS) then
|
||||
if not v.socket:get_info() then
|
||||
-- reconnect if necessary
|
||||
|
||||
Reference in New Issue
Block a user