Skip to content

Commit 0939bbc

Browse files
committed
Set default retries/version for SNMP LoginScanner
Set in snmp_login but missed in the LoginScanner. MSP-12668
1 parent 59ffe5d commit 0939bbc

File tree

1 file changed

+4
-0
lines changed
  • lib/metasploit/framework/login_scanner

1 file changed

+4
-0
lines changed

lib/metasploit/framework/login_scanner/snmp.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class SNMP
1212
include Metasploit::Framework::LoginScanner::Base
1313

1414
DEFAULT_PORT = 161
15+
DEFAULT_RETRIES = 0
16+
DEFAULT_VERSION = 'all'
1517
LIKELY_PORTS = [ 161, 162 ]
1618
LIKELY_SERVICE_NAMES = [ 'snmp' ]
1719
PRIVATE_TYPES = [ :password ]
@@ -117,6 +119,8 @@ def has_write_access?(snmp_client, value)
117119
def set_sane_defaults
118120
self.connection_timeout = 2 if self.connection_timeout.nil?
119121
self.port = DEFAULT_PORT if self.port.nil?
122+
self.retries = DEFAULT_RETRIES if self.retries.nil?
123+
self.version = DEFAULT_VERSION if self.version.nil?
120124
end
121125

122126
# This method takes an snmp client and tests whether

0 commit comments

Comments
 (0)