mirror of
https://github.com/nmap/nmap.git
synced 2025-12-31 20:09:02 +00:00
Remove trailing whitespace in lua files
Whitespace is not significant, so this should not be a problem. https://secwiki.org/w/Nmap/Code_Standards
This commit is contained in:
@@ -14,7 +14,7 @@ Attempts to discover DB2 servers on the network by sending a broadcast request t
|
||||
--
|
||||
-- @output
|
||||
-- Pre-scan script results:
|
||||
-- | broadcast-db2-discover:
|
||||
-- | broadcast-db2-discover:
|
||||
-- | 10.0.200.132 (UBU804-DB2E) - IBM DB2 v9.07.0
|
||||
-- |_ 10.0.200.119 (EDUSRV011) - IBM DB2 v9.07.0
|
||||
|
||||
@@ -38,7 +38,7 @@ local function parseVersion( server_version )
|
||||
if pfx == "SQL" then
|
||||
local major_version = string.sub(server_version,4,5)
|
||||
|
||||
-- strip the leading 0 from the major version, for consistency with
|
||||
-- strip the leading 0 from the major version, for consistency with
|
||||
-- nmap-service-probes results
|
||||
if string.sub(major_version,1,1) == "0" then
|
||||
major_version = string.sub(major_version,2)
|
||||
@@ -49,7 +49,7 @@ local function parseVersion( server_version )
|
||||
else
|
||||
return "Unknown version"
|
||||
end
|
||||
|
||||
|
||||
return ("IBM DB2 v%s"):format(server_version)
|
||||
end
|
||||
|
||||
@@ -68,19 +68,19 @@ action = function()
|
||||
local data
|
||||
status, data = socket:receive()
|
||||
if( not(status) ) then break end
|
||||
|
||||
|
||||
local version, srvname = data:match("DB2RETADDR.(SQL%d+).(.-)\0")
|
||||
local _, ip
|
||||
status, _, _, ip, _ = socket:get_info()
|
||||
if ( not(status) ) then return end
|
||||
|
||||
|
||||
if target.ALLOW_NEW_TARGETS then target.add(ip) end
|
||||
|
||||
if ( status ) then
|
||||
table.insert( result, ("%s - Host: %s; Version: %s"):format(ip, srvname, parseVersion( version ) ) )
|
||||
end
|
||||
end
|
||||
socket:close()
|
||||
socket:close()
|
||||
|
||||
return stdnse.format_output( true, result )
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user