feat(ldap): add ADCS collection support via CertiHound integration#1054
feat(ldap): add ADCS collection support via CertiHound integration#10540x0Trace wants to merge 6 commits intoPennyw0rth:mainfrom
Conversation
Add Active Directory Certificate Services (ADCS) enumeration to the BloodHound collection workflow using CertiHound library. Changes: - Add 'adcs' to valid collection methods in resolve_collection_methods() - Add CertiHound as optional dependency (pip install netexec[adcs]) - Implement _collect_adcs_for_bloodhound() for ADCS data collection - Update bloodhound() to handle ADCS-only and combined collections - Export ADCS data in BloodHound CE v6 format
|
Consider this PR has DUP with this module
|
Thanks for flagging this! I see how it might look like a duplicate at first glance, but they actually do different things: |
|
Good... my idea is, because now there are lots of It's a good idea? how do you think? If this works, then you can move |
|
Thanks for the PR. I agree with @XiaoliChan, there are a lot of ADCS modules now and we have to make sure that they don't do duplicate functionality. As far as I know certipy is also capable of outputting bloodhound data so we can just use that. |
|
@0x0Trace is certihound open source? Can't find the repo |
Hello! Yes it is open source you can find it here : https://pypi.org/project/certihound/ |
|
Thanks for the suggestions! I looked into this , the issue is that certipy's JSON output doesn't contain the data structures BloodHound CE needs (like node/edge relationships, proper GUIDs, etc.). CertiHound isn't just a format converter - it collects the data differently to build the graph relationships BloodHound CE expects. Also worth noting: certipy v5.x actually removed the -bloodhound flags entirely, so there's no BloodHound output in current certipy at all. |
Great, please provide the source code on git repository, we can take a look TGT ^_^ |
Of course i would appreciate it ! I just pushed it you can check it here : https://github.com/0x0Trace/Certihound |
Great job bro, BTW, Happy new year! |
Thank you ! Happy new year to you also :D |
|
@NeffIsBack the source code for the library is here : https://github.com/0x0Trace/Certihound .Happy new year! |
Thanks and happy new year. I will take a look at it 👍 |
|
@NeffIsBack thanks for noticing it !It is fixed now |
|
@NeffIsBack did you managed to take a look at it?Thanks again for your time |
Not fully, but I took a short peek. I am still torn between "it would be really cool to have ADCS collection" and "oh no, yet another dependency with sub dependencies that have to be managed". The problem is that there are already certipy and bloodhound which both would be a great fit for such functionality, without much initial and long term work required for it to be integrated. If we decide to integrate your tool (which is really cool btw!) this should not be an optional dependency, but a normal one. Meaning, your tool as well as all sub dependencies must be checked and uploaded into the kali repositories. That is one of the reasons I am hesitating a bit to give it the approval, besides the normal dependency management that gets harder and harder the more there are (e.g. upgrading to new python versions is often a pain). One question: what is the reason ldap3 is used as a baseline for the tool? Why not impacket? And I have seen you have build an adapter for impacket connections, does this mean impacket ldap is used at the end or is this just used to create the ldap3 connection for querying? |
|
Hey @NeffIsBack, thanks for taking the time to look into this , I really appreciate the feedback. Let me address the ldap3 vs impacket question directly: The ImpacketLDAPAdapter doesn't actually use impacket's LDAP client for queries - it's just a thin translation layer (~100 lines). Here's how it works:
Why ldap3 as the baseline? CertiHound needs to work standalone (CLI mode) without requiring the full impacket stack. But when integrated with NetExec, ldap3 is not needed at runtime - the adapter handles all the translation. This keeps it portable for other tools too. Regarding dependencies for Kali packaging - I checked and the actual new dependencies CertiHound would bring to NetExec are I've also set it up as an optional dependency ( Totally understand the hesitation around dependency management though - it's a real concern for maintainability. Happy to help with the Kali packaging process if this moves forward, or answer any other questions about the architecture. |
Actually sounds pretty cool. The reason i asked is my long long term goal would be to fully remove ldap3 from the project and solely rely on impackets ldap implementation. However, this will probably not happen for the next few years because there are so many projects using ldap3 instead of impackets ldap, so this additional dependency doesn't matter for now.
That is good2know and definitely makes things much easier. So i have talked a bit with the others and i think for now this (CertiHound) is the best and easiest way to collect ADCS data, thanks for your work! So please:
|
Move CertiHound from optional to default dependencies and remove conditional import handling since it will always be installed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Hey @NeffIsBack , thanks for the green light! Really appreciate you and the team giving this a shot. I've made the changes you requested:
Pretty minimal diff, just a few lines each. Let me know if you want me to adjust anything else or if there's anything I missed. |
Adds Active Directory Certificate Services (ADCS) enumeration to BloodHound collection, enabling security assessors to collect PKI-related attack paths alongside traditional AD data.
Key Features:
-c ADCScollection method for certificate template and CA enumerationMotivation
ADCS misconfigurations (ESC1-ESC8) are among the most prevalent and impactful Active Directory attack vectors. Currently, NetExec users must run separate tools to collect this data. This integration brings ADCS collection directly into the existing
--bloodhoundworkflow, producing a single unified zip file for BloodHound CE import.Changes
pyproject.tomlcertihoundas optional dependency (netexec[adcs])nxc/protocols/ldap/proto_args.pynxc/protocols/ldap.pyadcsto valid/all methods, implement_collect_adcs_for_bloodhound()Installation
Usage
Example Output
Screenshots
Terminal Output
ESC1 Vulnerability Detected
ESC4 Vulnerability Detected
BloodHound Output
The zip file includes standard BloodHound files plus ADCS data:
certtemplates.jsonenterprisecas.jsonrootcas.jsonntauthstores.jsonaiacas.jsonTest Plan
-c ADCS) works without bloodhound-python-c All) includes ADCS data-c Group,ADCS) work correctlyNotes
Related
Checklist: