diff options
author | Meatballs <eat_meatballs@hotmail.co.uk> | 2016-08-13 20:21:23 +0100 |
---|---|---|
committer | Meatballs <eat_meatballs@hotmail.co.uk> | 2016-08-13 20:21:23 +0100 |
commit | 462c6e83cb144c31e14df92856aa853ed1955a08 (patch) | |
tree | 23c98b5b9715a2aaad8aaba18d83dec7ba06151c /Recon | |
parent | 869badc7f159d5bb772c2fe042c7b8f413c6f698 (diff) | |
download | PowerSploit-462c6e83cb144c31e14df92856aa853ed1955a08.tar.gz PowerSploit-462c6e83cb144c31e14df92856aa853ed1955a08.zip |
Retrieve Security groups by default
Diffstat (limited to 'Recon')
-rwxr-xr-x | Recon/PowerView.ps1 | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/Recon/PowerView.ps1 b/Recon/PowerView.ps1 index 27f87c7..b9ef28c 100755 --- a/Recon/PowerView.ps1 +++ b/Recon/PowerView.ps1 @@ -5077,22 +5077,26 @@ function Get-NetGroup { A [Management.Automation.PSCredential] object of alternate credentials for connection to the target domain. + .PARAMETER AllTypes + + By default we will retrieve only Security, not Distribution Groups. + .EXAMPLE PS C:\> Get-NetGroup - - Returns the current groups in the domain. + + Returns the current security groups in the domain. .EXAMPLE PS C:\> Get-NetGroup -GroupName *admin* - + Returns all groups with "admin" in their group name. .EXAMPLE PS C:\> Get-NetGroup -Domain testing -FullData - + Returns full group data objects in the 'testing' domain #> @@ -5113,10 +5117,10 @@ function Get-NetGroup { [String] $Domain, - + [String] $DomainController, - + [String] $ADSpath, @@ -5129,7 +5133,10 @@ function Get-NetGroup { [Switch] $RawSids, - [ValidateRange(1,10000)] + [Switch] + $AllTypes, + + [ValidateRange(1,10000)] [Int] $PageSize = 200, @@ -5139,6 +5146,10 @@ function Get-NetGroup { begin { $GroupSearcher = Get-DomainSearcher -Domain $Domain -DomainController $DomainController -Credential $Credential -ADSpath $ADSpath -PageSize $PageSize + if (!$AllTypes) + { + $Filter += "(groupType:1.2.840.113556.1.4.803:=2147483648)" + } } process { @@ -5193,7 +5204,7 @@ function Get-NetGroup { else { $GroupSearcher.filter = "(&(objectCategory=group)(samaccountname=$GroupName)$Filter)" } - + $Results = $GroupSearcher.FindAll() $Results | Where-Object {$_} | ForEach-Object { # if we're returning full data objects |