PowerShellEmpire / PowerTools

PowerTools is a collection of PowerShell projects with a focus on offensive operations.
Other
2.05k stars 811 forks source link

Invoke-FindUserTrustGroups fails and lists ALL users #29

Closed Meatballs1 closed 9 years ago

Meatballs1 commented 9 years ago

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:

I fixed it with the following route:

Sorry cant submit a PR at the moment.

HarmJ0y commented 9 years ago

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.