Open
Conversation
The warning regarding code quality control has been resolved. Added type ignore comment for missing import.
Added detection for DC registry configuration related to ESC10 vulnerabilities, including strong certificate binding enforcement and certificate mapping methods. Updated relevant sections to integrate this new detection into the output.
'repotUnnecessaryTypeIgnoreComments' was removed to address a code quality issue.
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.
Add ESC10 (Weak Certificate Mapping) detection
Summary
Add detection for ESC10 (Weak Certificate Mapping), a missing vulnerability scenario in Certipy's
findcommand. ESC10 exploits weak certificate-to-account mapping configurations on Domain Controllers and has two sub-scenarios:StrongCertificateBindingEnforcement = 0on the DC (KDC service) — certificate binding enforcement is completely disabledCertificateMappingMethodscontains the0x4flag (UPN mapping) — weak UPN-based certificate mapping is enabledBoth require a template that supports client authentication, enrollment rights, and no manager approval. A GenericWrite prerequisite over another account is also needed for exploitation.
Changes
Single file changed:
certipy/commands/find.pyNew method
_get_dc_registry_config()— Connects to the DC's remote registry (RRP) and reads two registry keys:HKLM\SYSTEM\CurrentControlSet\Services\Kdc\StrongCertificateBindingEnforcement(default: 1)HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel\CertificateMappingMethods(default: 0x18)open_remote_registry()infrastructure (same pattern asca.py)--dc-onlymode skips registry read entirelyPipeline integration —
_get_dc_registry_config()is called infind()between CA property processing and template property processingESC10a/ESC10b vulnerability checks — Added to
get_template_vulnerabilities()after the existing ESC9 check:StrongCertificateBindingEnforcement == 0and template allows client authenticationCertificateMappingMethods & 0x4and template allows client authenticationOutput: "Domain Controller Configuration" section — Added to
get_output_for_text_and_json()before CA and Template sections, showing the DC host and both registry values. Appears in both text and JSON output formats. CSV output inherits ESC10 info through the existing[!] Vulnerabilitiescolumn in template CSVs.Docstring updates — Module and method docstrings updated to reflect ESC10a/ESC10b coverage
No changes to
ca.py,security.py,constants.py— no new rights or flags neededcertipy find -vulnerablecovers ESC10[!] VulnerabilitiescolumnHow I tested
If you want to see example output I can provide.
Expected output when vulnerable:
StrongCertificateBindingEnforcementandCertificateMappingMethodsvalues[!] VulnerabilitiesTest environment requirements:
StrongCertificateBindingEnforcement = 0(for ESC10a)CertificateMappingMethodscontaining0x4flag (for ESC10b)Code quality