HTB: Coder Writeup
Coder — HackTheBox Writeup
| Machine | Coder |
| OS | Windows |
| Difficulty | Insane |
| Rating | ⭐⭐⭐⭐⭐ |
| Author | d3vn0mi |
🛠️ Walkthrough
Both flags confirmed live from the box (the first line is just the admin hash echoed by nxc).
🏁 Coder (HTB Insane, Windows AD) — Fully Pwned
Flags:
- user.txt:
<redacted> - root.txt:
<redacted>
Attack chain executed
- Recon — SMB Guest access to the
Developmentshare →Encrypter.exe+s.blade.enc(preserved mtime = epoch1668205028). - Reverse engineering — Reimplemented the .NET
Random-seeded AES; decrypted via realmono/mcs(avoiding aNextBytesbyte quirk) → 7z archive → KeePass DB (keyfile-only) with s.blade creds + an encrypted TOTP backup. - Source review + brute — CryptoJS double-AES brute (
skyblade) → TOTP secretPM2CG6RO73QT74WS. - Foothold — The hard part: scripted the entire TeamCity 2022.10 web auth headlessly — reverse-engineered its custom jsbn RSA padding (length in the last byte), the
__testcookie requirement,/loginSubmit.html, and the 2FA login endpoint (POST /2fa.htmlwithpassword=<TOTP>) using server-clock TOTP. Then patch-based RCE via/uploadDiffChanges.html+ personal build → command output read straight from the build log assvc_teamcity(no reverse shell, no Defender fight). - Lateral — Read
101.changes.diff, rebuilt theConvertTo-SecureString -Keyobject → e.black (ypOSJXPqlDOxxbQSfEERy300, PKI Admins). → user.txt. - Root — ADCS: as e.black created a template that is simultaneously `NO_SECURITY
🏁 Proof of Ownership
| Flag | Value |
|---|---|
| User | <redacted> |
| Root | <redacted> |