Land #5369, @dmaloney-r7's snmp_login fixes
commit
c1b8cee315
|
@ -75,8 +75,10 @@ module Metasploit
|
||||||
def to_s
|
def to_s
|
||||||
if realm && realm_key == Metasploit::Model::Realm::Key::ACTIVE_DIRECTORY_DOMAIN
|
if realm && realm_key == Metasploit::Model::Realm::Key::ACTIVE_DIRECTORY_DOMAIN
|
||||||
"#{self.realm}\\#{self.public}:#{self.private}"
|
"#{self.realm}\\#{self.public}:#{self.private}"
|
||||||
else
|
elsif self.private
|
||||||
"#{self.public}:#{self.private}#{at_realm}"
|
"#{self.public}:#{self.private}#{at_realm}"
|
||||||
|
else
|
||||||
|
self.public
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -566,7 +566,6 @@ module Auxiliary::AuthBrute
|
||||||
else
|
else
|
||||||
level = opts[:level].to_s.strip
|
level = opts[:level].to_s.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
host_ip = opts[:ip] || opts[:rhost] || opts[:host] || (rhost rescue nil) || datastore['RHOST']
|
host_ip = opts[:ip] || opts[:rhost] || opts[:host] || (rhost rescue nil) || datastore['RHOST']
|
||||||
host_port = opts[:port] || opts[:rport] || (rport rescue nil) || datastore['RPORT']
|
host_port = opts[:port] || opts[:rport] || (rport rescue nil) || datastore['RPORT']
|
||||||
msg = opts[:msg] || opts[:message] || opts[:legacy_msg]
|
msg = opts[:msg] || opts[:message] || opts[:legacy_msg]
|
||||||
|
|
|
@ -12,10 +12,19 @@ module Auxiliary::Report
|
||||||
|
|
||||||
optionally_include_metasploit_credential_creation
|
optionally_include_metasploit_credential_creation
|
||||||
|
|
||||||
|
def db_warning_given?
|
||||||
|
if @warning_issued
|
||||||
|
true
|
||||||
|
else
|
||||||
|
@warning_issued = true
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def create_cracked_credential(opts={})
|
def create_cracked_credential(opts={})
|
||||||
if active_db?
|
if active_db?
|
||||||
super(opts)
|
super(opts)
|
||||||
else
|
elsif !db_warning_given?
|
||||||
vprint_warning('No active DB -- Credential data will not be saved!')
|
vprint_warning('No active DB -- Credential data will not be saved!')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -23,7 +32,7 @@ module Auxiliary::Report
|
||||||
def create_credential(opts={})
|
def create_credential(opts={})
|
||||||
if active_db?
|
if active_db?
|
||||||
super(opts)
|
super(opts)
|
||||||
else
|
elsif !db_warning_given?
|
||||||
vprint_warning('No active DB -- Credential data will not be saved!')
|
vprint_warning('No active DB -- Credential data will not be saved!')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -31,7 +40,7 @@ module Auxiliary::Report
|
||||||
def create_credential_login(opts={})
|
def create_credential_login(opts={})
|
||||||
if active_db?
|
if active_db?
|
||||||
super(opts)
|
super(opts)
|
||||||
else
|
elsif !db_warning_given?
|
||||||
vprint_warning('No active DB -- Credential data will not be saved!')
|
vprint_warning('No active DB -- Credential data will not be saved!')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -39,7 +48,7 @@ module Auxiliary::Report
|
||||||
def invalidate_login(opts={})
|
def invalidate_login(opts={})
|
||||||
if active_db?
|
if active_db?
|
||||||
super(opts)
|
super(opts)
|
||||||
else
|
elsif !db_warning_given?
|
||||||
vprint_warning('No active DB -- Credential data will not be saved!')
|
vprint_warning('No active DB -- Credential data will not be saved!')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,7 +85,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
print_good "#{ip}:#{rport} - LOGIN SUCCESSFUL: #{result.credential} (Access level: #{result.access_level})"
|
print_good "#{ip}:#{rport} - LOGIN SUCCESSFUL: #{result.credential} (Access level: #{result.access_level})"
|
||||||
else
|
else
|
||||||
invalidate_login(credential_data)
|
invalidate_login(credential_data)
|
||||||
vprint_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status}: #{result.proof})"
|
print_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status})"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue