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

Commit d106093

Browse files
authored
Fix errors gathering the forest SID
Pull the SID directly from the 'krbtgt' user to avoid errors in ConvertTo-SID
1 parent 94438ed commit d106093

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Recon/PowerView.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3891,10 +3891,10 @@ to the forest root domain SID.
38913891
if ($ForestObject) {
38923892
# get the SID of the forest root
38933893
if ($PSBoundParameters['Credential']) {
3894-
$ForestSid = ConvertTo-SID -ObjectName "krbtgt@$($ForestObject.RootDomain)" -Credential $Credential
3894+
$ForestSid = (Get-DomainUser -Identity "krbtgt" -Domain $ForestObject.RootDomain.Name -Credential $Credential).objectsid
38953895
}
38963896
else {
3897-
$ForestSid = ConvertTo-SID -ObjectName "krbtgt@$($ForestObject.RootDomain)"
3897+
$ForestSid = (Get-DomainUser -Identity "krbtgt" -Domain $ForestObject.RootDomain.Name).objectsid
38983898
}
38993899

39003900
$Parts = $ForestSid -Split '-'

0 commit comments

Comments
 (0)