1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 03:49:01 +00:00

o [NSE] Added credential storage library (creds.lua) and modified the brute

library and scripts to make use of it. [Patrik]
This commit is contained in:
patrik
2011-06-19 17:18:29 +00:00
parent 5561f89642
commit f4bf440b14
16 changed files with 298 additions and 102 deletions

View File

@@ -69,7 +69,8 @@ Driver =
login = function( self, username, password )
local status, data = self.vnc:handshake()
if ( not(status) and data:match("Too many authentication failures") ) then
if ( not(status) and ( data:match("Too many authentication failures") or
data:match("Your connection has been rejected.") ) ) then
local err = brute.Error:new( data )
err:setAbort( true )
return false, err
@@ -83,7 +84,7 @@ Driver =
status, data = self.vnc:login( nil, password )
if ( status ) then
return true, brute.Account:new("", password, "OPEN")
return true, brute.Account:new("", password, creds.State.VALID)
elseif ( not( data:match("Authentication failed") ) ) then
local err = brute.Error:new( data )
-- This might be temporary, set the retry flag
@@ -132,6 +133,7 @@ action = function(host, port)
local status, result
local engine = brute.Engine:new(Driver, host, port )
engine.options.script_name = SCRIPT_NAME
engine.options.firstonly = true
engine.options:setOption( "passonly", true )