parent
818bd1946d
commit
8833429987
|
@ -6,7 +6,7 @@ describe Metasploit::Framework::LoginScanner::AFP do
|
|||
|
||||
subject(:scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', false, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: false, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
|
||||
it { should respond_to :login_timeout }
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'metasploit/framework/login_scanner/axis2'
|
|||
|
||||
describe Metasploit::Framework::LoginScanner::Axis2 do
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', true, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::HTTP'
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ describe Metasploit::Framework::LoginScanner::DB2 do
|
|||
}
|
||||
subject(:login_scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', true, true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
|
||||
context '#attempt_login' do
|
||||
|
|
|
@ -45,7 +45,7 @@ describe Metasploit::Framework::LoginScanner::FTP do
|
|||
described_class.new
|
||||
}
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', false, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: false, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'metasploit/framework/login_scanner/http'
|
|||
|
||||
describe Metasploit::Framework::LoginScanner::HTTP do
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', true, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::HTTP'
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ describe Metasploit::Framework::LoginScanner::MSSQL do
|
|||
|
||||
subject(:login_scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', true, true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::NTLM'
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ describe Metasploit::Framework::LoginScanner::MySQL do
|
|||
|
||||
subject(:login_scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', false, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: false, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
|
||||
context '#attempt_login' do
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'metasploit/framework/login_scanner/pop3'
|
|||
describe Metasploit::Framework::LoginScanner::POP3 do
|
||||
subject(:scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', false, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: false, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
|
||||
context "#attempt_login" do
|
||||
|
|
|
@ -25,7 +25,7 @@ describe Metasploit::Framework::LoginScanner::Postgres do
|
|||
|
||||
subject(:login_scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', true, true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: true
|
||||
|
||||
context '#attempt_login' do
|
||||
context 'when the login is successful' do
|
||||
|
|
|
@ -32,7 +32,7 @@ describe Metasploit::Framework::LoginScanner::SMB do
|
|||
|
||||
subject(:login_scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', true, true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::NTLM'
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ describe Metasploit::Framework::LoginScanner::SNMP do
|
|||
described_class.new
|
||||
}
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', false, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: false, has_default_realm: false
|
||||
|
||||
|
||||
context '#attempt_login' do
|
||||
|
|
|
@ -55,7 +55,7 @@ describe Metasploit::Framework::LoginScanner::SSH do
|
|||
described_class.new
|
||||
}
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', false, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: false, has_default_realm: false
|
||||
|
||||
|
||||
it { should respond_to :verbosity }
|
||||
|
|
|
@ -5,7 +5,7 @@ describe Metasploit::Framework::LoginScanner::Telnet do
|
|||
|
||||
subject(:login_scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', false, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: false, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
|
||||
it { should respond_to :banner_timeout }
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'metasploit/framework/login_scanner/tomcat'
|
|||
|
||||
describe Metasploit::Framework::LoginScanner::Tomcat do
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', true, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::HTTP'
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ describe Metasploit::Framework::LoginScanner::VNC do
|
|||
}
|
||||
subject(:login_scanner) { described_class.new }
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', false, false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: false, has_default_realm: false
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'metasploit/framework/login_scanner/winrm'
|
|||
|
||||
describe Metasploit::Framework::LoginScanner::WinRM do
|
||||
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', true, true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: true
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
|
||||
it_behaves_like 'Metasploit::Framework::LoginScanner::HTTP'
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
shared_examples_for 'Metasploit::Framework::LoginScanner::Base' do | has_realm_key, has_default_realm |
|
||||
shared_examples_for 'Metasploit::Framework::LoginScanner::Base' do | opts |
|
||||
|
||||
subject(:login_scanner) { described_class.new }
|
||||
|
||||
|
@ -295,7 +295,7 @@ shared_examples_for 'Metasploit::Framework::LoginScanner::Base' do | has_realm_k
|
|||
|
||||
context '#each_credential' do
|
||||
|
||||
if has_realm_key
|
||||
if opts[:has_realm_key]
|
||||
context 'when the login_scanner has a REALM_KEY' do
|
||||
context 'when the credential has a realm' do
|
||||
before(:each) do
|
||||
|
@ -308,7 +308,7 @@ shared_examples_for 'Metasploit::Framework::LoginScanner::Base' do | has_realm_k
|
|||
end
|
||||
end
|
||||
|
||||
if has_default_realm
|
||||
if opts[:has_default_realm]
|
||||
context 'when the credential has no realm' do
|
||||
before(:each) do
|
||||
login_scanner.cred_details = [pub_pri]
|
||||
|
@ -323,9 +323,7 @@ shared_examples_for 'Metasploit::Framework::LoginScanner::Base' do | has_realm_k
|
|||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
unless has_realm_key
|
||||
else
|
||||
context 'when login_scanner has no REALM_KEY' do
|
||||
context 'when the credential has a realm' do
|
||||
before(:each) do
|
||||
|
@ -353,6 +351,7 @@ shared_examples_for 'Metasploit::Framework::LoginScanner::Base' do | has_realm_k
|
|||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue