Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

test for temporary canary object always evaluates to true when running in mode 2 #13

Open
2a-h opened this issue Aug 31, 2022 · 0 comments

Comments

@2a-h
Copy link

2a-h commented Aug 31, 2022

when running the script in mode 2, the statement on line 785 will always evaluate to $true because both $objectOnTargetDCPwdLastSet and $objectOnSourceOrgRWDCPwdLastSet are uninitialized in this mode and are therefore both equal to $null
https://github.com/microsoft/New-KrbtgtKeys.ps1/blob/aaa1b322f3dd4478f733a01b37dd221c8ff1f8c0/New-KrbtgtKeys.ps1#L785

the statement should evaluate to $false when $targetObjectToCheck is $null because it would mean that, for example, Get-ADObject on lines 755 or 758 failed for some reason
https://github.com/microsoft/New-KrbtgtKeys.ps1/blob/aaa1b322f3dd4478f733a01b37dd221c8ff1f8c0/New-KrbtgtKeys.ps1#L755

@2a-h 2a-h changed the title test for canary object test for temporary canary object always evalutes true when running in mode 2 Aug 31, 2022
@2a-h 2a-h changed the title test for temporary canary object always evalutes true when running in mode 2 test for temporary canary object always evaluates true when running in mode 2 Aug 31, 2022
@2a-h 2a-h changed the title test for temporary canary object always evaluates true when running in mode 2 test for temporary canary object always evaluates to true when running in mode 2 Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant