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

NSE snmp manually rebase #122 provided patch

This commit is contained in:
gio
2015-06-13 17:58:49 +00:00
parent bf22689ef7
commit 308c213099
12 changed files with 214 additions and 226 deletions

View File

@@ -74,18 +74,14 @@ end
action = function(host, port)
local socket = nmap.new_socket()
local catch = function() socket:close() end
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))
local snmpHelper = snmp.Helper:new(host, port)
snmpHelper:connect()
status, services = snmp.snmpWalk( socket, snmpoid )
socket:close()
status, services = snmpHelper:walk( snmpoid )
if ( not(status) ) or ( services == nil ) or ( #services == 0 ) then
return