From 5b8b718a3db2bb0dee07b9bae3e357865a08e2bc Mon Sep 17 00:00:00 2001 From: Matthew Dunn Date: Fri, 5 Nov 2021 11:49:02 -0400 Subject: [PATCH] Use fail_with instead of return --- modules/auxiliary/scanner/http/azure_ad_login.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/auxiliary/scanner/http/azure_ad_login.rb b/modules/auxiliary/scanner/http/azure_ad_login.rb index 3d70a149ff..c35e120b6e 100644 --- a/modules/auxiliary/scanner/http/azure_ad_login.rb +++ b/modules/auxiliary/scanner/http/azure_ad_login.rb @@ -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'],