HTB Forest
Hack the box notes
LDAP 389/TCP - ldapsearch
LDAP normally provides verbose information about the AD. And if anonymous bind is allowed, we can query many of good AD information, such as user information.
Anonymous (NULL) Bind
# ldapsearch null bind
(-x ) simple (anonymous) authentication, otherwise MD5
(-s ) scope
(-b ) basedn .. base domain name
ldapsearch -H ldap://10.129.95.210 -x -s base
ldapsearch -H ldap://10.129.95.210:389 -x -b "dc=htb,dc=local"
# Account policy
[+] Password Info for Domain: HTB
[+] Minimum password length: 7
[+] Account Lockout Threshold: None
# Accounts enumeration
ldapsearch -H ldap://10.129.95.210:389 -x -b DC=htb,DC=local "(objectClass=person)" | grep "sAMAccountName:"
...
sAMAccountName: sebastien
sAMAccountName: lucinda
sAMAccountName: andy
sAMAccountName: mark
sAMAccountName: santiRemote Management Users
Windapsearch
Kerberos - 88/TCP
kerbrute
Brute force and enumerate valid AAD accounts with kerbrute
Kerberoasting
Identify Kerboros Service Principal Names (SPN) tight to the account using Impacket's GetSPN
Hashcat - Cracking Kerberos ticket
Johne The Ripper - Cracking Kerberos ticket

Crackmapexec - Test login to account

WinRM
WinRM (5985/TCP) — Microsoft implementation of WS-Management protocol. This can allow a remote connection via PowerShell.
Look for remote management user group



Evil-WinRM


Abusing privileges of "Account Operators" see bellow in BloodHound inspection we continue with the privilege escalation by adding new user using DSYNC attack.
DSYNC Attack thhrough - Exchange Trusted Subsystem group
Create domain account

Impacket NTLM Relay
Impacket’s ntlmrelayx.py performs NTLM Relay Attacks, creating an SMB and HTTP server and relaying credentials to various different protocols (SMB, HTTP, LDAP, etc.).
DSYNC attack - Dump Administrator LM/NT hash
PSEXEC - Login as administrator using hash

EOF The following BloodHound analysis....
BloodHound Kali - igestor based on impacket
Python based igestor based on impackets

BloodHound and Neo4j
Initial setup
Start neo4j console and visit first http://localhost:7474 password wizard


Start

Import data (upload icon)

Set alfresco as owned

Click on alfresco and chose "Unrolled membership"

We can see the user is part of "Account Operators" group. Members of this group can create and modify most types of accounts.
Go back to DSYNC attack.
Last updated
Was this helpful?
