Page cover

Certified

Synopsis

Certified is a medium windows machine created by ruycr4ftarrow-up-right. The user judith.mader has a WriteOwner permission over management group. The owner of management group is given to judith.mader and the management group has a GenericWrite permission over management_svc user which leads to shadow credentials attack. The management_svc has a GenericAll permission over ca_operator user which we can abuse to perform shadow credentials attack. The ca_operator user is member of Certificate Service DCOM Access. The CertifiedAuthentication certificate template is vulnerable to ESC9 attack which is abused to gain the administrator NT hash.

OS
Difficulty
Points
Release Date
Retired Date

Linux

Medium

30

02-11-2024

15-03-2025

The credentials are given for the following account judith.mader / judith09


Enumeration

Nmap

Starting the nmap scan and found Active Directory services running.

nmap -Pn -sC -sV --min-rate=1000 10.10.11.41                                                                                                             01:46:41 [53/64]
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-12 01:44 GMT                                                                                                              
Nmap scan report for 10.10.11.41                                                                                                                                             
Host is up (0.54s 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-03-12 08:26:59Z)                                                                                  
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                                                                            
| Not valid before: 2024-05-13T15:49:36                                                                                                                                      
|_Not valid after:  2025-05-13T15:49:36                                                                                                                                      
|_ssl-date: 2025-03-12T08:28:32+00:00; +6h41m56s 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-cert: Subject: commonName=DC01.certified.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:DC01.certified.htb
| Not valid before: 2024-05-13T15:49:36
|_Not valid after:  2025-05-13T15:49:36
|_ssl-date: 2025-03-12T08:28:34+00:00; +6h41m56s from scanner time.
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name)                         
|_ssl-date: 2025-03-12T08:28:32+00:00; +6h41m56s 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                                                                            
| Not valid before: 2024-05-13T15:49:36                                                                                                                                      
|_Not valid after:  2025-05-13T15:49:36  
3269/tcp open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name)                                
|_ssl-date: 2025-03-12T08:28:32+00:00; +6h41m57s 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                                                                            
| Not valid before: 2024-05-13T15:49:36                                                                                                                                      
|_Not valid after:  2025-05-13T15:49:36                                                                                                                                      
5985/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)                                           
|_http-title: Not Found                                                                                                                                                      
|_http-server-header: Microsoft-HTTPAPI/2.0                                                                                                                                  
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows                                                                                                         
                                                                                                                                                                             
Host script results:                                                                                                                                                         
| smb2-time:                                                                                                                                                                 
|   date: 2025-03-12T08:27:52                                                                                                                                                
|_  start_date: N/A                                                                                                                                                          
|_clock-skew: mean: 6h41m56s, deviation: 0s, median: 6h41m55s                                                                                                                
| smb2-security-mode:                                                                                                                                                        
|   3:1:1:                                                                                                                                                                   
|_    Message signing enabled and required                                                                                                                                   
                                                                                                                                                                             
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .                                                                               
Nmap done: 1 IP address (1 host up) scanned in 126.63 seconds 

Add certified.htb0 and DC01.certified.htb in /etc/hosts file.

SMB - judith.mader

The given credentials will give us access to SMB shares and we don't have any read permission in any of the shares.

Bloodhound

The given credentials is also used in LDAP. We can use nxc as bloodhound ingestor.

1

Start the neo4j database

2

Run the nxc as a bloodhound ingester

Import the zip file into the bloodhound.

Permissions

WriteOwner: The user judith.mader has a WriteOwner permission over the management group with which we can use to set the owner of management group.

GenericWrite: The management group has a GenericWrite permission over the management_svc user with which we can modify the properties of management_svc user and perform shadow credentials attack to the NT hash.


Foothold

Shell - management_svc

Adding judith.mader into management group

1

Changing ownership of management group.

2

Giving WriteMembers permission.

Now the owner of management group is judith.mader, we can give the WriteMembers permission to judith.mader.

3

Adding into group,

Now we will be adding judith.mader user into management group.

Shadow Credentials Attack

Now we can add new certificate for shadow credentials attack and retrieve NT hash of that object. More details about it, is given in the link below.

1

Add new certificate.

2

Getting authentication into DC using a newly created certificate.

3

Getting NT hash

Note: If Clock skew too great error occur use ntpdate to synchronize date and time with the machine.

Now we will get the shell as management_svc using the above NT hash via evil-winrm.

circle-info

The use flag is present in C:\Users\\management_svc\Desktop\user.txt 👏


Privilege Escalation

Pillaging - managemnt_svc

Bloodhound reveals that the management_svc user has a GenericAll permission towards the ca_operator user, which give us the full control over ca_operator.

SMB - ca_operator [ Shadow Credentials Attack ]

The Shadow Credentials Attack can be performed because of GenericAll permission to retrive the NT hash.

Pillaging - AD CS

Bloodhound reveals that the ca_operator is the MemberOf Certificate Service DCOM Access. It is used to manage the certificates in Active Directory.

The certifyarrow-up-right is used for enumerating and finding vulnerable certificate templates.

1

Finding vulnerable certificate templates.

2

The json file reveals that the CertifiedAuthentication template is vulnerable to ESC9.

Shell - Administrator [ ESC9 Attack ]

ESC9 is a vulnerability in Active Directory Certificate Services (AD CS) where the StrongCertificateBindingEnforcement key is not set to 2 or includes the UPN flag. The details about ESC9 is given in hacktricks. The link is given below.

1

Changing userPrincipalName

The userPrincipalName has to be changed from ca_operator to administrator.

2

Request the certificate

Requesting the CertifiedAuthentication certificate.

3

Restoring the UPN

Change the UPN from Administrator to ca_operator.

4

Getting NT hash

circle-info

The root flag is present in C:\Users\Administrator\Desktop\root.txt 🎉


Proof of Concept

The below video provides the PoC of Certified machine.

Last updated