Monteverde

Recon

chevron-rightnmap_scan.loghashtag
Open 10.129.228.111:53
Open 10.129.228.111:88
Open 10.129.228.111:135
Open 10.129.228.111:139
Open 10.129.228.111:389
Open 10.129.228.111:445
Open 10.129.228.111:464
Open 10.129.228.111:593
Open 10.129.228.111:3269
Open 10.129.228.111:3268
Open 10.129.228.111:5985
Open 10.129.228.111:9389
Open 10.129.228.111:49667
Open 10.129.228.111:49700
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} {{ip}} -vvv -sV -sC -Pn" on ip 10.129.228.111

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2024-12-04 18:48:34Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: MEGABANK.LOCAL0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: MEGABANK.LOCAL0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49700/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: MONTEVERDE; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2024-12-04T18:49:26
|_  start_date: N/A
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 59714/tcp): CLEAN (Timeout)
|   Check 2 (port 34394/tcp): CLEAN (Timeout)
|   Check 3 (port 29693/udp): CLEAN (Timeout)
|   Check 4 (port 62380/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
|_clock-skew: 0s
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required

LDAP

We can login in SMB with NULL session, but no access to any resources or actions. We can enumerate LDAP:

└─$ netexec ldap 10.129.228.111 -u '' -p '' --users | tee ldap_users.txt
SMB                      10.129.228.111  445    MONTEVERDE       [*] Windows 10 / Server 2019 Build 17763 x64 (name:MONTEVERDE) (domain:MEGABANK.LOCAL) (signing:True) (SMBv1:False)
LDAP                     10.129.228.111  389    MONTEVERDE       [+] MEGABANK.LOCAL\:
LDAP                     10.129.228.111  389    MONTEVERDE       [*] Total records returned: 270
...Too much garbage...
└─$ enum4linux-ng megabank.local | tee enum4linux.log
ENUM4LINUX - next generation (v1.3.4)

 ==========================
|    Target Information    |
 ==========================
[*] Target ........... megabank.local
[*] Username ......... ''
[*] Random Username .. 'kapyieei'
[*] Password ......... ''
[*] Timeout .......... 5 second(s)

 =======================================
|    Listener Scan on megabank.local    |
 =======================================
[*] Checking LDAP
[+] LDAP is accessible on 389/tcp
[*] Checking LDAPS
[+] LDAPS is accessible on 636/tcp
[*] Checking SMB
[+] SMB is accessible on 445/tcp
[*] Checking SMB over NetBIOS
[+] SMB over NetBIOS is accessible on 139/tcp

 ======================================================
|    Domain Information via LDAP for megabank.local    |
 ======================================================
[*] Trying LDAP
[+] Appears to be root/parent DC
[+] Long domain name is: MEGABANK.LOCAL

 ===========================================
|    SMB Dialect Check on megabank.local    |
 ===========================================
[*] Trying on 445/tcp
[+] Supported dialects and settings:
Supported dialects:
  SMB 1.0: false
  SMB 2.02: true
  SMB 2.1: true
  SMB 3.0: true
  SMB 3.1.1: true
Preferred dialect: SMB 3.0
SMB1 only: false
SMB signing required: true

 =============================================================
|    Domain Information via SMB session for megabank.local    |
 =============================================================
[*] Enumerating via unauthenticated SMB session on 445/tcp
[+] Found domain information via SMB
NetBIOS computer name: MONTEVERDE
NetBIOS domain name: MEGABANK
DNS domain: MEGABANK.LOCAL
FQDN: MONTEVERDE.MEGABANK.LOCAL
Derived membership: domain member
Derived domain: MEGABANK

 ===========================================
|    RPC Session Check on megabank.local    |
 ===========================================
[*] Check for null session
[+] Server allows session using username '', password ''
[*] Check for random user
[-] Could not establish random user session: STATUS_LOGON_FAILURE

 =====================================================
|    Domain Information via RPC for megabank.local    |
 =====================================================
[+] Domain: MEGABANK
[+] Domain SID: S-1-5-21-391775091-850290835-3566037492
[+] Membership: domain member

 =================================================
|    OS Information via RPC for megabank.local    |
 =================================================
[*] Enumerating via unauthenticated SMB session on 445/tcp
[+] Found OS information via SMB
[*] Enumerating via 'srvinfo'
[-] Could not get OS info via 'srvinfo': STATUS_ACCESS_DENIED
[+] After merging OS information we have the following result:
OS: Windows 10, Windows Server 2019, Windows Server 2016
OS version: '10.0'
OS release: '1809'
OS build: '17763'
Native OS: not supported
Native LAN manager: not supported
Platform id: null
Server type: null
Server type string: null

 =======================================
|    Users via RPC on megabank.local    |
 =======================================
[*] Enumerating users via 'querydispinfo'
[+] Found 10 user(s) via 'querydispinfo'
[*] Enumerating users via 'enumdomusers'
[+] Found 10 user(s) via 'enumdomusers'
[+] After merging user results we have 10 user(s) total:
'1104':
  username: AAD_987d7f2f57d2
  name: AAD_987d7f2f57d2
  acb: '0x00000210'
  description: Service account for the Synchronization Service with installation identifier 05c97990-7587-4a3d-b312-309adfc172d9 running on computer MONTEVERDE.
'1601':
  username: mhope
  name: Mike Hope
  acb: '0x00000210'
  description: (null)
'2602':
  username: SABatchJobs
  name: SABatchJobs
  acb: '0x00000210'
  description: (null)
'2603':
  username: svc-ata
  name: svc-ata
  acb: '0x00000210'
  description: (null)
'2604':
  username: svc-bexec
  name: svc-bexec
  acb: '0x00000210'
  description: (null)
'2605':
  username: svc-netapp
  name: svc-netapp
  acb: '0x00000210'
  description: (null)
'2613':
  username: dgalanos
  name: Dimitris Galanos
  acb: '0x00000210'
  description: (null)
'2614':
  username: roleary
  name: Ray O'Leary         '#
  acb: '0x00000210'
  description: (null)
'2615':
  username: smorgan
  name: Sally Morgan
  acb: '0x00000210'
  description: (null)
'501':
  username: Guest
  name: (null)
  acb: '0x00000215'
  description: Built-in account for guest access to the computer/domain


Completed after 23.82 seconds

Get valid usernames

There's ADSync stuff and AAD_hex which probably is Connect Agent? Synchronizing the AD with AAD.

We could start bruteforcing password with rockyou or something, but first let's check if someone is using username as password

SMB

WinRM

User.txt

Privilege Escalation

We are part of Azure Admins -> Google: Azure Admins Connect Agent Priv Esc -> https://github.com/Cloud-Architekt/AzureAD-Attack-Defense/blob/main/AADCSyncServiceAccount.mdarrow-up-right

The approaches listed above need Python and second one needs whole Module to make it work, and that's too much!

Azure AD Connect for Red Teamersarrow-up-right

It needs connection string and this account has access to server. https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/MSSQL%20Injection.md#mssql-enumerationarrow-up-right

We can run the script in blog with Windows Authentication:

Root.txt

Last updated