diff options
author | Meatballs <eat_meatballs@hotmail.co.uk> | 2016-11-01 14:11:44 +0000 |
---|---|---|
committer | Meatballs <eat_meatballs@hotmail.co.uk> | 2016-11-01 14:11:44 +0000 |
commit | a70bbe61647c00b529d38c72515bd3f0a0089c28 (patch) | |
tree | cfac2966330ca1a3454e47229e7cbf58505fe7c2 /Recon | |
parent | 8c9c7c84fef03ecf1727f21cd96f3a2c23a8fdda (diff) | |
download | PowerSploit-a70bbe61647c00b529d38c72515bd3f0a0089c28.tar.gz PowerSploit-a70bbe61647c00b529d38c72515bd3f0a0089c28.zip |
Add disabled and present searches to get-netfileservers
Diffstat (limited to 'Recon')
-rwxr-xr-x | Recon/PowerView.ps1 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Recon/PowerView.ps1 b/Recon/PowerView.ps1 index f1dd0a9..6dfccb4 100755 --- a/Recon/PowerView.ps1 +++ b/Recon/PowerView.ps1 @@ -5642,13 +5642,13 @@ function Get-NetFileServer { } } } - - Get-NetUser -Domain $Domain -DomainController $DomainController -Credential $Credential -PageSize $PageSize | Where-Object {$_} | Where-Object { + $filter = "(!(userAccountControl:1.2.840.113556.1.4.803:=2))(|(scriptpath=*)(homedirectory=*)(profilepath=*))" + Get-NetUser -Domain $Domain -DomainController $DomainController -Credential $Credential -PageSize $PageSize -Filter $filter | Where-Object {$_} | Where-Object { # filter for any target users if($TargetUsers) { $TargetUsers -Match $_.samAccountName } - else { $True } + else { $True } } | ForEach-Object { # split out every potential file server path if($_.homedirectory) { |