1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-05 13:06:32 +00:00

Fixing locals/globals on following scripts

- telnet-brute.nse required a small refactoring to fix the use of a global variable called soc
This commit is contained in:
joao
2009-07-16 22:54:38 +00:00
parent 4d9094fb21
commit a14ab3c637
4 changed files with 24 additions and 22 deletions

View File

@@ -26,11 +26,12 @@ license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"default", "discovery", "safe"}
runlevel = 1.0
portrule = shortport.port_or_service({80, 8080}, {"http"})
portrule = shortport.port_or_service({80, 8080,443}, {"http","https"})
local last_len = 0
-- split the output in 50 character length lines
local function buildOutput(output, w)
local nl
if w:len() == 0 then
return nil
@@ -68,6 +69,7 @@ local function parse_robots(body, output)
end
action = function(host, port)
local dis_count, noun
local answer = http.get(host, port, "/robots.txt" )
if answer.status ~= 200 then
@@ -99,7 +101,7 @@ action = function(host, port)
noun = dis_count == 1 and "entry " or "entries "
shown = (detail == 0 or detail == dis_count)
local shown = (detail == 0 or detail == dis_count)
and "\n" or '(' .. detail .. ' shown)\n'
return "has " .. dis_count .. " disallowed " .. noun ..