-
Notifications
You must be signed in to change notification settings - Fork 9
/
o365sprayer.go
59 lines (55 loc) · 1.63 KB
/
o365sprayer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"flag"
"fmt"
"os"
"github.com/securebinary/o365sprayer/o365sprayer/core"
)
func main() {
domain := flag.String("d", "", "Target domain")
validateEmail := flag.Bool("enum", false, "Validate O365 emails")
sprayCheck := flag.Bool("spray", false, "Spray passwords on O365 emails")
email := flag.String("u", "", "Email to validate")
emailFile := flag.String("U", "", "Path to email list")
password := flag.String("p", "", "Password to spray")
passwordFile := flag.String("P", "", "Path to password list")
delay := flag.Float64("delay", 0.25, "Delay between requests")
lockout := flag.Int("lockout", 5, "Number of incorrect attempts for account lockout")
lockoutDelay := flag.Int("lockoutDelay", 15, "Lockout cool down time")
maxLockouts := flag.Int("max-lockout", 10, "Maximum number of lockout accounts")
flag.Usage = func() {
flagSet := flag.CommandLine
order := []string{"d", "u", "p", "U", "P", "enum", "spray", "delay", "lockout", "lockoutDelay", "max-lockout"}
for _, name := range order {
flag := flagSet.Lookup(name)
fmt.Printf(" -%s ", flag.Name)
if len(flag.DefValue) > 0 {
fmt.Printf("[DEFAULT : %s]", flag.DefValue)
}
fmt.Printf("\n %s\n", flag.Usage)
}
}
flag.Parse()
fmt.Print(core.BANNER)
if *domain == "" {
// flag.PrintDefaults()
flag.Usage()
os.Exit(-1)
}
// Need to add domain validation
if len(*domain) > 0 {
core.StartO365Sprayer(
*domain,
*validateEmail,
*sprayCheck,
*email,
*emailFile,
*password,
*passwordFile,
*delay,
*lockout,
*lockoutDelay,
*maxLockouts,
)
}
}