AD

AD Reconnaissance

Returns user on the machine

net user

Show the current user

whoami

Show the current group

whoami /groups

Show users from any group

net user /domain

Shows every user's group

net user [username] /domain

Powershell cmd to get all properties of a certain user

Get-ADUser -filter {name -like "sys.varonis.sql*"} -Properties *

Build LDAP filter to look for users with SPN values registered for current domain

$ldapFilter = "(&(objectClass=user)(objectCategory=user)(servicePrincipalName=*))"
$domain = New-Object System.DirectoryServices.DirectoryEntry
$search = New-Object System.DirectoryServices.DirectorySearcher
$search.SearchRoot = $domain
$search.PageSize = 1000
$search.Filter = $ldapFilter
$search.SearchScope = "Subtree"
$results = $search.FindAll()
$Results = foreach ($result in $results) {
    $result_entry = $result.GetDirectoryEntry()
    $result_entry | Select-Object @{ Name = "Username"; Expression = { $_.sAMAccountName }}, @{ Name = "SPN"; Expression = { $_.servicePrincipalName | Select-Object -First 1 }}
}
$Results

Domain Discovery

Kerberos Reconnaissance - PRE-Auth

Bruteforce for valid usernames in the pre-auth process of a DC

Bruteforce passwords for a specific user


AS-REP Roasting

Identify users that have Kerberos preauthentication disabled

Rubeus on Windows

Harvest TGT every 30 seconds

Perform a password spray against all found users

Perform Kerberoasting

Crack AS-REP hashes with hashcat

Mimikatz Commands

Ensure administrator privileges

Elevate privileges to system

Dump NTLM hashes

Pass the hash

Metasploit Commands

Dump all hashes and crack them with hashcat

Export all .kirbi tickets

Perform pass the ticket attack

Verify impersonated ticket

Dump the hash of the service account "krbtgt"

Get list of all users from ldap

Get SPN from metasploit

Golden and Silver Tickets

Request a golden ticket

Open a new elevated command prompt with the given ticket

Maintain access with a skeleton key


DCSync

Extract hashes stored in NTDS.DIT


Kerberoasting from Linux

Get TGT from domain after password compromise

Request a TGS ticket and crack it with hashcat


Crackmapexec Commands

Extract LSA hashes

Extract NTDS database

Extract SAM database

Perform Kerberoasting


Hashcat hash cracking

Crack NTLM hashes

Crack Kerberos hashes

Crack AS-REP Roasting accounts


John the Ripper hash cracking

Crack NTLM hashes with John


Powershell Commands

Identify users with Kerberos preauthentication disabled

Run Invoke-Kerberoast with PowerShell

This one-liner instructs PowerShell to relaunch with the ExecutionPolicy set to bypass, enabling untrusted scripts to be run. It downloads the Invoke-Kerberoast.ps1 script, runs it in RAM, and outputs the results ready to crack using hashcat.

Nmap for smb

Mimikatz Commands

Hash Extraction and Ticket Management

Active Directory Reconnaissance

Domain Discovery Commands

Metasploit and Kerberoasting

Kerberoasting from Linux

Kerberoasting from Windows

CrackMapExec Commands

Powershell Command

Last updated