Skip to content
Permalink
Browse files

Land #12044, snmp_enum SNMP::NoSuchInstance fix

  • Loading branch information...
wvu-r7 committed Jul 2, 2019
2 parents 64b3852 + 260c369 commit ef20123c342932c132efe95a5a9f8a7e21fe25bb
Showing with 2 additions and 4 deletions.
  1. +2 −4 modules/auxiliary/scanner/snmp/snmp_enum.rb
@@ -172,10 +172,10 @@ def run_host(ip)

ifindex = index.value
ifdescr = descr.value
ifmac = mac.value.unpack("H2H2H2H2H2H2").join(":")
ifmac = mac.value.to_s =~ /noSuchInstance/ ? 'unknown' : mac.value.unpack("H2H2H2H2H2H2").join(":")
iftype = type.value
ifmtu = mtu.value
ifspeed = speed.value.to_i
ifspeed = speed.value.to_s =~ /noSuchInstance/ ? 'unknown' : speed.value.to_i / 1000000
ifinoc = inoc.value
ifoutoc = outoc.value
ifstatus = status.value
@@ -260,8 +260,6 @@ def run_host(ip)
ifstatus = "unknown"
end

ifspeed = ifspeed / 1000000

network_interfaces.push({
"Interface" => "[ #{ifstatus} ] #{ifdescr}",
"Id" => ifindex,

0 comments on commit ef20123

Please sign in to comment.
You can’t perform that action at this time.