Add RPC, Filter Validation helpers to NtCoreLib.Net.Firewall
and PoSH module
#85
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 there!
Recently, I noticed that Windows 11 / Server 2025 added the
FWPM_CONDITION_RPC_OPNUM
condition to theRPC_UM
layer.Also recently added is the
auditparameters
setting for RPC filters innetsh
, which is feature flagged behind theRpcBufferAuditing
flag - pretty neat! That feature flag also fixes the age-old issue of named pipe RPC events not having IP information (insideRPCRT4.dll
).In order to make this a bit more accessible, I've written up a series of changes on top of the
NtCoreLib.Net.Firewall
package. Specifically:FWPM_CONDITION_RPC_OPNUM
condition, along with helpers for other common RPC fields._V4/_V6
-suffixed keys that the RPC layers use.NamedGuidDictionary
to reflect constants out of theFirewall<Type>Guids
classes.FWPM_CONTEXT_RPC_AUDIT_ENABLED
in the RPC audit sublayer (as well as the currently-undocumented buffer auditing flags)SpecializeValue
mis-cast an RPC field typeFirewallLayer
to extract field metadata at runtimeHopefully splitting out the commits helps with merging - if there's any changes you're not too keen on, feel free to cherry-pick!
Thanks for the great library! :)
Code samples of the new features: