HackTheBox-windows-Sauna

admin 2022年10月1日21:02:35评论68 views字数 2869阅读9分33秒阅读模式

一个每日分享渗透小技巧的公众号HackTheBox-windows-Sauna



大家好,这里是 大余安全 的第 154 篇文章,本公众号会每日分享攻防渗透技术给大家。


靶机地址:https://www.hackthebox.eu/home/machines/profile/229

靶机难度:初级(4.3/10)

靶机发布日期:2020年4月29日

靶机描述:

Sauna is an easy difficulty Windows machine that features Active Directory enumeration and exploitation. Possible usernames can be derived from employee full names listed on the website. With these usernames, an ASREPRoasting attack can be performed, which results in hash for an account that doesn't require Kerberos pre-authentication. This hash can be subjected to an offline brute force attack, in order to recover the plaintext password for a user that is able to WinRM to the box. Running WinPEAS reveals that another system user has been configured to automatically login and it identifies their password. This second user also has Windows remote management permissions. BloodHound reveals that this user has the DS-Replication-Get-ChangesAll extended right, which allows them to dump password hashes from the Domain Controller in a DCSync attack. Executing this attack returns the hash of the primary domain administrator, which can be used with Impacket's psexec.py in order to gain a shell on the box as NT_AUTHORITYSYSTEM .


请注意:对于所有这些计算机,我是通过平台授权允许情况进行渗透的。我将使用Kali Linux作为解决该HTB的攻击者机器。这里使用的技术仅用于学习教育目的,如果列出的技术用于其他任何目标,我概不负责。




一、信息收集

HackTheBox-windows-Sauna
HackTheBox-windows-Sauna


HackTheBox-windows-Sauna

可以看到靶机的IP是10.10.10.175...

HackTheBox-windows-Sauna

nmap扫描输出显示靶机是egotistical-bank.local的域控制器,Internet信息服务(IIS)和LDAP在它们各自的默认端口(80和389)上,开始枚举看看...

HackTheBox-windows-Sauna

访问80端口发现这是Egotistical银行的一种广告页面...

HackTheBox-windows-Sauna

往下翻发现了该页面包含员工团队页面,这里可以枚举很多用户名信息...

HackTheBox-windows-Sauna

我枚举了这些用户名出来...

HackTheBox-windows-Sauna

这里利用Impacket的GetNPUser进行 ASREP的攻击提取到了哈希值....

简单的脚本利用GetNPUser.py....

HackTheBox-windows-Sauna

利用john爆破了哈希值,获得了密码信息...

HackTheBox-windows-Sauna

利用winrm直接登录...获得了user_flag信息...

这里很顺利,前面很多端口都是个小坑,直接利用了enum4linux,ldapsearch,rpcclient枚举了没任何信息...

HackTheBox-windows-Sauna

直接上传winPEAS进行win靶机枚举...没有的自行google下载...

HackTheBox-windows-Sauna

枚举到了svc_loanmgr用户信息....

HackTheBox-windows-Sauna

利用winrm登录了svc用户,查看发现该用户密码是永久有效的....

HackTheBox-windows-Sauna

由于nmap发现了域,而且存在多个用户情况下,我直接利用bloodhound进行了域枚举查看...

首先根据图先`sudo apt install bloodhound`下载,然后运行`bloodhound`,`sudo neo4j console`在运行启动web版,主要用于修改密码...

HackTheBox-windows-Sauna

登录web版本提示用新密码后修改即可...

HackTheBox-windows-Sauna

回到程序刷新下,登录修改好的密码即可...

HackTheBox-windows-Sauna

wget https://github.com/BloodHoundAD/BloodHound/raw/master/Ingestors/SharpHound.exe

下载SharpHound.exe集成域所有信息...包含策略啊什么的,也有弱项参考...上传执行即可...

HackTheBox-windows-Sauna

将生成的域信息包丢入bloodhound即可...

然后把svc用户列出...

HackTheBox-windows-Sauna

把目前知道的fsmith用户也列出...

HackTheBox-windows-Sauna

选择Find Principals with DCSync Rights,查看到最短路径,查看help发现了此边缘不授予执行攻击的能力,但结合DS-Replication-Get-Changes-All,委托人可能会执行DCSync攻击...

HackTheBox-windows-Sauna

继续查看Abuse Info发现在BloodHound中同时具有GetChanges和GetChangesAll特权,可以使用mimikatz进行dcsync攻击以获取任意主体的密码哈希,或者还可以执行更复杂的ExtraSids攻击来跳跃域信任,还推荐了hamj0y博客自行查询等方案...非常好...

这里我没有在win上进行渗透靶机,所以mimikatz我就不进行操作了...知道此方法即可...

HackTheBox-windows-Sauna

/usr/bin/impacket-secretsdump svc_loanmgr@10.10.10.175

针对DCSync的攻击,还可以利用Impacket的secretsdump.py执行此攻击,该脚本将使用复制特权显示所有域用户的NTLM哈希值...

执行命令后,发现了转储主域管理员的密码哈希,非常好...

HackTheBox-windows-Sauna

利用发现的密码hash,直接winrm登录进入administrator用户中...并获得了root_flag信息....


该靶机很简单,把win渗透的一些端口使用的脚本和工具,熟悉工具的原理,输出产生的信息学会分析,即可简单拿下该靶机!!加油~~

坚持!!


由于我们已经成功得到root权限查看user和root.txt,因此完成这台初级的靶机,希望你们喜欢这台机器,请继续关注大余后期会有更多具有挑战性的机器,一起练习学习。


如果你有其他的方法,欢迎留言。要是有写错了的地方,请你一定要告诉我。要是你觉得这篇博客写的还不错,欢迎分享给身边的人。


如果觉得这篇文章对你有帮助,可以转发到朋友圈,谢谢小伙伴~

HackTheBox-windows-Sauna
HackTheBox-windows-Sauna


HackTheBox-windows-Sauna


随缘收徒中~~随缘收徒中~~随缘收徒中~~


欢迎加入渗透学习交流群,想入群的小伙伴们加我微信,共同进步共同成长!

HackTheBox-windows-Sauna

大余安全

一个全栈渗透小技巧的公众号

HackTheBox-windows-Sauna





原文始发于微信公众号(大余安全):HackTheBox-windows-Sauna

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年10月1日21:02:35
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   HackTheBox-windows-Saunahttp://cn-sec.com/archives/590471.html

发表评论

匿名网友 填写信息