Clean up PR
This commit is contained in:
parent
fcc21ff928
commit
88062a578d
|
@ -17,12 +17,11 @@ module Metasploit
|
||||||
PRIVATE_TYPES = [ :password ]
|
PRIVATE_TYPES = [ :password ]
|
||||||
REALM_KEY = nil
|
REALM_KEY = nil
|
||||||
|
|
||||||
# The number of retries
|
# The number of retries per community string
|
||||||
# @return [Fixnum]
|
# @return [Fixnum]
|
||||||
attr_accessor :retries
|
attr_accessor :retries
|
||||||
|
|
||||||
# The SNMAP version to scan
|
# The SNMP version to scan
|
||||||
#
|
|
||||||
# @return [String]
|
# @return [String]
|
||||||
attr_accessor :version
|
attr_accessor :version
|
||||||
|
|
||||||
|
@ -35,15 +34,20 @@ module Metasploit
|
||||||
|
|
||||||
validates :version,
|
validates :version,
|
||||||
presence: true,
|
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
|
# @return [Array] An array of versions
|
||||||
def versions
|
def versions
|
||||||
case version
|
case version
|
||||||
when '1'; [:SNMPv1]
|
when '1'
|
||||||
when '2c'; [:SNMPv2c]
|
[:SNMPv1]
|
||||||
when 'all'; [:SNMPv1,:SNMPv2c]
|
when '2c'
|
||||||
|
[:SNMPv2c]
|
||||||
|
when 'all'
|
||||||
|
[:SNMPv1, :SNMPv2c]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
OptInt.new('CONNECTION_TIMEOUT', [true, 'The timeout value for each probe', 2]),
|
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('RETRIES', [true, 'The number of retries per community string', 0]),
|
||||||
OptInt.new('BATCHSIZE', [true, 'The number of hosts to probe in each set', 256]),
|
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' ]),
|
OptString.new('PASSWORD', [ false, 'The password to test' ]),
|
||||||
OptPath.new('PASS_FILE', [ false, "File containing communities, one per line",
|
OptPath.new('PASS_FILE', [ false, "File containing communities, one per line",
|
||||||
File.join(Msf::Config.data_directory, "wordlists", "snmp_default_pass.txt")
|
File.join(Msf::Config.data_directory, "wordlists", "snmp_default_pass.txt")
|
||||||
|
|
Loading…
Reference in New Issue