Add negotiate_auth step to login_scanner test

MS-2855/keylogger-mettle-extension
jgor 2017-12-18 12:27:11 -06:00
parent 563cb6f18f
commit 09772cb08a
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,8 @@ RSpec.describe Metasploit::Framework::LoginScanner::VNC do
it 'returns a failed result when authentication fails' do
expect_any_instance_of(Rex::Proto::RFB::Client).to receive(:handshake).and_return true
expect_any_instance_of(Rex::Proto::RFB::Client).to receive(:authenticate_with_type).with(nil,nil,private).and_return false
expect_any_instance_of(Rex::Proto::RFB::Client).to receive(:negotiate_authentication).and_return Rex::Proto::RFB::AuthType::VNC
expect_any_instance_of(Rex::Proto::RFB::Client).to receive(:authenticate_with_type).with(Rex::Proto::RFB::AuthType::VNC,nil,private).and_return false
result = login_scanner.attempt_login(test_cred)
expect(result.status).to eq Metasploit::Model::Login::Status::INCORRECT
end