AJ-Labz
  • whoami
  • The Lab
    • Building the Lab
      • Physical Hardware
      • ESXi
        • Install ESXi without a keyboard
      • vCenter Server Installation
      • Configure vCenter Datacenter
      • Virtual Networking
      • Install Virtual Machine
      • Install Virtual Firewall
      • Increasing VM Harddrive size
    • Building the Windows Domain
    • Building a Local DNS Server
    • Installing Apache Guacamole
    • Installing WireGuard VPN
    • Industrial Control Systems (ICS)
  • Defensive Cyberz
  • Analytic Repo
    • Beacon Detection
  • Creating an SIEM
    • Installing Security Onion (SO)
    • Splunk
    • Getting the Windows Data You Need
  • Zeek || Bro
    • Bro/Zeek Script
    • Installing Protocol Analyzers
  • Offensive Cyberz
    • Cobalt Strike Red Team Cheat Sheet
    • Defense Evasion
      • Evading Defender with CobaltStrike
      • Disable AV
      • AMSI Bypass
      • Evade Heuristic Behaviors
        • Process Injection
        • Process Hollowing
        • Reflection
        • AppLocker Bypass
        • Powershell CLM Bypass
      • Linux Shellcode Encoders
    • AD Enumeration
      • AD Tools
      • PowerView
      • BloodHound
      • DAFT Commands
      • Enumeration Commands
    • AD Attack
      • Prompt for Credentials
      • LAPS Reader
      • Abusing ACLs
    • Command and Control
      • Covenant Framework
      • Simple HTTPS Server
    • Linux
      • Shells
      • Impacket
      • SSH
      • Kerberos Cache File
      • Ansible
      • Privilege Escalation
    • Phishing
      • LNK Script
    • Wireless Attacks
    • Create a Trojan
  • Cyber Readingz
    • Recommended Readings
Powered by GitBook
On this page

Was this helpful?

  1. Offensive Cyberz
  2. AD Enumeration

Enumeration Commands

ActiveDirectory Enumeration Notes

Get information about an AD group

Get-ADGroup -Identity "<GROUP NAME" -Properties *

View a user's current rights

whoami /priv

Check if RSAT installed

Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property Name, State

Install all RSAT tools

Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability –Online

LDAP query to return all AD groups

Get-ADObject -LDAPFilter '(objectClass=group)' | select cn

Find another disabled user (first.last).

Get-ADUser -LDAPFilter '(userAccountControl:1.2.840.113556.1.4.803:=2)' | select name

#OID REFERENCE https://ldapwiki.com/wiki/OID

Run a utility as another user

runas /netonly /user:DOMAIN\USERNAME powershell

Count all users in an OU

 Get-ADOrganizationalUnit -Filter 'Name -like "*"' | Format-Table Name, DistinguishedName -A

(Get-ADUser -SearchBase "OU=<OU>,DC=<DOMAIN>,DC=<DOMAIN>" -Filter *).count

Count all users in Domain

(Get-ADUser -Filter *).count

Count all computers in Domain

(Get-ADComputer -Filter *).count

Count all groups in Domain

(Get-ADGroup -Filter *).count

Query for installed software

get-ciminstance win32_product | fl

Get hostnames with the word "SQL" in their hostname; Change SQL for whatever hostname you're looking for

Get-ADComputer -Filter "DNSHostName -like 'SQL*'"

Get all administrative groups

Get-ADGroup -Filter "adminCount -eq 1" | select Name

Find admin users that don't require Kerberos Pre-Auth

Get-ADUser -Filter {adminCount -eq '1' -and DoesNotRequirePreAuth -eq 'True'}

Get SID for computer

Get-ADComputer -Filter {Name -like "<HOSTNAME>"} | Select Name,SID | fl

Enumerate UAC values for admin users

Get-ADUser -Filter {adminCount -gt 0} -Properties admincount,useraccountcontrol

Get AD groups using WMI

Get-WmiObject -Class win32_group -Filter "Domain='INLANEFREIGHT'"

Use ADSI to search for all computers

([adsisearcher]"(&(objectClass=Computer))").FindAll()

Find all trusted users or computers marked trusted for delegation

Get-ADUser -Properties * -LDAPFilter '(userAccountControl:1.2.840.113556.1.4.803:=524288)' | select Name,memberof, servicePrincipalName,TrustedForDelegation | fl

Get-ADComputer -Properties * -LDAPFilter '(userAccountControl:1.2.840.113556.1.4.803:=524288)' | select DistinguishedName,servicePrincipalName,TrustedForDelegation | fl

Find users with blank passwords

Get-AdUser -LDAPFilter '(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=32))(adminCount=1)' -Properties * | select name,memberof | fl

Recursive search of groups a user is apart of

Get-ADGroup -Filter 'member -RecursiveMatch "CN=<USER>,OU=<ORGANIZATIONAL UNIT>,DC=<DOMAIN>,DC=<DOMAIN>"' | select name

Get-ADGroup -LDAPFilter '(member:1.2.840.113556.1.4.1941:=CN=<USER>,OU=<ORGANIZATIONAL UNIT>,DC=<DOMAIN>,DC=<DOMAIN>)' |select Name

UserAccountControl Attributes

Get-ADUser -Filter {adminCount -gt 0} -Properties admincount,useraccountcontrol | select Name,useraccountcontrol

Password Not Required

Get-ADUser -Filter {PasswordNotRequired -eq $true}

Nested Groups

Get-ADGroup -filter * -Properties MemberOf | Where-Object {$_.MemberOf -ne $null} | Select-Object Name,MemberOf
PreviousDAFT CommandsNextAD Attack

Last updated 3 years ago

Was this helpful?

UAC Attributes