From 0aaa51980d7778bf661884c22d8431aeba9c39c5 Mon Sep 17 00:00:00 2001 From: kris Date: Sat, 15 Sep 2007 02:44:15 +0000 Subject: [PATCH] Making extra functions in my HTTPpasswd.nse and HTTPtrace.nse scripts 'local'. I mark my C functions static, so I'll mark my Lua ones local --- scripts/HTTPpasswd.nse | 12 ++++++------ scripts/HTTPtrace.nse | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/HTTPpasswd.nse b/scripts/HTTPpasswd.nse index f8c5a0d3f..c69ef73c6 100644 --- a/scripts/HTTPpasswd.nse +++ b/scripts/HTTPpasswd.nse @@ -18,7 +18,7 @@ require "shortport" -- Check for a valid HTTP return code, and check -- the supposed passwd file for validity -validate = function(response) +local validate = function(response) local passwd local line local start, stop @@ -43,7 +43,7 @@ validate = function(response) end -- Connects to host:port, send cmd, and returns the (hopefully valid) response -talk = function(host, port, cmd) +local talk = function(host, port, cmd) local socket local response @@ -70,11 +70,11 @@ talk = function(host, port, cmd) return validate(response) end -httpget = function(str) +local httpget = function(str) return "GET " .. str .. " HTTP/1.0\r\n\r\n" end -hexify = function(str) +local hexify = function(str) local ret ret = str:gsub("%.", "%%2E") ret = ret:gsub("/", "%%2F") @@ -83,12 +83,12 @@ hexify = function(str) end -- Returns truncated passwd file and returned length -truncatePasswd = function(passwd) +local truncatePasswd = function(passwd) local len = 250 return passwd:sub(1, len), len end -output = function(passwd, dir) +local output = function(passwd, dir) local trunc, len = truncatePasswd(passwd) local out = "" out = out .. "Found with \"" .. dir .. "\"\n" diff --git a/scripts/HTTPtrace.nse b/scripts/HTTPtrace.nse index 80b67e018..bcd0c4d2e 100644 --- a/scripts/HTTPtrace.nse +++ b/scripts/HTTPtrace.nse @@ -21,7 +21,7 @@ categories = {"discovery"} require "shortport" require "stdnse" -truncate = function(tab) +local truncate = function(tab) local str = "" str = str .. tab[1] .. "\n" str = str .. tab[2] .. "\n" @@ -31,7 +31,7 @@ truncate = function(tab) return str end -validate = function(response, original) +local validate = function(response, original) local start, stop local body