mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Use BruteSocket for vnc-brute
This commit is contained in:
@@ -144,11 +144,11 @@ VNC = {
|
|||||||
[0xfffffffa] = "UltraVNC MS Logon",
|
[0xfffffffa] = "UltraVNC MS Logon",
|
||||||
},
|
},
|
||||||
|
|
||||||
new = function(self, host, port)
|
new = function(self, host, port, socket)
|
||||||
local o = {
|
local o = {
|
||||||
host = host,
|
host = host,
|
||||||
port = port,
|
port = port,
|
||||||
socket = nmap.new_socket(),
|
socket = socket or nmap.new_socket(),
|
||||||
}
|
}
|
||||||
o.socket:set_timeout(5000)
|
o.socket:set_timeout(5000)
|
||||||
setmetatable(o, self)
|
setmetatable(o, self)
|
||||||
|
|||||||
@@ -58,16 +58,8 @@ Driver =
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
connect = function( self )
|
connect = function( self )
|
||||||
local status, data
|
self.vnc = vnc.VNC:new( self.host, self.port, brute.new_socket() )
|
||||||
self.vnc = vnc.VNC:new( self.host, self.port )
|
return self.vnc:connect()
|
||||||
status, data = self.vnc:connect()
|
|
||||||
if ( not(status) ) then
|
|
||||||
local err = brute.Error:new( "VNC connect failed" )
|
|
||||||
-- This might be temporary, set the retry flag
|
|
||||||
err:setRetry( true )
|
|
||||||
return false, err
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end,
|
end,
|
||||||
--- Attempts to login to the VNC server
|
--- Attempts to login to the VNC server
|
||||||
--
|
--
|
||||||
|
|||||||
Reference in New Issue
Block a user