Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-FindUserTrustGroups fails and lists ALL users #29

Closed
Meatballs1 opened this issue Jun 4, 2015 · 1 comment
Closed

Invoke-FindUserTrustGroups fails and lists ALL users #29

Meatballs1 opened this issue Jun 4, 2015 · 1 comment

Comments

@Meatballs1
Copy link
Contributor

The following logic in this method appears to be incorrect:

    if($GroupDN -ne $DistinguishedDomainName){
                    $GroupDomain = $($membership.substring($index)) -replace 'DC=','' -replace ',','.'
                    $GroupName = $membership.split(",")[0].split("=")[1]
                }

A number of issues are here:

  • $GroupDN is not set. The GroupDN output further down is set via $membership. $GroupDN is always $null. Therefore this comparison is always true and all users are listed.
  • If comparing against the $DistinguishedDomain the $GroupDN needs to be stripped down to the domain.

I fixed it with the following route:

  • $GroupDomain needs to be moved above the if statement
  • if $GroupDomain.CompareTo($Domain)

Sorry cant submit a PR at the moment.

@HarmJ0y
Copy link
Contributor

HarmJ0y commented Jun 5, 2015

Thanks! Just noticed this on an engagement actually. The fix should be pushed to https://github.com/Veil-Framework/PowerTools/tree/powerview_group_recurse , will test tomorrow and then merge into master. FYI Get-NetGroup now has a -Recurse flag that resolves any returned members that are groups as well.

@HarmJ0y HarmJ0y closed this as completed Jun 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants