From 8f3165f7a68b5fe06151a63c2898eefbe9435850 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Dec 2012 10:22:55 +0000 Subject: [PATCH] Don't substitute nonprinting characters in http-git. NSE already escapes output everywhere. More importantly, the call to gsub returns two values, which were being treated as structured output and unstructured output. The second return value is an integer count of substitutions, so what you would see in normal output was |_http-git: 0 while what used to be normal output was going to XML. Alex Weber noticed that the script was not working. http://seclists.org/nmap-dev/2012/q4/397 --- scripts/http-git.nse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/http-git.nse b/scripts/http-git.nse index 55fc0d631..ef6d40ebf 100644 --- a/scripts/http-git.nse +++ b/scripts/http-git.nse @@ -260,6 +260,6 @@ function action(host, port) end -- Replace non-printing characters with asterisks - if #out > 0 then return string.gsub(stdnse.format_output(true, out), "[^%w%p%s]", "*") + if #out > 0 then return stdnse.format_output(true, out) else return nil end end