Skip to content

secretsdump: write trust keys to their own .ntds.trustkeys file - #2278

Open
mpgn wants to merge 1 commit into
fortra:masterfrom
mpgn:trust-keys-separate-output-file
Open

secretsdump: write trust keys to their own .ntds.trustkeys file#2278
mpgn wants to merge 1 commit into
fortra:masterfrom
mpgn:trust-keys-separate-output-file

Conversation

@mpgn

@mpgn mpgn commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Hello,

While working on this pr Pennyw0rth/NetExec#1321 , @NeffIsBack made a very good point about trusted keys not having their own file and be mixed with the wrong file.

-trust-keys currently writes the trust keys into <output>.ntds, mixed with the account hashes.

They don't follow the pwdump layout:

Administrator:500:aad3b435b51404eeaad3b435b51404ee:c66d72021a2d4744409969a581a1705e:::
north.sevenkingdoms.local (Incoming):rc4_hmac:dd3249d7bd57c4b5456461c3597e3648

The second field is a key type instead of a RID, so hashcat, john and any pwdump parser
break on those lines.

This writes them to <output>.ntds.trustkeys instead, the same way Kerberos keys already
go to <output>.ntds.kerberos.

Tested against a DC with one trust (-just-dc -trust-keys):

  • .ntds: 19 account lines, 0 trust lines
  • .ntds.trustkeys: 12 trust lines

Signed-off-by: mpgn <mpgn@users.noreply.github.com>
@mpgn
mpgn marked this pull request as ready for review September 1, 2026 18:29
@anadrianmanrique anadrianmanrique added the enhancement Implemented features can be improved or revised label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Implemented features can be improved or revised

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants