mirror of
https://github.com/PowerShellMafia/PowerSploit
synced 2026-06-08 12:13:33 +00:00
Fix errors gathering the forest SID
Pull the SID directly from the 'krbtgt' user to avoid errors in ConvertTo-SID
This commit is contained in:
+2
-2
@@ -3891,10 +3891,10 @@ to the forest root domain SID.
|
||||
if ($ForestObject) {
|
||||
# get the SID of the forest root
|
||||
if ($PSBoundParameters['Credential']) {
|
||||
$ForestSid = ConvertTo-SID -ObjectName "krbtgt@$($ForestObject.RootDomain)" -Credential $Credential
|
||||
$ForestSid = (Get-DomainUser -Identity "krbtgt" -Domain $ForestObject.RootDomain.Name -Credential $Credential).objectsid
|
||||
}
|
||||
else {
|
||||
$ForestSid = ConvertTo-SID -ObjectName "krbtgt@$($ForestObject.RootDomain)"
|
||||
$ForestSid = (Get-DomainUser -Identity "krbtgt" -Domain $ForestObject.RootDomain.Name).objectsid
|
||||
}
|
||||
|
||||
$Parts = $ForestSid -Split '-'
|
||||
|
||||
Reference in New Issue
Block a user