diff --git a/scripts/snmp-ios-config.nse b/scripts/snmp-ios-config.nse index 5708ab32b..bb242bdd0 100644 --- a/scripts/snmp-ios-config.nse +++ b/scripts/snmp-ios-config.nse @@ -179,6 +179,9 @@ action = function(host, port) local result result = snmp.fetchFirst(response) + if not result then + return + end if result == 3 then result = ( infile and infile:getContent() ) diff --git a/scripts/snmp-sysdescr.nse b/scripts/snmp-sysdescr.nse index 4616bc5d8..0122f16e7 100644 --- a/scripts/snmp-sysdescr.nse +++ b/scripts/snmp-sysdescr.nse @@ -93,6 +93,9 @@ action = function(host, port) try(socket:close()) local uptime = snmp.fetchFirst(response) + if not uptime then + return + end local days, hours, minutes, seconds, htime, mtime, stime days = math.floor(uptime / 8640000)