mirror of
https://github.com/nmap/nmap.git
synced 2026-01-18 12:19: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:
@@ -10,7 +10,7 @@ Attempts to enumerate Windows services through SNMP.
|
||||
|
||||
---
|
||||
-- @output
|
||||
-- | snmp-win32-services:
|
||||
-- | snmp-win32-services:
|
||||
-- | Apache Tomcat
|
||||
-- | Application Experience Lookup Service
|
||||
-- | Application Layer Gateway Service
|
||||
@@ -50,32 +50,32 @@ function process_answer( tbl )
|
||||
for _, v in ipairs( tbl ) do
|
||||
table.insert( new_tab, v.value )
|
||||
end
|
||||
|
||||
|
||||
table.sort( new_tab )
|
||||
|
||||
|
||||
return new_tab
|
||||
|
||||
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
local socket = nmap.new_socket()
|
||||
local catch = function() socket:close() end
|
||||
local try = nmap.new_try(catch)
|
||||
local try = nmap.new_try(catch)
|
||||
local snmpoid = "1.3.6.1.4.1.77.1.2.3.1.1"
|
||||
local services = {}
|
||||
local status
|
||||
|
||||
socket:set_timeout(5000)
|
||||
try(socket:connect(host, port))
|
||||
|
||||
|
||||
status, services = snmp.snmpWalk( socket, snmpoid )
|
||||
socket:close()
|
||||
|
||||
if ( not(status) ) or ( services == nil ) or ( #services == 0 ) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
services = process_answer(services)
|
||||
nmap.set_port_state(host, port, "open")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user