mirror of
https://github.com/nmap/nmap.git
synced 2025-12-26 09:29:01 +00:00
Set the math.randomseed value in nse_main.lua on behalf of scripts.
Since Lua uses the C rand and srand functions, which have a static seed for the entire program, we don't want scripts doing this themselves.
This commit is contained in:
@@ -73,7 +73,6 @@ Driver = {
|
||||
-- was successful which makes it impossible to tell successfull logins
|
||||
-- from non-existing accounts apart.
|
||||
local function checkBadUser(host, port)
|
||||
math.randomseed( os.time() )
|
||||
local user = "baduser-" .. math.random(10000)
|
||||
local pass = "badpass-" .. math.random(10000)
|
||||
local helper = sip.Helper:new(host, port, { expires = 0 })
|
||||
@@ -103,4 +102,4 @@ action = function(host, port)
|
||||
local engine = brute.Engine:new(Driver, host, port)
|
||||
local status, result = engine:start()
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user