mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
Replace msrpc.random_crap with stdnse.generate_random_string
This commit is contained in:
parent
8f939279ca
commit
f6733b2d89
3 changed files with 5 additions and 26 deletions
|
|
@ -168,14 +168,10 @@ local function empty(t)
|
|||
return not next(t)
|
||||
end
|
||||
|
||||
local function random_string()
|
||||
return msrpc.random_crap(8,"etaoinshrdlucmfw")
|
||||
end
|
||||
|
||||
-- generate a random hash with domains suffix
|
||||
-- return both domain and its hash
|
||||
local function generate_hash(domain, iter, salt)
|
||||
local rand_str = random_string()
|
||||
local rand_str = stdnse.generate_random_string(8, "etaoinshrdlucmfw")
|
||||
local random_domain = rand_str .. "." .. domain
|
||||
local packed_domain = {}
|
||||
for word in string.gmatch(random_domain, "[^%.]+") do
|
||||
|
|
@ -239,7 +235,7 @@ local function enum(host, port, domain)
|
|||
local todo = {}
|
||||
local dnssec, status, result = false, false, "No Answer"
|
||||
local result = {}
|
||||
local subdomain = msrpc.random_crap(8,"etaoinshrdlucmfw")
|
||||
local subdomain = stdnse.generate_random_string(8, "etaoinshrdlucmfw")
|
||||
local full_domain = join({subdomain, domain})
|
||||
local iter
|
||||
local salt
|
||||
|
|
|
|||
|
|
@ -474,9 +474,9 @@ function check_ms06_025(host)
|
|||
end
|
||||
local req, buff, sr_result
|
||||
req = msrpc.RRAS_marshall_RequestBuffer(
|
||||
0x01,
|
||||
msrpc.RRAS_RegTypes['GETDEVCONFIG'],
|
||||
msrpc.random_crap(3000))
|
||||
0x01,
|
||||
msrpc.RRAS_RegTypes['GETDEVCONFIG'],
|
||||
stdnse.generate_random_string(3000, "0123456789abcdefghijklmnoprstuvzxwyABCDEFGHIJKLMNOPRSTUVZXWY"))
|
||||
status, sr_result = msrpc.RRAS_SubmitRequest(smbstate, req)
|
||||
msrpc.stop_smb(smbstate)
|
||||
--sanity check
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue