> For the complete documentation index, see [llms.txt](https://0xdeco.gitbook.io/vulnlab/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xdeco.gitbook.io/vulnlab/reflection.md).

# Reflection

<figure><img src="/files/SfNey4ejFKZf4ugJyNnC" alt=""><figcaption></figcaption></figure>

## Enumeration

IPs

```
10.10.241.21 dc01.reflection.vl
10.10.241.22 ms01.reflection.vl
10.10.241.23 ws01.reflection.vl
```

Enumerating SMB shares we find a custom one on `MS01`

<figure><img src="/files/ZSiPT6qeu8BkcGp7sYN1" alt=""><figcaption></figcaption></figure>

Inside we find a configuration file

<figure><img src="/files/2ro3UzX4HVRQwlUA4Sxh" alt=""><figcaption></figcaption></figure>

We find credentials probably for a user `web_staging`&#x20;

<figure><img src="/files/L0bSx7XsbG6uuoiFOCxo" alt=""><figcaption></figcaption></figure>

The credentials work for `MS01`

<figure><img src="/files/GMoMGOmzH8Ef5NPhADfu" alt=""><figcaption></figcaption></figure>

Unfortunately we cannot enable `xp_cmdshell`

<figure><img src="/files/3OB701UwCEemhrZB5nsT" alt=""><figcaption></figcaption></figure>

We enumerate the dbs

<figure><img src="/files/aaQvSOWSR3T71KsKQTXm" alt=""><figcaption></figcaption></figure>

We find a `users` table

<figure><img src="/files/2B2aFyd422qZfuMhsFH3" alt=""><figcaption></figcaption></figure>

Inside there are credentials

<figure><img src="/files/en8Q3ws8ASf9uu1jmyL4" alt=""><figcaption></figcaption></figure>

## SMB Relay

We can try to capture a [NTLMv2](https://book.hacktricks.xyz/network-services-pentesting/pentesting-mssql-microsoft-sql-server#steal-netntlm-hash-relay-attack) hash from the MSSQL machine&#x20;

<figure><img src="/files/3eU1LckhXQi1PSC1HrMe" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/gT151hOlQLFFk32HK7b0" alt=""><figcaption></figcaption></figure>

We cannot pth but we can relay it to other machines in the domain that have SMB signing not required

It's possbile to check it by looking at the Nmap script scan of the SMB server, or by using CME

<figure><img src="/files/qTxPyxBDPTTdun83C3oU" alt=""><figcaption></figcaption></figure>

First we need to disable the SMB and HTTP listeners on Responder configuration `/etc/responder/Responder.conf`

Then we run `ntlmrelayx` to authenticate to the DC&#x20;

<figure><img src="/files/l4St6K5kbZorBpsbqlDg" alt=""><figcaption></figcaption></figure>

With `-i` it spawns an SMB shell on port 11000

Now we see a new share called `prod`

<figure><img src="/files/hFf09OG3aanwfjBVEioz" alt=""><figcaption></figcaption></figure>

Inside there is another configuration file with creds for a `web_prod` user

<figure><img src="/files/y0wbGt73LvIend3enOCc" alt=""><figcaption></figcaption></figure>

With these creds we can login in MSSQL on the DC&#x20;

<figure><img src="/files/MopWEOgZ7impxAOsEyas" alt=""><figcaption></figcaption></figure>

We still cannot enable `xp_cmdshell`

Enumerating manually we can see a `prod`db with a `users` table

&#x20;And we get new credentials&#x20;

<figure><img src="/files/yyPIyf3ugZxvEZx64BOs" alt=""><figcaption></figcaption></figure>

I wanted to create a user list to spray passwords later

We can do that with CME&#x20;

<figure><img src="/files/8fclJdzX1k9nKnXsFIgs" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8LZMm6hME07xzTEkh4oU" alt=""><figcaption></figcaption></figure>

&#x20;Remove `Guest`and `krbtgt`and the list is complete

## Bloodhound abbie.smith

With these credentials we can run bloodhound

Clicking on `Shortest path from owned principals` we can see that Abbie has `Generic All` to `MS01`

<figure><img src="/files/BmAAhVj8OW1cHYW5eK4v" alt=""><figcaption></figcaption></figure>

This is the attack path that bloodhound suggests

<figure><img src="/files/MwGoXzIfzb9hHtagWdC2" alt=""><figcaption></figcaption></figure>

This won't work because the `MachineAccountQuota`for this user is 0

<figure><img src="/files/hVt9HUJFtiibRiSAnIg0" alt=""><figcaption></figcaption></figure>

Shadow Credentials was also advised from Bloodhound but it won't work because ADCS is not installed on the DC

With `Generic All` we can also read LAPS passwords, if enabled on the target

<figure><img src="/files/S7rlKz9Xjm4cgGAotElZ" alt=""><figcaption></figcaption></figure>

We got the password for the `MS01` Administrator account and we can dump the SAM&#x20;

<figure><img src="/files/nNZ6YG5sLy80Q1kMzZS7" alt=""><figcaption></figcaption></figure>

## Georgia.Price

After logging in with RDP i got a notification saying this

<figure><img src="/files/nAyuIlDcICz0HM9jeaiN" alt=""><figcaption></figcaption></figure>

So i looked at the scheduled tasks and found a task called `backup` that starts powershell and does an `ls`

<figure><img src="/files/KaJiKURhSYm1yMVVXCfg" alt=""><figcaption></figcaption></figure>

The interesting thing is that the task is ran by the user `Georgia.Price`

To get the user's password we can use mimikatz and use this command found in [Hacktricks](https://book.hacktricks.xyz/windows-hardening/stealing-credentials/credentials-mimikatz#vault)&#x20;

<figure><img src="/files/OnAiCq0YuiayaFl4ayER" alt=""><figcaption></figcaption></figure>

Now running bloodhound with `Georgia.Price`

<figure><img src="/files/6YkVQjUlF54vWCqxKHjm" alt=""><figcaption></figcaption></figure>

This user has `Generic All` to `WS01`

The machine account quota is still 0 but this time we have a machine account `MS01` that we dumped before

So we don't need to add a new account to abuse Resource-Based Constrained Delegation

## RBCD

First we check to see if delegation is enabled and if not we activate it for the machine account `MS01$`

<figure><img src="/files/aMMgYjCO1RuKhtdSDEZ6" alt=""><figcaption></figcaption></figure>

Now we request a service ticket to impersonate the Administrator user

<figure><img src="/files/pMCsUVYfOrY339HlDQlX" alt=""><figcaption></figcaption></figure>

Now we dump the SAM of `WS01` to find a plaintext password for `Rhys.Garner`

<figure><img src="/files/bny1K6691a0eEMNGQF4M" alt=""><figcaption></figcaption></figure>

To get the flag WinRM is not enabled because it's a workstation but psexec.py cannot also be used if Defender is on

So try `CME`, it takes its sweet time, or `atexec`

<figure><img src="/files/rLrPIud6c24GfDlRI7ex" alt=""><figcaption></figcaption></figure>

## Password spraying

I ran bloodhound again but nothing useful came up with this user

So i tried spraying the password

And it worked!

<figure><img src="/files/17uAaqAfaGObkRs3P30f" alt=""><figcaption></figcaption></figure>

P.S.

xct [Kali setup](https://github.com/xct/kali-clean) on top :fire:
