IncidentResponsev2

Gather AD Structure Information

Task Gather AD Structure Information

Conditions

Given a suspected compromised network segment(s), access to a system that can gather the structure of the suspected domain.

Operator Note: Enumerating Active Directory structure is essential during incident response to detect unexpected organizational units, rogue accounts, or misconfigured objects.

Standards

Operator Note: Use baseline domain structure documentation when available to detect unauthorized additions or changes.

End State

The structure of the domain is enumerated based on the specific sub-task accomplished and any anomalies on the domain will be identified.

Operator Note: Findings should be shared with the incident lead and mission partner domain administrators.

Manual Steps

Gather Current Domain Information

$adddomain = Get-ADDomain
$adddomain

Example output:

AllowedDNSSuffixes    : {}
ChildDomains          : {}
ComputersContainer    : CN=Computers,DC=team01,DC=tgt
--snipped--

Gather Domain Organizational Units (OUs)

Get-ADObject -Filter { ObjectClass -eq 'organizationalunit' } -Properties CanonicalName | Select-Object -Property CanonicalName

Example output:

CanonicalName
-------------
team01.tgt/Domain Controllers
team01.tgt/Microsoft Exchange Security Groups
team01.tgt/Groups
team01.tgt/Chula Vista
--snipped--

Operator Note: This command lists the hierarchy of Organizational Units. Unexpected or newly created OUs should be reviewed carefully.

Output

Output should follow naming convention format:

[mm/dd/yyyy_hh:mm:ss_AD_Structure_(xx.xx.xx.xx/x)]

Notify mission element lead and intelligence analyst of completion.

Running Script

.\2.14_GatherADStructureInfo.ps1

Example script output:

[+] Writing Active Directory structure to C:\Users\btadmin\Desktop\CyberSurfers\CyberSurfers_ACL_1593261366.22937.txt...
[+] Done!
cat .\CyberSurfers\CyberSurfers_ACL_1593261366.txt

Example contents:

[+] Domains infrastructure master: Team01-DC01.team01.tgt
[+] The Active Directory structure as follows:
DC=team01,DC=tgt
--> OU=Alameda
----> OU=Computers
----> OU=Groups
----> OU=Servers
----> OU=Users
--snipped--

Dependencies

Import-Module ActiveDirectory

Operator Note: RSAT tools must be installed on the analyst workstation or jump box. Windows Server and domain-joined systems typically include them.

Other available tools

dsquery ou -limit 0

References

Microsoft PowerShell AD Module Cmdlets
ADExplorer by Sysinternals
BloodHound AD Mapping


Operator Recommendations and Additional Tools

Operator Checklist

Tools by Platform

Platform Tool Purpose
Windows PowerShell + AD Module Primary enumeration tool
Windows ADExplorer (Sysinternals) Offline and advanced AD viewer
Universal BloodHound (optional) Advanced AD relationship and path analysis

Alternate Commands

Enumerate Domain Controllers:

Get-ADDomainController -Filter *

Enumerate AD Sites:

Get-ADReplicationSite -Filter *

Legacy dsquery:

dsquery ou -limit 0

Best Practices


Revision History

Date Version Description Author
2025-05-02 1.8 Full original + enriched AD enumeration tooling, procedures, and operator notes Leo