Index: scripts/http-generator.nse =================================================================== --- scripts/http-generator.nse (revision 33384) +++ scripts/http-generator.nse (working copy) @@ -4,7 +4,8 @@ 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 @@ -- + 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 @@ 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))