diff --git a/scripts/http-generator.nse b/scripts/http-generator.nse index 0d2a7454d..792595734 100644 --- a/scripts/http-generator.nse +++ b/scripts/http-generator.nse @@ -4,7 +4,8 @@ local stdnse = require "stdnse" local string = require "string" description = [[ -Displays the contents of the "generator" meta tag of a web page (default: /) if there is one. +Displays the contents of the "generator" meta tag of a web page (default: /) +if there is one. ]] author = "Michael Kohl" @@ -42,12 +43,10 @@ categories = {"default", "discovery", "safe"} -- + improve redirect pattern -- + update documentation -- + add changelog +-- 2014-07-29 Fabian Affolter : +-- + update generator pattern --- TODO: --- more generic generator pattern - - --- helper function +-- Helper function local follow_redirects = function(host, port, path, n) local pattern = "^[hH][tT][tT][pP]/1.[01] 30[12]" local response = http.get(host, port, path) @@ -69,9 +68,9 @@ action = function(host, port) local redirects = tonumber(stdnse.get_script_args('http-generator.redirects')) or 3 -- Worst case: - local pattern = '' + local pattern = '' - -- make pattern case-insensitive + -- Make pattern case-insensitive pattern = pattern:gsub("%a", function (c) return string.format("[%s%s]", string.lower(c), string.upper(c))