mirror of
https://github.com/nmap/nmap.git
synced 2026-02-09 23:16:32 +00:00
Re-indent some scripts. Whitespace-only commit
https://secwiki.org/w/Nmap/Code_Standards
This commit is contained in:
@@ -27,42 +27,42 @@ categories = {"default", "safe"}
|
||||
|
||||
|
||||
hostrule = function(host)
|
||||
return smb.get_port(host) ~= nil
|
||||
return smb.get_port(host) ~= nil
|
||||
end
|
||||
|
||||
local function go(host)
|
||||
local status, smbstate, result
|
||||
local dialects = { "NT LM 0.12", "SMB 2.002", "SMB 2.???" }
|
||||
local overrides = {dialects=dialects}
|
||||
local status, smbstate, result
|
||||
local dialects = { "NT LM 0.12", "SMB 2.002", "SMB 2.???" }
|
||||
local overrides = {dialects=dialects}
|
||||
|
||||
status, smbstate = smb.start(host)
|
||||
if(not(status)) then
|
||||
return false, "Couldn't start SMB session: " .. smbstate
|
||||
end
|
||||
status, smbstate = smb.start(host)
|
||||
if(not(status)) then
|
||||
return false, "Couldn't start SMB session: " .. smbstate
|
||||
end
|
||||
|
||||
status, result = smb.negotiate_protocol(smbstate, overrides)
|
||||
if(not(status)) then
|
||||
if(string.find(result, "SMBv2")) then
|
||||
return true, "Server supports SMBv2 protocol", true
|
||||
end
|
||||
return false, "Couldn't negotiate protocol: " .. result
|
||||
end
|
||||
status, result = smb.negotiate_protocol(smbstate, overrides)
|
||||
if(not(status)) then
|
||||
if(string.find(result, "SMBv2")) then
|
||||
return true, "Server supports SMBv2 protocol", true
|
||||
end
|
||||
return false, "Couldn't negotiate protocol: " .. result
|
||||
end
|
||||
|
||||
return true, "Server doesn't support SMBv2 protocol", false
|
||||
return true, "Server doesn't support SMBv2 protocol", false
|
||||
end
|
||||
|
||||
action = function(host)
|
||||
local status, result, flag = go(host)
|
||||
local status, result, flag = go(host)
|
||||
|
||||
if(not(status)) then
|
||||
if(nmap.debugging() > 0) then
|
||||
return "ERROR: " .. result
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
if(not(status)) then
|
||||
if(nmap.debugging() > 0) then
|
||||
return "ERROR: " .. result
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
return flag, result
|
||||
return flag, result
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user