1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-06 05:26:34 +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

@@ -1,6 +1,5 @@
local coroutine = require "coroutine"
local ipOps = require "ipOps"
local math = require "math"
local nmap = require "nmap"
local packet = require "packet"
local stdnse = require "stdnse"
@@ -8,6 +7,7 @@ local string = require "string"
local tab = require "tab"
local table = require "table"
local target = require "target"
local rand = require "rand"
description = [[
Performs IPv6 host discovery by triggering stateless address auto-configuration
@@ -59,7 +59,7 @@ end
-- @return A 16-byte string of IPv6 address, and the length of the prefix.
local function get_random_ula_prefix(local_scope)
local ula_prefix
local global_id = string.char(math.random(256)-1,math.random(256)-1,math.random(256)-1,math.random(256)-1,math.random(256)-1)
local global_id = rand.random_string(5)
if local_scope then
ula_prefix = ipOps.ip_to_str("fd00::")