Skip to content

Commit

Permalink
Merge pull request #2 from optionalCTF/outfile
Browse files Browse the repository at this point in the history
Minor Bugfix with outfiles and successful password spray output
  • Loading branch information
optionalCTF authored Mar 3, 2022
2 parents 8f7ae3b + d16fa0f commit 2d0396b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/az/az.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,21 @@ func Query(user string, domain string, password string, wg *sync.WaitGroup, outf
if strings.Contains(string(data), "DesktopSsoToken") {
fmt.Println(colour.Green("[+] Email Exists: " + user + " \n\r[+] Password Accepted: " + password))
userPass := user + ":" + password
service.WriteFile(outfile, userPass)
if outfile != "" {
service.WriteFile(outfile, userPass)
}
} else if strings.Contains(string(data), "AADSTS50034") {
fmt.Println(colour.Red("[-] " + user + " does not exist"))
} else if strings.Contains(string(data), "AADSTS50126") && password != "" {
fmt.Println(colour.Green("[+] " + user + " exists"))
service.WriteFile(outfile, user)
if outfile != "" {
service.WriteFile(outfile, user)
}
fmt.Println(colour.Red("[-] Password Incorrect"))
} else {
service.WriteFile(outfile, user)
if outfile != "" {
service.WriteFile(outfile, user)
}
fmt.Println(colour.Green("[+] " + user + " exists"))
}
}
2 changes: 2 additions & 0 deletions pkg/svc/UserEnum.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func WriteFile(path string, contents string) error {
f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
fmt.Printf("Error: %s", err)
fmt.Printf("ree1")
}
defer f.Close()
if _, err := f.WriteString(contents + "\n"); err != nil {
Expand All @@ -43,6 +44,7 @@ func WriteFile(path string, contents string) error {
file, err := os.Create(path)
if err != nil {
fmt.Printf("Error: %s", err)
fmt.Printf("ree")
}

defer file.Close()
Expand Down

0 comments on commit 2d0396b

Please sign in to comment.