1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 10:29:03 +00:00

Move stdnse.generate_random_string to new rand.lua

This commit is contained in:
dmiller
2018-09-08 17:07:06 +00:00
parent deea96de7c
commit 26ef852a28
43 changed files with 123 additions and 186 deletions

View File

@@ -75,17 +75,6 @@ prerule = function()
return true
end
-- Creates a random MAC address
--
-- @return mac_addr string containing a random MAC
local function randomizeMAC()
local mac_addr = {}
for j=1, 6 do
mac_addr[j] = string.char(math.random(1, 255))
end
return table.concat(mac_addr)
end
-- Gets a list of available interfaces based on link and up filters
--
-- @param link string containing the link type to filter
@@ -162,7 +151,7 @@ action = function()
-- randomizing the MAC could exhaust dhcp servers with small scopes
-- if ran multiple times, so we should probably refrain from doing
-- this?
local mac = "\xDE\xAD\xC0\xDE\xCA\xFE" --randomizeMAC()
local mac = "\xDE\xAD\xC0\xDE\xCA\xFE"
local interfaces