Conversation
|
Thanks for the PR, definitely looks cool! |
|
Shouldn't we import that into the enum_cve now ? |
|
Hmm we could/should probably add the cve to enum_cve as well, but this probes the vuln "actively" as fas as i can tell, so probably not something that should also be executed along side the UBR querying stuff. |
|
I can open a PR for this in enum_cve but it would not be a fully reliable check. For Certifried patching the DC does not tell the whole story because the CA side and existing cert state matter too. Better to keep it a seperate module imo |
|
After looking into how the vuln and patches work, I think integrating it into |
Description
This PR adds a LDAP module to check whether the DC and CA show signs of being vulnerable to Certifried (CVE-2022-26923)
It does the following:
The module reports three outcomes:
CA-side hardening present: issued cert includes the SID extensionPossible vulnerable to Certifried, SID-less user cert accepted over SchannelSID-less cert was rejected over SchannelFor machine accounts, the module checks the LDAP object type, prefers the
Machinetemplate and fails if the account has nodNSHostNameWhat this module proves (not 100% guarantee if the vuln is present):
No new third party dependency update is required
Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Setup guide for the review
Tested locally with
Python 3.11.2on Debian WSLReviewer requirements:
Module options:
CA: restrict checks to a specific CA namePASSIVE_TEMPLATE: force a specific template for the CA/DC probeTIMEOUT: timeout in seconds for Certipy operationsReview command:
netexec ldap $dc_ip -u $user -p $password -M certifriedValidation performed:
Vulnerable environment (ludus):
Domain user
Usertemplate issued a SID-less certMachine account without a dNSHostName (default when its created using the add-computer module):
MachinetemplateMachine cert probe failed, machine account has no dNSHostNameMachine account with a dNSHostName:
Machinetemplate issued a SID-less certPatched environment (ludus):
Domain user
Usertemplate issued a cert with the SID extension presentMachine account without a dNSHostName (default when its created using the add-computer module):
MachinetemplateMachine cert probe failed, machine account has no dNSHostNameMachine account with a dNSHostName:
Machinetemplate issued a cert with the SID extension presentTryhackme CVE-2022-26923 room (https://tryhackme.com/room/cve202226923)
Domain user
Usertemplate issued a SID-less certlmk if I need to provide my ludus config ranges files :D
Screenshots (if appropriate):
Unpatched
Domain user

Machine accounts

Patched
Domain user

Machine accounts

Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run python -m ruff check . --preview, 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)