Adding logic for DCs with RestrictRemoteClients = 2#2166
Open
clou42 wants to merge 1 commit into
Open
Conversation
Author
|
In case you want to reproduce: Note that behavior is different with full DA accounts and users that are empowered to DCsync via ACLs.
Full error before patch: Working after applying the patch: |
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.
Hi,
I figured that secretsdump fails with a
rpc_c_access_deniederror when a target DC has set the HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Rpc\RestrictRemoteClients = 2.To resolve this, I added a fallback using the named pipe protocol sequence.
From Microsoft docs (https://learn.microsoft.com/en-us/windows-server/security/rpc-interface-restrict): "RPC clients that use the named pipe protocol sequence (ncacn_np) are exempt from all restrictions discussed in this section. The named pipe protocol sequence can't be restricted due to significant backwards compatibility issues."
This patch aims at resolving that. I tested it in my lab and did not see any adverse effects. (I also tried to not touch any working behavior, this is a pure fallback implementation).
A longline is printed whenever we fall back to a named pipe.
Hope this helps others as well. In case of questions let me know.