Use fail_with instead of return

This commit is contained in:
Matthew Dunn
2021-11-05 11:49:02 -04:00
parent becb54d5a5
commit 5b8b718a3d
@@ -28,7 +28,8 @@ class MetasploitModule < Msf::Auxiliary
'DefaultOptions' => {
'RPORT' => 443,
'SSL' => true,
'RHOST' => 'autologon.microsoftazuread-sso.com'
'RHOST' => 'autologon.microsoftazuread-sso.com',
'PASSWORD' => 'password'
}
)
@@ -171,16 +172,14 @@ class MetasploitModule < Msf::Auxiliary
elsif datastore['USERNAME']
usernames = [datastore['USERNAME']]
else
print_error('Either USERNAME or USER_FILE must be set. Aborting...')
return
fail_with(Failure::BadConfig, 'Either USERNAME or USER_FILE must be set')
end
if datastore['PASS_FILE']
passwords = File.readlines(datastore['PASS_FILE'])
elsif datastore['PASSWORD']
passwords = [datastore['PASSWORD']]
else
print_error('Either PASSWORD or PASS_FILE must be set. Aborting...')
return
fail_with(Failure::BadConfig, 'Either PASSWORD or PASS_FILE must be set')
end
check_logins(datastore['RHOST'], datastore['RPORT'], datastore['TARGETURI'],