root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat escapetwo.md
// writeups

EscapeTwo

11 Jan 2025 · 15 min read · root access
EscapeTwo - maquina de Hack The Box

Executive summary — EscapeTwo is an Easy Active Directory box in assume-breach mode (we're given rose:KxEPkKe6R8su). An SMB Accounting Department share holds Excel files with credentials for several users and for sa (MSSQL); a spray confirms oscar, whose LDAP enumeration reveals the service accounts sql_svc and ca_svc (Kerberoasting them goes nowhere). With sa and xp_cmdshell we get a shell as sql_svc, and a sql-Configuration.INI leaks a password reused by ryan (WinRM, user.txt). In BloodHound, ryan has WriteOwner over ca_svc: with bloodyAD we take ownership and grant ourselves GenericAll, apply Shadow Credentials, and abuse an AD CS template vulnerable to ESC4 to issue an Administrator certificate. Path: xlsx -> sa/MSSQL -> ryan -> ca_svc (WriteOwner) -> ADCS ESC4 -> Administrator.

PlatformHack The Box
Operating systemWindows
DifficultyEasy
StatusRetired
Target IP10.129.6.78

Attack map

[assume-breach] rose : KxEPkKe6R8su  (SMB)
   |  "Accounting Department" share -> accounts.xlsx leaks sa/angela/oscar/kevin
   v
[spray] oscar valid -> netexec --users/--rid-brute reveals sql_svc, ca_svc, ryan
   |  Kerberoasting (sql_svc, ca_svc) -> hashes not cracked (dead end)
   v
[MSSQL]  sa : MSSQLP@ssw0rd! -> xp_cmdshell -> shell as sql_svc
   |  sql-Configuration.INI -> reused password -> ryan
   v
[ryan]  WinRM -> BloodHound: ryan WriteOwner over ca_svc
   |  bloodyAD: owner + GenericAll -> Shadow Credentials -> ca_svc hash
   v
[ADCS]  ca_svc -> ESC4 on DunderMifflinAuthentication -> Administrator cert
   v
[ADMIN]  Pass-the-Hash -> root.txt

1. Preparation: name resolution

Several certipy commands later on depend on the domain controller's hostname resolving correctly. Better to pin it in /etc/hosts up front than discover it mid-attack.

echo "10.129.6.78 dc01.sequel.htb sequel.htb dc01" | sudo tee -a /etc/hosts
ping -c1 dc01.sequel.htb

This makes the attacking box resolve dc01.sequel.htb, sequel.htb and dc01.

🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.