1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-22 15:39:03 +00:00

Move string utility functions to stringaux.lua

This commit is contained in:
dmiller
2018-10-18 01:08:19 +00:00
parent 39cfbdf4e2
commit 0500811f5a
140 changed files with 521 additions and 418 deletions

View File

@@ -1,6 +1,7 @@
local ajp = require "ajp"
local shortport = require "shortport"
local stdnse = require "stdnse"
local stringaux = require "stringaux"
local table = require "table"
local tableaux = require "table"
@@ -66,14 +67,14 @@ action = function(host, port)
return "Failed to get a valid response for the OPTION request"
end
local methods = stdnse.strsplit(",%s", response.headers['allow'])
local methods = stringaux.strsplit(",%s", response.headers['allow'])
local output = {}
table.insert(output, ("Supported methods: %s"):format(stdnse.strjoin(" ", methods)))
table.insert(output, ("Supported methods: %s"):format(table.concat(methods, " ")))
local interesting = filter_out(methods, UNINTERESTING_METHODS)
if ( #interesting > 0 ) then
table.insert(output, "Potentially risky methods: " .. stdnse.strjoin(" ", interesting))
table.insert(output, "Potentially risky methods: " .. table.concat(interesting, " "))
table.insert(output, "See https://nmap.org/nsedoc/scripts/ajp-methods.html")
end
return stdnse.format_output(true, output)