๐Ÿ“œCertificate

https://app.hackthebox.com/machines/663

Recon

change <ip>
[*] Running initial Nmap scan...                        
sudo nmap -sCV -T4 <ip> -oA nmap-initial                                                                    
[sudo] password for kali:                   
Starting Nmap 7.95 ( https://nmap.org ) at 2025-06-01 12:26 CEST
Nmap scan report for <ip>
Host is up (0.020s latency).
Not shown: 989 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-01 18:26:32Z)
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-01T18:27:53+00:00; +8h00m02s 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?                                                                                          
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-date: 2025-06-01T18:27:53+00:00; +8h00m02s 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                                                                               
3269/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-01T18:27:53+00:00; +8h00m02s from scanner time.  
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

Web

We can register a student and a teacher with a sidenote:

Please note that after creating a teacher account you need to contact ours support to verify your identity and activate your account

Using dirsearch we detect an upload.php

Using this with a registered account

By addind the parameter s_id and iterating over it we find some a way to upload files

User

Experimenting around we find a way to get a reverse shell.

Clicking on HERE and change the url ending to shell.php to trigger the shell.

We find a pass and user in db.php file

Getting some hashes from the db

Checking some permission using bloodhound we find a force change password attack.

Root

Last updated