adding in changes from before my vacation..

MSP-9678
bug/bundler_fix
Lance Sanchez 2014-05-28 13:18:28 -05:00
parent e9b3f10ba7
commit 07a61ae696
No known key found for this signature in database
GPG Key ID: 3922EB70FB80E8DD
2 changed files with 10 additions and 3 deletions

View File

@ -15,7 +15,7 @@ module Metasploit
include Metasploit::Framework::Tcp::Client
# This method attempts a single login with a single credential against the target
# @param credential [Credential] The credential object to attmpt to login with
# @param credential [Credential] The credential object to attempt to login with
# @return [Metasploit::Framework::LoginScanner::Result] The LoginScanner Result object
def attempt_login(credential)
result_options = {
@ -26,15 +26,21 @@ module Metasploit
disconnect if self.sock
begin
connect
sleep(0.4)
# Check to see if we recieved an OK?
result_options[:proof] = sock.get_once
if result_options[:proof][/^\+OK (.*)/]
# If we received an OK we should send the USER
sock.put("USER #{credential.public}\r\n")
result_options[:proof] = sock.get_once
if result_options[:proof][/^\+OK (.*)/]
# If we got an OK after the username we can send the PASS
sock.put("PASS #{credential.private}\r\n")
result_options[:proof] = sock.get_once
if result_options[:proof][/^\+OK (.*)/]
# if the pass gives an OK, were good to go
result_options[:status] = :success
end
end
@ -46,7 +52,7 @@ module Metasploit
)
end
disconnect
disconnect if self.sock
::Metasploit::Framework::LoginScanner::Result.new(result_options)
end

View File

@ -7,7 +7,8 @@ describe Metasploit::Framework::LoginScanner::POP3 do
it_behaves_like 'Metasploit::Framework::LoginScanner::Base'
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
context "#set_sane_defaults" do
context "#attempt_login" do
end
end