Hack The Box

Machine Info

EscapeTwo is an Easy Windows machine focused on Active Directory exploitation. Initial access was gained using provided credentials, leading to the discovery of a read-only accounting department directory containing an XML file with plaintext credentials. Using these, access to an MSSQL service was obtained, xp_cmdshell was enabled, and a shell was uploaded. Enumeration revealed a service account password in a configuration file, which, combined with SeImpersonatePrivilege abuse, led to NT SYSTEM access. The intended path involved password spraying to collect four valid users, analyzing DACL information with SharpHound to find that the ryan account controlled CA_SVC, and exploiting a certificate template misconfiguration to retrieve the administrator’s NTLM hash.

Enumeration

Nmap:

nmap -sV -sC 10.129.186.109 -oA nmap/Escapetwo
53/tcp   open  domain        Simple DNS Plus
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-01-23T03:08:06+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=DC01.sequel.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::, DNS:DC01.sequel.htb
| Not valid before: 2024-06-08T17:35:00
|_Not valid after:  2025-06-08T17:35:00
445/tcp  open  microsoft-ds?
464/tcp  open  kpasswd5?
636/tcp  open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-01-23T03:08:06+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=DC01.sequel.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::, DNS:DC01.sequel.htb
| Not valid before: 2024-06-08T17:35:00
|_Not valid after:  2025-06-08T17:35:00
1433/tcp open  ms-sql-s      Microsoft SQL Server 2019 15.00.2000.00; RTM
| ms-sql-info: 
|   10.129.186.109:1433: 
|     Version: 
|       name: Microsoft SQL Server 2019 RTM
|       number: 15.00.2000.00
|       Product: Microsoft SQL Server 2019
|       Service pack level: RTM
|       Post-SP patches applied: false
|_    TCP port: 1433
| ms-sql-ntlm-info: 
|   10.129.186.109:1433: 
|     Target_Name: SEQUEL
|     NetBIOS_Domain_Name: SEQUEL
|     NetBIOS_Computer_Name: DC01
|     DNS_Domain_Name: sequel.htb
|     DNS_Computer_Name: DC01.sequel.htb
|     DNS_Tree_Name: sequel.htb
|_    Product_Version: 10.0.17763
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2025-01-23T02:52:38
|_Not valid after:  2055-01-23T02:52:38
|_ssl-date: 2025-01-23T03:08:06+00:00; 0s from scanner time.
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-01-23T03:08:06+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=DC01.sequel.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::, DNS:DC01.sequel.htb
| Not valid before: 2024-06-08T17:35:00
|_Not valid after:  2025-06-08T17:35:00
3269/tcp open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-01-23T03:08:06+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=DC01.sequel.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::, DNS:DC01.sequel.htb
| Not valid before: 2024-06-08T17:35:00
|_Not valid after:  2025-06-08T17:35:00
5985/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

The Nmap scan results reveal an Active Directory environment hosted on DC01.sequel.htb, with multiple open ports indicative of a Windows domain controller. Key services include LDAP (389, 636, 3268, 3269) for directory services, SMB (445) for file sharing, and MSRPC (135) for remote procedure calls. The presence of Microsoft SQL Server (1433) suggests potential database exploitation vectors. Additionally, WinRM (5985) is available, which could facilitate remote command execution if valid credentials are obtained. Notably, SMB signing is enforced, which may limit certain attacks. These findings indicate potential attack vectors through Active Directory enumeration, SMB interactions, SQL exploitation, and WinRM abuse.

⛔ This box is still active on HackTheBox. Once retired, this article will be published for public access as per HackTheBox's policy on publishing content from their platform.

⛔ For more hints and assistance, come chat with me and the rest of your peers in the HackTheBox Discord server. Or, you can reach out to me at my other social links in the site footer or site menu.


Appreciation

If my write-up helped you, I’d really appreciate it if you could show your support! 🙏 Also, if you like my content, please consider giving me respect on HTB—your support truly means a lot! 💚✨


Found a Mistake?

If you notice any errors or have feedback, feel free to email me at ashwin200323@gmail.com. Thanks for your help!