diff --git a/autodiscover/autodiscover.go b/autodiscover/autodiscover.go index dd6dd3c..5fb8093 100644 --- a/autodiscover/autodiscover.go +++ b/autodiscover/autodiscover.go @@ -239,7 +239,6 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er if m, _ := regexp.Match("http[s]?://", []byte(domain)); m == true { autodiscoverURL = domain - autodiscoverStep = 2 } else { //create the autodiscover url if autodiscoverStep == 0 { @@ -353,6 +352,9 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er if SessionConfig.Verbose == true { utils.Error.Printf("Failed, StatusCode [%d]\n", resp.StatusCode) } + if m, _ := regexp.Match("http[s]?://", []byte(domain)); m == true { + return nil, "", fmt.Errorf("Failed to authenticate: StatusCode [%d]\n", resp.StatusCode) + } if autodiscoverStep < 2 { autodiscoverStep++ return autodiscover(domain, mapi)