mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Merge r18689:r19511 from /nmap-exp/djalal/nse-rules.
o Add two new Script scan phases: Script Pre-scanning phase: before any Nmap scan operation, activated by the new "prerule". Script Post-scanning phase: after all Nmap scan operations, activated by the new "postrule". o New environment variables: SCRIPT_PATH SCRIPT_NAME SCRIPT_TYPE: the type of the rule that activated the script.
This commit is contained in:
@@ -150,13 +150,12 @@ end
|
||||
-- @return nil
|
||||
|
||||
function init()
|
||||
local filename = filename and filename:match( "[\\/]([^\\/]+)\.nse$" ) or ""
|
||||
local customlist = nmap.registry.args.users or
|
||||
(nmap.registry.args.userdir and nmap.registry.args.userdir.users) or
|
||||
nmap.registry.args['userdir.users']
|
||||
local read, usernames = datafiles.parse_file(customlist or "nselib/data/usernames.lst", {})
|
||||
if not read then
|
||||
stdnse.print_debug(1, "%s %s", filename,
|
||||
stdnse.print_debug(1, "%s %s", SCRIPT_NAME,
|
||||
usernames or "Unknown Error reading usernames list.")
|
||||
nmap.registry.userdir = {}
|
||||
return nil
|
||||
@@ -164,7 +163,7 @@ function init()
|
||||
-- random dummy username to catch false positives (not necessary)
|
||||
-- if #usernames > 0 then table.insert(usernames, 1, randomstring()) end
|
||||
nmap.registry.userdir = usernames
|
||||
stdnse.print_debug(1, "%s Testing %d usernames.", filename, #usernames)
|
||||
stdnse.print_debug(1, "%s Testing %d usernames.", SCRIPT_NAME, #usernames)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user