Skip to content

Commit a468397

Browse files
author
Tod Beardsley
committed
Make OWA 2013 the default, other fixes
Thanks @jhart-r7! See rapid7#4083 and see rapid7#4094
2 parents 5fb268b + ff8d481 commit a468397

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

modules/auxiliary/scanner/http/owa_login.rb

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ def initialize
1818
super(
1919
'Name' => 'Outlook Web App (OWA) Brute Force Utility',
2020
'Description' => %q{
21-
This module tests credentials on OWA 2003, 2007, 2010, 2013 servers. The default
22-
action is set to OWA 2010.
21+
This module tests credentials on OWA 2003, 2007, 2010, and 2013 servers.
2322
},
2423
'Author' =>
2524
[
@@ -70,7 +69,7 @@ def initialize
7069
}
7170
]
7271
],
73-
'DefaultAction' => 'OWA_2010',
72+
'DefaultAction' => 'OWA_2013',
7473
'DefaultOptions' => {
7574
'SSL' => true
7675
}
@@ -93,20 +92,21 @@ def initialize
9392
deregister_options('BLANK_PASSWORDS', 'RHOSTS','PASSWORD','USERNAME')
9493
end
9594

96-
def run
97-
98-
vhost = datastore['VHOST'] || datastore['RHOST']
99-
100-
print_status("#{msg} Testing version #{action.name}")
101-
95+
def setup
10296
# Here's a weird hack to check if each_user_pass is empty or not
10397
# apparently you cannot do each_user_pass.empty? or even inspect() it
10498
isempty = true
10599
each_user_pass do |user|
106100
isempty = false
107101
break
108102
end
109-
print_error("No username/password specified") if isempty
103+
raise ArgumentError, "No username/password specified" if isempty
104+
end
105+
106+
def run
107+
vhost = datastore['VHOST'] || datastore['RHOST']
108+
109+
print_status("#{msg} Testing version #{action.name}")
110110

111111
auth_path = action.opts['AuthPath']
112112
inbox_path = action.opts['InboxPath']
@@ -247,6 +247,11 @@ def try_user_pass(opts)
247247
return :abort
248248
end
249249

250+
if res.redirect?
251+
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (response was a #{res.code} redirect)")
252+
return :skip_pass
253+
end
254+
250255
if res.body =~ login_check
251256
print_good("#{msg} SUCCESSFUL LOGIN. '#{user}' : '#{pass}'")
252257

@@ -261,12 +266,6 @@ def try_user_pass(opts)
261266

262267
report_auth_info(report_hash)
263268
return :next_user
264-
265-
if res.redirect?
266-
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (response was a #{res.code} redirect)")
267-
return :skip_pass
268-
end
269-
270269
else
271270
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (response body did not match)")
272271
return :skip_pass

0 commit comments

Comments
 (0)