| |
---|
| | var mainUser string = "" |
---|
| | filter := fmt.Sprintf("(CN=%s)", ldap.EscapeFilter(*username)) |
---|
| | searchReq := ldap.NewSearchRequest(DCQueryName, ldap.ScopeWholeSubtree, 0, 0, 0, false, filter, []string{"sAMAccountName","distinguishedName", "primaryGroupID"}, []ldap.Control{}) |
---|
| | result, err := l.Search(searchReq) |
---|
| | if err != nil { |
---|
| | if err != nil || len(result.Entries) == 0{ |
---|
| | fmt.Print("[+] query full domain to get account username... ") |
---|
| | DCQueryName = *domain |
---|
| | |
---|
| | filter = fmt.Sprintf("(CN=%s)", ldap.EscapeFilter(*username)) |
---|
| |
---|
| | |
|