ReDelegate

Anonymous FTP leaked a KeePass DB → cracked with custom wordlist → SQLGuest creds → MSSQL SID enum → password spray → ACL abuse → Constrained Delegation → DC pwned.

Platform: VulnLab Difficulty: Medium OS: Windows Server 2022 Domain: redelegate.vl DC IP: 10.129.234.50


1. Reconnaissance

An initial Nmap scan against the target reveals a typical Windows Domain Controller profile:

SMB null authentication is accepted (Null Auth: True), but share enumeration and RID brute-forcing are both blocked with STATUS_ACCESS_DENIED, so SMB alone doesn't give us much. FTP anonymous access, however, is wide open.


2. Anonymous FTP Enumeration

Logging in anonymously to FTP reveals three files:

CyberAudit.txt

Key Takeaway: ACLs are flagged as dangerous and still being remediated — a strong signal of exploitable misconfigurations.

TrainingAgenda.txt

Key Takeaway: The training content leaks the password pattern employees were warned against — SeasonYear! (e.g. Fall2024!, Summer2024!). This is the password format to target.


3. KeePass Password Cracking

Shared.kdbx is a KeePass database. We extract its hash and crack it using a custom wordlist built from the SeasonYear! pattern:

Extract hash

Build custom wordlist

Crack with Hashcat (mode 13400 — KeePass KDBX v2/v3)

Result: Fall2024! — cracked instantly.

KeePass Contents

Opening the database reveals stored credentials:

Title
Username
Password

FTP

FTPUser

SguPZBKdRyxWzvXRWy6U

FS01 Admin

Administrator

Spdv41gg4BlBgSYIW1gF

WEB01

WordPress Panel

cn4KOEgsHqvKXPjEnSD9

SQL Guest Access

SQLGuest

zDPBpaF4FywlqIv11vii

Timesheet Manager

Timesheet

hMFS4I0Kj8Rcd62vqi5X

Payroll App

Payroll

cVkqz4bCM7kJRSNlgx2G

SMB and LDAP authentication fail for all entries. However, MSSQL (port 1433) is open and not shown by the default Nmap scan — a full port scan (-p-) is needed to find it.


4. MSSQL Access & Domain User Enumeration

Connecting as SQLGuest to the MSSQL instance:

RID Brute-Force via SID Resolution

SQL Server's SUSER_SNAME() function can resolve SIDs to usernames. By manipulating the RID component of the domain SID, we can enumerate domain accounts:

First, retrieve the domain SID from a known account:

The domain SID is: 010500000000000515000000a185deefb22433798d8e847a The last 4 bytes are the RID (little-endian). Administrator = RID 0x1F4 = 500.

Generate bulk queries for RIDs 1000–1500:


5. Password Spraying

Using the cracked KeePass password Fall2024! against all discovered users:

Result: Marie.Curie:Fall2024! — valid credentials.

Note: Mallory.Roberts returns STATUS_ACCOUNT_RESTRICTION rather than STATUS_LOGON_FAILURE — suggesting her account may have valid credentials but a logon restriction (e.g. no interactive logon, disabled, workstation restriction).


6. ACL Abuse — ForceChangePassword

BloodHound Analysis

BloodHound reveals the following ACL chain:

Marie.Curie is a member of the Helpdesk group, which has ForceChangePassword rights over Helen.Frost. This allows us to set her password without knowing the current one.

Exploit

WinRM Access

User flag obtained.


7. BloodHound Analysis

The full attack path from Helen.Frost continues:

IT has GenericAll over FS01$, giving full control over that computer object. This means we can:

  1. Reset FS01$'s password

  2. Configure msDS-AllowedToDelegateTo (constrained delegation target)

  3. Set TrustedToAuthForDelegation (Protocol Transition / S4U2Self)


8. Constrained Delegation Setup via GenericAll on FS01$

As Helen.Frost (member of IT group with GenericAll over FS01$):

Step 1 — Reset FS01$ computer account password

Step 2 — Configure Constrained Delegation target

Step 3 — Enable Protocol Transition (S4U2Self)

Verify

FS01$ is now configured for constrained delegation with protocol transition to cifs/DC.redelegate.vl.


9. S4U2Self / S4U2Proxy — Impersonating a Domain Admin

Choosing the right impersonation target

Initial attempts to impersonate Administrator failed with KDC_ERR_BADOPTION. This means the Administrator account is flagged as "Account is sensitive and cannot be delegated" in Active Directory.

By enumerating other Domain Admins, Ryan.Cooper was found to lack this protection, making him a valid impersonation target.

Step 1 — Get a TGT for FS01$

Step 2 — S4U2Self + S4U2Proxy to get a service ticket as Ryan.Cooper

Explanation:

  • S4U2Self: FS01$ requests a service ticket to itself on behalf of Ryan.Cooper (protocol transition — no password needed for Ryan.Cooper)

  • S4U2Proxy: FS01$ uses that ticket to request a forwarded service ticket for cifs/DC.redelegate.vl on behalf of Ryan.Cooper

Step 3 — Access DC as Ryan.Cooper (Domain Admin+Root Flag)


10. Attack Chain Summary

Key Vulnerabilities Exploited

Vulnerability
Impact

Anonymous FTP with sensitive files

Initial foothold / credentials

Weak password policy (SeasonYear!)

KeePass + domain account access

Guest MSSQL access with SID enumeration

Domain user enumeration

Password reuse (Fall2024!)

Valid domain credentials

ForceChangePassword ACL (Helpdesk → Helen.Frost)

Lateral movement

GenericAll ACL (IT → FS01$)

Computer object takeover

Constrained Delegation + Protocol Transition (S4U2Proxy)

Domain Admin impersonation

Ryan.Cooper not marked "sensitive, cannot be delegated"

Delegation bypass

Last updated