Skip to content

[bug] (post–Microsoft patch) Fix Shadow Credentials validated write requirements for computer accounts adding a certificate to themselves#38

Merged
p0dalirius merged 2 commits intoShutdownRepo:mainfrom
azoxlpf:fix/fix-shadowcreds
Feb 1, 2026
Merged

Conversation

@azoxlpf
Copy link
Contributor

@azoxlpf azoxlpf commented Jan 30, 2026

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.

Before :

1

After :

2

@Signum21
Copy link

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.

@azoxlpf
Copy link
Contributor Author

azoxlpf commented Jan 31, 2026

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
Copy link
Collaborator

Hey,

Thank you @azoxlpf, I published version pydsinternals 1.2.5 https://github.com/p0dalirius/pydsinternals/releases/tag/1.2.5 with your PR addressing this

Best regards,

@p0dalirius p0dalirius self-assigned this Feb 1, 2026
@p0dalirius p0dalirius added the bug Something isn't working label Feb 1, 2026
@p0dalirius 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 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
@p0dalirius p0dalirius merged commit d7a55f9 into ShutdownRepo:main Feb 1, 2026
1 check passed
@azoxlpf azoxlpf deleted the fix/fix-shadowcreds branch February 1, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants