root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat manager.md
// writeups

Manager

21 Oct 2023 · 13 min read · root access
Manager - maquina de Hack The Box

Executive summary — Manager is a Medium Active Directory box where the final escalation vector relies on Active Directory Certificate Services (AD CS). With RID brute and trivial password spraying (username=password) we get operator, which authenticates to MSSQL; without xp_cmdshell, xp_dirtree lists the filesystem and locates a website backup leaking credentials for raven (user flag). raven discovers a misconfigured SubCA template (ENROLLEE_SUPPLIES_SUBJECT): after becoming a CA officer, enabling the template, requesting and manually approving a certificate as Administrator, it authenticates via PKINIT and retrieves their NTLM hash for Pass-the-Hash.

PlatformHack The Box
Operating systemWindows
Domainmanager.htb
DifficultyMedium
StatusRetired
CAmanager-DC01-CA
Target IP10.129.5.242

Attack map

[1] RID brute -> users -> password spraying (operator:operator)
        |
[2] MSSQL as operator -- no xp_cmdshell, but xp_dirtree lists the filesystem ->
      a website backup reachable over HTTP
        |
[3] Backup leaks raven's credentials  ->  user.txt
        |
[4] adPEAS/Certipy -- SubCA template with ENROLLEE_SUPPLIES_SUBJECT
      raven adds itself as a CA officer + enables SubCA
        |
[5] Request a cert impersonating administrator@manager.htb -- CERTSRV_E_TEMPLATE_DENIED
      but the request IS created (Request ID) -> approve it manually as officer
        |
[6] Retrieve administrator.pfx -> PKINIT (Certipy auth) -> Administrator's NTLM hash
      (clock skew fixed with ntpdate)
        |
[7] Pass-the-Hash (psexec.py)  ->  nt authority\system  ->  root.txt

1. Reconnaissance

echo "10.129.5.242 manager.htb dc01.manager.htb ca.manager.htb" | sudo tee -a /etc/hosts
nmap -Pn -sC -sV 10.129.5.242   # DNS, Kerberos, LDAP, SMB, MSSQL(1433), HTTP, WinRM

These three hostnames (manager.htb, dc01.manager.htb, ca.manager.htb) aren't added on a whim: later on, Certipy needs to resolve the DC and CA names to talk to the certificate's RPC/DCOM services. Without this entry in /etc/hosts, certipy commands fail with opaque errors like Failed to resolve or Failed to get dynamic TCP endpoint for CertSvc, hard to tie back to DNS if you don't already know it.

🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.