File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
lib/metasploit/framework/login_scanner
spec/lib/metasploit/framework/login_scanner Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ module LoginScanner
11
11
class SNMP
12
12
include Metasploit ::Framework ::LoginScanner ::Base
13
13
14
+ DEFAULT_TIMEOUT = 2
14
15
DEFAULT_PORT = 161
16
+ DEFAULT_RETRIES = 0
17
+ DEFAULT_VERSION = 'all'
15
18
LIKELY_PORTS = [ 161 , 162 ]
16
19
LIKELY_SERVICE_NAMES = [ 'snmp' ]
17
20
PRIVATE_TYPES = [ :password ]
@@ -112,11 +115,13 @@ def has_write_access?(snmp_client, value)
112
115
113
116
end
114
117
115
- # Sets the connection timeout approrpiately for SNMP
118
+ # Sets the connection timeout appropriately for SNMP
116
119
# if the user did not set it.
117
120
def set_sane_defaults
118
- self . connection_timeout = 2 if self . connection_timeout . nil?
121
+ self . connection_timeout = DEFAULT_TIMEOUT if self . connection_timeout . nil?
119
122
self . port = DEFAULT_PORT if self . port . nil?
123
+ self . retries = DEFAULT_RETRIES if self . retries . nil?
124
+ self . version = DEFAULT_VERSION if self . version . nil?
120
125
end
121
126
122
127
# This method takes an snmp client and tests whether
Original file line number Diff line number Diff line change 37
37
snmp_scanner . host = '127.0.0.1'
38
38
snmp_scanner . port = 161
39
39
snmp_scanner . connection_timeout = 1
40
- snmp_scanner . retries = 0
41
- snmp_scanner . version = 'all'
42
40
snmp_scanner . stop_on_success = true
43
41
snmp_scanner . cred_details = detail_group
44
42
end
You can’t perform that action at this time.
0 commit comments