Hello
As shown in above diagram, we know how we can add windows-services and how they are run under a shell of svchost.exe
Let’s say I am adding one simple heart-beat service on one AD domain joined windows box.
On this windows box I have already installed one Managed Service Account.
Now while configuring heart-beat service, I am running it under a regular user-account.
So I believe the security-context of this service is around this regular user-account
Is it possible for the code of this service to retrieve the Managed Service Account password by something like following
$MSA = ConvertFrom-ADManagedPasswordBlob (Get-ADServiceAccount SvcCustomerWeb -prop 'msDS-ManagedPassword' | Select -expand 'msDS-ManagedPassword')
ConvertTo-NTHash $MSA.SecureCurrentPassword
I understand that if I had run this service under built-in SYSTEM account then the code can definitely get the MSA password. But in this case I am running the service under some regular account who has Log on as Service permission
12