@@ -18,8 +18,7 @@ def initialize
18
18
super (
19
19
'Name' => 'Outlook Web App (OWA) Brute Force Utility' ,
20
20
'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.
23
22
} ,
24
23
'Author' =>
25
24
[
@@ -70,7 +69,7 @@ def initialize
70
69
}
71
70
]
72
71
] ,
73
- 'DefaultAction' => 'OWA_2010 ' ,
72
+ 'DefaultAction' => 'OWA_2013 ' ,
74
73
'DefaultOptions' => {
75
74
'SSL' => true
76
75
}
@@ -93,20 +92,21 @@ def initialize
93
92
deregister_options ( 'BLANK_PASSWORDS' , 'RHOSTS' , 'PASSWORD' , 'USERNAME' )
94
93
end
95
94
96
- def run
97
-
98
- vhost = datastore [ 'VHOST' ] || datastore [ 'RHOST' ]
99
-
100
- print_status ( "#{ msg } Testing version #{ action . name } " )
101
-
95
+ def setup
102
96
# Here's a weird hack to check if each_user_pass is empty or not
103
97
# apparently you cannot do each_user_pass.empty? or even inspect() it
104
98
isempty = true
105
99
each_user_pass do |user |
106
100
isempty = false
107
101
break
108
102
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 } " )
110
110
111
111
auth_path = action . opts [ 'AuthPath' ]
112
112
inbox_path = action . opts [ 'InboxPath' ]
@@ -247,6 +247,11 @@ def try_user_pass(opts)
247
247
return :abort
248
248
end
249
249
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
+
250
255
if res . body =~ login_check
251
256
print_good ( "#{ msg } SUCCESSFUL LOGIN. '#{ user } ' : '#{ pass } '" )
252
257
@@ -261,12 +266,6 @@ def try_user_pass(opts)
261
266
262
267
report_auth_info ( report_hash )
263
268
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
-
270
269
else
271
270
vprint_error ( "#{ msg } FAILED LOGIN. '#{ user } ' : '#{ pass } ' (response body did not match)" )
272
271
return :skip_pass
0 commit comments