Skip to content

Commit 88062a5

Browse files
committed
Clean up PR
1 parent fcc21ff commit 88062a5

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

lib/metasploit/framework/login_scanner/snmp.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ class SNMP
1717
PRIVATE_TYPES = [ :password ]
1818
REALM_KEY = nil
1919

20-
# The number of retries
20+
# The number of retries per community string
2121
# @return [Fixnum]
2222
attr_accessor :retries
2323

24-
# The SNMAP version to scan
25-
#
24+
# The SNMP version to scan
2625
# @return [String]
2726
attr_accessor :version
2827

@@ -35,15 +34,20 @@ class SNMP
3534

3635
validates :version,
3736
presence: true,
38-
inclusion: { in: ['1', '2c', 'all'] }
37+
inclusion: {
38+
in: ['1', '2c', 'all']
39+
}
3940

40-
# This method returns an array of versions to scan
41+
# This method returns an array of versions to scan for
4142
# @return [Array] An array of versions
4243
def versions
4344
case version
44-
when '1'; [:SNMPv1]
45-
when '2c'; [:SNMPv2c]
46-
when 'all'; [:SNMPv1,:SNMPv2c]
45+
when '1'
46+
[:SNMPv1]
47+
when '2c'
48+
[:SNMPv2c]
49+
when 'all'
50+
[:SNMPv1, :SNMPv2c]
4751
end
4852
end
4953

modules/auxiliary/scanner/snmp/snmp_login.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def initialize
3333
OptInt.new('CONNECTION_TIMEOUT', [true, 'The timeout value for each probe', 2]),
3434
OptInt.new('RETRIES', [true, 'The number of retries per community string', 0]),
3535
OptInt.new('BATCHSIZE', [true, 'The number of hosts to probe in each set', 256]),
36-
OptEnum.new('VERSION', [true, 'The SNMP version to scan', 'all', ['1','2c','all']]),
36+
OptEnum.new('VERSION', [true, 'The SNMP version to scan', 'all', ['1', '2c', 'all']]),
3737
OptString.new('PASSWORD', [ false, 'The password to test' ]),
3838
OptPath.new('PASS_FILE', [ false, "File containing communities, one per line",
3939
File.join(Msf::Config.data_directory, "wordlists", "snmp_default_pass.txt")

0 commit comments

Comments
 (0)