Skip to content

Commit 5bd393e

Browse files
committed
Merge branch 'orchestrator'
2 parents b54c55c + cc3d310 commit 5bd393e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+696
-778
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ As for the user enumeration, two modes are available: oauth2 and autodiscover (n
5252

5353
### OWA
5454
This module allows to enumerate users and bruteforce / spray passwords.
55+
Currently NTLM and basic authentication is supported
5556

5657
#### User enumeration
5758
Enumeration is made with authentication requests. Authentication for a non-existent user will take longer than for a valid user. At first, the average response time for an invalid user will be calculated and then the response time for each authentication request will be compared.

src/adfs/brute.go

-80
This file was deleted.

src/azure/userEnum.go

-152
This file was deleted.

src/cmd/brute/adfs.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package brute
22

33
import (
4-
"GoMapEnum/src/adfs"
54
"GoMapEnum/src/logger"
5+
"GoMapEnum/src/modules/adfs"
6+
"GoMapEnum/src/orchestrator"
67
"errors"
78

89
"github.com/spf13/cobra"
@@ -34,7 +35,11 @@ go run main.go bruteSpray adfs -t adfs.contoso.com -u [email protected] -p A
3435
adfsOptions.NoBruteforce = noBruteforce
3536
adfsOptions.Sleep = sleep
3637
adfsOptions.Proxy = proxy
37-
validUsers = adfsOptions.Brute()
38+
39+
orchestratorOptions := orchestrator.Orchestrator{}
40+
orchestratorOptions.PreActionBruteforce = adfs.CheckTarget
41+
orchestratorOptions.AuthenticationFunc = adfs.Authenticate
42+
validUsers = orchestratorOptions.Bruteforce(&o365Options)
3843
},
3944
}
4045

src/cmd/brute/o365.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package brute
22

33
import (
44
"GoMapEnum/src/logger"
5-
"GoMapEnum/src/o365"
5+
"GoMapEnum/src/modules/o365"
6+
"GoMapEnum/src/orchestrator"
67
"errors"
78
"strings"
89

@@ -35,7 +36,15 @@ By default, if one account is being lock, the all attack will be stopped.
3536
o365Options.Proxy = proxy
3637
o365Options.NoBruteforce = noBruteforce
3738
o365Options.Sleep = sleep
38-
validUsers = o365Options.Brute()
39+
40+
orchestratorOptions := orchestrator.Orchestrator{}
41+
orchestratorOptions.CustomOptionsForCheckIfValid = o365.PrepareOptions
42+
orchestratorOptions.AuthenticationFunc = o365.Authenticate
43+
orchestratorOptions.UserEnumFunc = o365.UserEnum
44+
// To check if the user is valid
45+
orchestratorOptions.CheckBeforeEnumFunc = o365.CheckTenant
46+
orchestratorOptions.AuthenticationFunc = o365.Authenticate
47+
validUsers = orchestratorOptions.Bruteforce(&o365Options)
3948
},
4049
}
4150

src/cmd/brute/owa.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package brute
22

33
import (
44
"GoMapEnum/src/logger"
5-
"GoMapEnum/src/owa"
5+
"GoMapEnum/src/modules/owa"
6+
"GoMapEnum/src/orchestrator"
67

78
"github.com/spf13/cobra"
89
)
@@ -26,17 +27,23 @@ go run main.go bruteSpray owa -u [email protected] -p Automn2021! -t mail.con
2627
owaOptions.Proxy = proxy
2728
owaOptions.NoBruteforce = noBruteforce
2829
owaOptions.Sleep = sleep
29-
validUsers = owaOptions.Brute()
30+
31+
orchestratorOptions := orchestrator.Orchestrator{}
32+
orchestratorOptions.PreActionBruteforce = owa.PrepareBruteforce
33+
orchestratorOptions.CustomOptionsForCheckIfValid = owa.PrepareOptions
34+
validUsers = orchestratorOptions.Bruteforce(&owaOptions)
3035

3136
},
3237
}
3338

3439
func init() {
3540

41+
owaCmd.Flags().BoolVarP(&o365Options.CheckIfValid, "check", "c", true, "Check if the user is valid before trying password")
3642
owaCmd.Flags().StringVarP(&owaOptions.Users, "user", "u", "", "User or file containing the emails")
3743
owaCmd.Flags().StringVarP(&owaOptions.Passwords, "password", "p", "", "Password or file containing the passwords")
3844
owaCmd.Flags().StringVarP(&owaOptions.Target, "target", "t", "", "Host pointing to the OWA service")
39-
owaCmd.Flags().IntVar(&owaOptions.Thread, "thread", 2, "Number of threads ")
45+
owaCmd.Flags().IntVar(&owaOptions.Thread, "thread", 2, "Number of threads")
46+
owaCmd.Flags().BoolVar(&owaOptions.Basic, "basic", false, "Basic authentication instead of NTLM")
4047
owaCmd.MarkFlagRequired("user")
4148
owaCmd.MarkFlagRequired("password")
4249
owaCmd.MarkFlagRequired("target")

src/cmd/enum/azure.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package enum
22

33
import (
4-
"GoMapEnum/src/azure"
54
"GoMapEnum/src/logger"
5+
"GoMapEnum/src/modules/azure"
6+
"GoMapEnum/src/orchestrator"
67

78
"github.com/spf13/cobra"
89
)
@@ -23,7 +24,10 @@ var azureCmd = &cobra.Command{
2324
log.Info("Starting the module Azure")
2425
azureOptions.Log = log
2526
azureOptions.Proxy = proxy
26-
validUsers = azureOptions.UserEnum()
27+
28+
orchestratorOptions := orchestrator.Orchestrator{}
29+
orchestratorOptions.UserEnumFunc = azure.UserEnum
30+
validUsers = orchestratorOptions.UserEnum(&azureOptions)
2731
},
2832
}
2933

src/cmd/enum/o365.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package enum
22

33
import (
44
"GoMapEnum/src/logger"
5-
"GoMapEnum/src/o365"
5+
"GoMapEnum/src/modules/o365"
6+
"GoMapEnum/src/orchestrator"
67
"errors"
78
"strings"
89

@@ -31,7 +32,10 @@ var o365Cmd = &cobra.Command{
3132
log.Info("Starting the module O365")
3233
o365Options.Log = log
3334
o365Options.Proxy = proxy
34-
validUsers = o365Options.UserEnum()
35+
orchestratorOptions := orchestrator.Orchestrator{}
36+
orchestratorOptions.CheckBeforeEnumFunc = o365.CheckTenant
37+
orchestratorOptions.UserEnumFunc = o365.UserEnum
38+
validUsers = orchestratorOptions.UserEnum(&o365Options)
3539
},
3640
}
3741

src/cmd/enum/owa.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package enum
22

33
import (
44
"GoMapEnum/src/logger"
5-
"GoMapEnum/src/owa"
5+
"GoMapEnum/src/modules/owa"
6+
"GoMapEnum/src/orchestrator"
67

78
"github.com/spf13/cobra"
89
)
@@ -24,7 +25,11 @@ Credits: https://github.com/busterb/msmailprobe`,
2425
log.Info("Starting the module OWA")
2526
owaOptions.Log = log
2627
owaOptions.Proxy = proxy
27-
validUsers = owaOptions.UserEnum()
28+
29+
orchestratorOptions := orchestrator.Orchestrator{}
30+
orchestratorOptions.PreActionUserEnum = owa.InitAndAverageResponseTime
31+
orchestratorOptions.UserEnumFunc = owa.UserEnum
32+
validUsers = orchestratorOptions.UserEnum(&owaOptions)
2833

2934
},
3035
}

0 commit comments

Comments
 (0)