1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +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

@@ -65,6 +65,7 @@ local httpspider = require "httpspider"
local vulns = require "vulns"
local url = require "url"
local string = require "string"
local rand = require "rand"
portrule = shortport.http
@@ -83,7 +84,7 @@ local function probe_http_verbs(host, port, uri)
return true, "POST"
end
--With a random generated verb we look for 400 and 501 status
local random_verb_req = http.generic_request(host, port, stdnse.generate_random_string(4), uri)
local random_verb_req = http.generic_request(host, port, rand.random_alpha(4):upper(), uri)
local retcodes = {
[400] = true, -- Bad Request
[401] = true, -- Authentication needed