You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the Twitter thread by @Defte_, Microsoft changed the validated write rules for the msDS-KeyCredentialLink attribute, which broke Shadow Credentials attacks.
This PR adds the correct KeyCredential format is used (CustomKeyInformation with MFANotUsed flag and no LastLogonTime).
Dependency: This change depends on pydsinternals, which updates the KeyCredential blob format for Microsoft’s new validated write requirements. That PR must be merged before this one works correctly.
I'm not sure this is the correct way to check for a machine account, users can also end with a $ and computers may also not be in the CN=Computer path (eg: Domain Controllers).
Looking at other pull requests in other tools, it's not differentiated between users and computers account, I haven't tested it myself but maybe the config for machine accounts works also for users.
I'm not sure this is the correct way to check for a machine account, users can also end with a $ and computers may also not be in the CN=Computer path (eg: Domain Controllers).
Looking at other pull requests in other tools, it's not differentiated between users and computers account, I haven't tested it myself but maybe the config for machine accounts works also for users.
I tested it, and the machine account configuration (isComputerKey=True) also works for user accounts. So you can actually use the same configuration for both
p0dalirius
changed the title
Fix Shadow Credentials for computer accounts (post–Microsoft patch)
[bug] Fix Shadow Credentials for computer accounts (post–Microsoft patch)
Feb 1, 2026
p0dalirius
changed the title
[bug] Fix Shadow Credentials for computer accounts (post–Microsoft patch)
[bug] (post–Microsoft patch) Fix Shadow Credentials validated write requirements for computer accounts adding a certificate to themselves
Feb 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following the Twitter thread by @Defte_, Microsoft changed the validated write rules for the
msDS-KeyCredentialLinkattribute, which broke Shadow Credentials attacks.This PR adds the correct
KeyCredentialformat is used (CustomKeyInformation withMFANotUsedflag and noLastLogonTime).Dependency: This change depends on pydsinternals, which updates the
KeyCredentialblob format for Microsoft’s new validated write requirements. That PR must be merged before this one works correctly.Before :
After :