Nmap nessus-brute NSE Script
This page contains detailed information about how to use the nessus-brute NSE script. For list of all NSE scripts, visit the Nmap NSE Library.
Select: |
---|
Script Overview
Script source code: https://github.com/nmap/nmap/tree/master/scripts/nessus-brute.nse
Script categories: intrusive, brute
Target service / protocol: nessus, tcp
Target network port(s): 1241
List of CVEs: -
Script Description
The nessus-brute.nse script performs brute force password auditing against a Nessus vulnerability scanning daemon using the NTP 1.2 protocol.
Nessus-brute NSE Script Arguments
This is a full list of arguments supported by the nessus-brute.nse script:
creds.globalCredentials to be returned by Credentials.getCredentials regardless of the service.
creds.[service]Credentials to be returned by Credentials.getCredentials for [service]. E.g. creds.http=admin:password
passdbThe filename of an alternate password database. Default: nselib/data/passwords.lst
unpwdb.passlimit
The maximum number of passwords passwords
will return (default unlimited).
The maximum amount of time that any iterator will run before stopping. The value is in seconds by default and you can follow it with ms
, s
, m
, or h
for milliseconds, seconds, minutes, or hours. For example, unpwdb.timelimit=30m
or unpwdb.timelimit=.5h
for 30 minutes. The default depends on the timing template level (see the module description). Use the value 0
to disable the time limit.
The maximum number of usernames usernames
will return (default unlimited).
The filename of an alternate username database. Default: nselib/data/usernames.lst
brute.credfileA file containing username and password pairs delimited by '/'
brute.delayThe number of seconds to wait between guesses (default: 0)
brute.emptypassGuess an empty password for each user (default: false)
brute.firstonlyStop guessing after first password is found (default: false)
brute.guessesThe number of guesses to perform against each account. (default: 0 (unlimited)). The argument can be used to prevent account lockouts.
brute.modeCan be user, pass or creds and determines what mode to run the engine in.
- user - the unpwdb library is used to guess passwords, every password Password is tried for each user. (The user iterator is in the outer loop)
- pass - the unpwdb library is used to guess passwords, each password Is tried for every user. (The password iterator is in the outer loop)
- creds - a set of credentials (username and password pairs) are Guessed against the service. This allows for lists of known or common username and password combinations to be tested. If no mode is specified and the script has not added any custom iterator the pass mode will be enabled.
Iterate over passwords only for services that provide only a password for authentication. (default: false)
brute.retriesThe number of times to retry if recoverable failures occur. (default: 2)
brute.startThe number of threads the engine will start with. (default: 5).
brute.threadsThe number of initial worker threads, the number of active threads will be automatically adjusted.
brute.uniqueMake sure that each password is only guessed once (default: true)
brute.useraspassGuess the username as password for each user (default: true)
creds.[service]Credentials to be returned by Credentials.getCredentials for [service]. E.g. creds.http=admin:password
- - -
To use these script arguments, add them to the Nmap command line using the --script-args arg1=value,[arg2=value,..]
syntax. For example:
nmap --script=nessus-brute --script-args creds.global=value,creds.\[service]=value <target>
Nessus-brute NSE Script Example Usage
Here's an example of how to use the nessus-brute.nse script:
nmap --script nessus-brute -p 1241 <host>
Nessus-brute NSE Script Example Output
Here's a sample output from the nessus-brute.nse script:
PORT STATE SERVICE
1241/tcp open nessus
| nessus-brute:
| Accounts
| nessus:nessus - Valid credentials
| Statistics
|_ Performed 35 guesses in 75 seconds, average tps: 0
This script does not appear to perform well when run using multiple threads
Although, it's very slow running under a single thread it does work as intended
Nessus-brute NSE Script Example XML Output
There is no sample XML output for this module. However, by providing the -oX <file>
option, Nmap will produce a XML output and save it in the file.xml
file.
Author
- Patrik Karlsson
References
- https://nmap.org/nsedoc/scripts/nessus-brute.html
- https://github.com/nmap/nmap/tree/master/scripts/nessus-brute.nse
See Also
Related NSE scripts to the nessus-brute.nse script:
Visit Nmap NSE Library for more scripts.
The nessus-brute.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.
Failed to send handshake to server
Here is a relevant code snippet related to the "Failed to send handshake to server" error message:
57: login = function( self, username, password )
58: local handshake = "< NTP/1.2 >< plugins_cve_id plugins_version timestamps dependencies fast_login >\n"
59:
60: local status, err = self.socket:send(handshake)
61: if ( not(status) ) then
62: local err = brute.Error:new( "Failed to send handshake to server" )
63: err:setAbort(true)
64: return false, err
65: end
66:
67: local line
The server failed to respond to handshake
Here is a relevant code snippet related to the "The server failed to respond to handshake" error message:
65: end
66:
67: local line
68: status, line = self.socket:receive_buf(match.pattern_limit("\r?\n", 2048), false)
69: if ( not(status) or line ~= "< NTP/1.2 >" ) then
70: local err = brute.Error:new( "The server failed to respond to handshake" )
71: err:setAbort( true )
72: return false, err
73: end
74:
75: status, line = self.socket:receive()
Expected "User : ", got something else
Here is a relevant code snippet related to the "Expected "User : ", got something else" error message:
72: return false, err
73: end
74:
75: status, line = self.socket:receive()
76: if ( not(status) or line ~= "User : ") then
77: local err = brute.Error:new( "Expected "User : ", got something else" )
78: err:setRetry( true )
79: return false, err
80: end
81:
82: status = self.socket:send(username .. "\n")
Failed to send username to server
Here is a relevant code snippet related to the "Failed to send username to server" error message:
79: return false, err
80: end
81:
82: status = self.socket:send(username .. "\n")
83: if ( not(status) ) then
84: local err = brute.Error:new( "Failed to send username to server" )
85: err:setAbort( true )
86: return false, err
87: end
88:
89: status, line = self.socket:receive()
Expected "Password : ", got something else
Here is a relevant code snippet related to the "Expected "Password : ", got something else" error message:
86: return false, err
87: end
88:
89: status, line = self.socket:receive()
90: if ( not(status) or line ~= "Password : ") then
91: local err = brute.Error:new( "Expected "Password : ", got something else" )
92: err:setRetry( true )
93: return false, err
94: end
95:
96: status = self.socket:send(password)
Failed to send password to server
Here is a relevant code snippet related to the "Failed to send password to server" error message:
93: return false, err
94: end
95:
96: status = self.socket:send(password)
97: if ( not(status) ) then
98: local err = brute.Error:new( "Failed to send password to server" )
99: err:setAbort( true )
100: return false, err
101: end
102:
103: -- the line feed has to be sent separate like this, otherwise we don't
Failed to send password to server
Here is a relevant code snippet related to the "Failed to send password to server" error message:
102:
103: -- the line feed has to be sent separate like this, otherwise we don't
104: -- receive the server response and the server simply hangs up
105: status = self.socket:send("\n")
106: if ( not(status) ) then
107: local err = brute.Error:new( "Failed to send password to server" )
108: err:setAbort( true )
109: return false, err
110: end
111:
112: -- we force a brief incorrect statement just to get an error message to
Failed to send bad client preferences packet to server
Here is a relevant code snippet related to the "Failed to send bad client preferences packet to server" error message:
112: -- we force a brief incorrect statement just to get an error message to
113: -- confirm that we've successfully authenticated to the server
114: local bad_cli_pref = "CLIENT <|> PREFERENCES <|>\n<|> CLIENT\n"
115: status = self.socket:send(bad_cli_pref)
116: if ( not(status) ) then
117: local err = brute.Error:new( "Failed to send bad client preferences packet to server" )
118: err:setAbort( true )
119: return false, err
120: end
121:
122: -- if the server disconnects us at this point, it's most likely due to
Incorrect password
Here is a relevant code snippet related to the "Incorrect password" error message:
122: -- if the server disconnects us at this point, it's most likely due to
123: -- that the authentication failed, so simply treat it as an incorrect
124: -- password, rather than abort.
125: status, line = self.socket:receive()
126: if ( not(status) ) then
127: return false, brute.Error:new( "Incorrect password" )
128: end
129:
130: if ( line:match("SERVER <|> PREFERENCES_ERRORS <|>") ) then
131: return true, creds.Account:new(username, password, creds.State.VALID)
132: end
Incorrect password
Here is a relevant code snippet related to the "Incorrect password" error message:
129:
130: if ( line:match("SERVER <|> PREFERENCES_ERRORS <|>") ) then
131: return true, creds.Account:new(username, password, creds.State.VALID)
132: end
133:
134: return false, brute.Error:new( "Incorrect password" )
135: end,
136:
137: disconnect = function( self )
138: self.socket:close()
139: end,
Version
This page has been created based on Nmap version 7.92.
Go back to menu.