Skip to content

Commit

Permalink
Clean up PR
Browse files Browse the repository at this point in the history
  • Loading branch information
wvu committed Apr 16, 2015
1 parent fcc21ff commit 88062a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions lib/metasploit/framework/login_scanner/snmp.rb
Expand Up @@ -17,12 +17,11 @@ class SNMP
PRIVATE_TYPES = [ :password ]
REALM_KEY = nil

# The number of retries
# The number of retries per community string
# @return [Fixnum]
attr_accessor :retries

# The SNMAP version to scan
#
# The SNMP version to scan
# @return [String]
attr_accessor :version

Expand All @@ -35,15 +34,20 @@ class SNMP

validates :version,
presence: true,
inclusion: { in: ['1', '2c', 'all'] }
inclusion: {
in: ['1', '2c', 'all']
}

# This method returns an array of versions to scan
# This method returns an array of versions to scan for
# @return [Array] An array of versions
def versions
case version
when '1'; [:SNMPv1]
when '2c'; [:SNMPv2c]
when 'all'; [:SNMPv1,:SNMPv2c]
when '1'
[:SNMPv1]
when '2c'
[:SNMPv2c]
when 'all'
[:SNMPv1, :SNMPv2c]
end
end

Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/scanner/snmp/snmp_login.rb
Expand Up @@ -33,7 +33,7 @@ def initialize
OptInt.new('CONNECTION_TIMEOUT', [true, 'The timeout value for each probe', 2]),
OptInt.new('RETRIES', [true, 'The number of retries per community string', 0]),
OptInt.new('BATCHSIZE', [true, 'The number of hosts to probe in each set', 256]),
OptEnum.new('VERSION', [true, 'The SNMP version to scan', 'all', ['1','2c','all']]),
OptEnum.new('VERSION', [true, 'The SNMP version to scan', 'all', ['1', '2c', 'all']]),
OptString.new('PASSWORD', [ false, 'The password to test' ]),
OptPath.new('PASS_FILE', [ false, "File containing communities, one per line",
File.join(Msf::Config.data_directory, "wordlists", "snmp_default_pass.txt")
Expand Down

0 comments on commit 88062a5

Please sign in to comment.