Land #5157, OWA login scanner auth timing logs

bug/bundler_fix
Brent Cook 2015-04-21 11:06:08 -05:00
commit 5296c6507d
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
1 changed files with 15 additions and 7 deletions

View File

@ -27,7 +27,8 @@ class Metasploit3 < Msf::Auxiliary
'SecureState R&D Team',
'sinn3r',
'Brandon Knight',
'Pete (Bokojan) Arzamendi, #Outlook 2013 updates'
'Pete (Bokojan) Arzamendi', # Outlook 2013 updates
'Nate Power' # HTTP timing option
],
'License' => MSF_LICENSE,
'Actions' =>
@ -81,6 +82,7 @@ class Metasploit3 < Msf::Auxiliary
OptInt.new('RPORT', [ true, "The target port", 443]),
OptAddress.new('RHOST', [ true, "The target address", true]),
OptBool.new('ENUM_DOMAIN', [ true, "Automatically enumerate AD domain using NTLM authentication", true]),
OptBool.new('AUTH_TIME', [ false, "Check HTTP authentication response time", true])
], self.class)
@ -163,6 +165,10 @@ class Metasploit3 < Msf::Auxiliary
end
begin
if datastore['AUTH_TIME']
start_time = Time.now
end
res = send_request_cgi({
'encode' => true,
'uri' => auth_path,
@ -171,6 +177,9 @@ class Metasploit3 < Msf::Auxiliary
'data' => data
})
if datastore['AUTH_TIME']
elapsed_time = Time.now - start_time
end
rescue ::Rex::ConnectionError, Errno::ECONNREFUSED, Errno::ETIMEDOUT
print_error("#{msg} HTTP Connection Failed, Aborting")
return :abort
@ -189,7 +198,7 @@ class Metasploit3 < Msf::Auxiliary
# Check for a response code to make sure login was valid. Changes from 2010 to 2013.
# Check if the password needs to be changed.
if res.headers['location'] =~ /expiredpassword/
print_good("#{msg} SUCCESSFUL LOGIN. '#{user}' : '#{pass}': NOTE password change required")
print_good("#{msg} SUCCESSFUL LOGIN. #{elapsed_time} '#{user}' : '#{pass}': NOTE password change required")
report_hash = {
:host => datastore['RHOST'],
:port => datastore['RPORT'],
@ -213,7 +222,7 @@ class Metasploit3 < Msf::Auxiliary
headers['Cookie'] = 'PBack=0;' << res.get_cookies
else
# Login didn't work. no point on going on.
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (HTTP redirect with reason #{reason})")
vprint_error("#{msg} FAILED LOGIN. #{elapsed_time} '#{user}' : '#{pass}' (HTTP redirect with reason #{reason})")
return :Skip_pass
end
else
@ -248,12 +257,12 @@ class Metasploit3 < Msf::Auxiliary
end
if res.redirect?
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (response was a #{res.code} redirect)")
vprint_error("#{msg} FAILED LOGIN. #{elapsed_time} '#{user}' : '#{pass}' (response was a #{res.code} redirect)")
return :skip_pass
end
if res.body =~ login_check
print_good("#{msg} SUCCESSFUL LOGIN. '#{user}' : '#{pass}'")
print_good("#{msg} SUCCESSFUL LOGIN. #{elapsed_time} '#{user}' : '#{pass}'")
report_hash = {
:host => datastore['RHOST'],
@ -267,7 +276,7 @@ class Metasploit3 < Msf::Auxiliary
report_auth_info(report_hash)
return :next_user
else
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (response body did not match)")
vprint_error("#{msg} FAILED LOGIN. #{elapsed_time} '#{user}' : '#{pass}' (response body did not match)")
return :skip_pass
end
end
@ -318,4 +327,3 @@ class Metasploit3 < Msf::Auxiliary
end
end