Feature/rodc prp - #1338
Open
A3-N wants to merge 9 commits into
Open
Conversation
Signed-off-by: Adriaan Bosch <80641430+A3-N@users.noreply.github.com>
A3-N
requested review from
Marshall-Hallenbeck,
NeffIsBack,
mpgn and
zblurx
as code owners
July 29, 2026 19:06
Member
|
Sounds pretty cool, thanks for the PR, ima have to give it a read! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
rodc-prpis a Read Only Domain Controller Password Replication Policy forldap. Read about it in specterops blog and 0xdeaddood thinking the idea was fairly cool. Tried to force this on an assessment, but couldn't get the opportunity without making too many changes. So the code here was ran on my lab. Hopefully next time I get to use this.A 101, the RODC can have a RODC Password Replication Group with deny or allow. Each RODC has a dedicated
krbtgt_*account and the RODC can also cache credentials. So, if you get local admin on this box, you have the cached creds, but the part I found interesting was the Key List Attack. Even if an account isn't cached, but can be cached/cacheable, you can use thekrbtgt_*account's aes key to get the cacheable account's nt hash.So with
msDS-RevealOnDemandGroupare the cacheable account's andmsDS-NeverRevealGroupis the non-cacheable or denied account's, which will omit,msDS-RevealOnDemandGroupif set as well. So using impacket's KeyListSecrets you forge a RODC's partial TGT for the cacheable account. The DC (writable KDC) will then validate on the RODC's PRP if this is allowed for the account in the ticket. The writeable KDC will then return the RC4-HMAC/nt hash. And since the ticket was forged, we have the material and can decrypt the response to get this. So this means you can get an account's nt hash, as long as its cacheable, and doesn't have to exist/be cached on the RODC itself.I hope I did some justice to explaining for the 101, but everything was already there in impacket I didn't reinvent the wheel.
Type of change
Setup guide for the review
Mostly default, but the details as follows:
msDS-RevealOnDemandGroupmsDS-NeverRevealGroupScreenshots:
Context:
msDS-RevealOnDemandGroupandmsDS-NeverRevealGroupkrbtgt_*account on the RODCUsing the module with no options returns the value RODC computer account, TYCHO$ and its matching krbtgt_29727 account. If its ran on a non RODC, it will show the RODC's computer account before.

TARGET is a

sAMAccountName, and this shows specific account's cacheable status vs theALLwhich will find all cacheable accounts.The RODCKEY value is the krbtgt_29727's aes key, which will most likely fail, because you're running on a read only KDC where the ticket needs to be sent to a writeable KDC. So you need the built in nxc flag,


--kdcHostto be paired with this.Some errors and debugging info to verify the right reasons are returned.




Invalid aes key
Read Only KDC specified with valid aes key
Checklist:
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)