Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 7a3e16a

Browse files
+Region check on Find-DomainLocalGroupMember
If a user does not manually specify $GroupName it defaults to "Administrators" which may not be valid in specific regions. I added a check to pull out the Group Name from the Admin SID, see: #176
1 parent 41cad0e commit 7a3e16a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Recon/PowerView.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18911,6 +18911,12 @@ Custom PSObject with translated group property fields from WinNT results.
1891118911
$HostEnumBlock = {
1891218912
Param($ComputerName, $GroupName, $Method, $TokenHandle)
1891318913

18914+
# Add check if user defaults to/selects "Administrators"
18915+
if ($GroupName -eq "Administrators") {
18916+
$AdminSecurityIdentifier = New-Object System.Security.Principal.SecurityIdentifier([System.Security.Principal.WellKnownSidType]::BuiltinAdministratorsSid,$null)
18917+
$GroupName = ($SecurityIdentifier.Translate([System.Security.Principal.NTAccount]).Value -split "\\")[-1]
18918+
}
18919+
1891418920
if ($TokenHandle) {
1891518921
# impersonate the the token produced by LogonUser()/Invoke-UserImpersonation
1891618922
$Null = Invoke-UserImpersonation -TokenHandle $TokenHandle -Quiet

0 commit comments

Comments
 (0)