Skip to content

Commit 7855ede

Browse files
committed
Move userpass emptiness checking into setup
1 parent 5fb268b commit 7855ede

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

modules/auxiliary/scanner/http/owa_login.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,21 @@ def initialize
9393
deregister_options('BLANK_PASSWORDS', 'RHOSTS','PASSWORD','USERNAME')
9494
end
9595

96-
def run
97-
98-
vhost = datastore['VHOST'] || datastore['RHOST']
99-
100-
print_status("#{msg} Testing version #{action.name}")
101-
96+
def setup
10297
# Here's a weird hack to check if each_user_pass is empty or not
10398
# apparently you cannot do each_user_pass.empty? or even inspect() it
10499
isempty = true
105100
each_user_pass do |user|
106101
isempty = false
107102
break
108103
end
109-
print_error("No username/password specified") if isempty
104+
raise ArgumentError, "No username/password specified" if isempty
105+
end
106+
107+
def run
108+
vhost = datastore['VHOST'] || datastore['RHOST']
109+
110+
print_status("#{msg} Testing version #{action.name}")
110111

111112
auth_path = action.opts['AuthPath']
112113
inbox_path = action.opts['InboxPath']

0 commit comments

Comments
 (0)