Detection rules › Sigma
Active Directory Forest PowerShell class called from a non administrative host
Detects scenarios where an attacker attempts to call the Active Directory Forest PowerShell class on a non administrative host in order to enumerate trusts, forests, domains, sites and subnet information.
Known false positives
- Adminitrative host, jump host, domain controllers, Exchange servers, application interacting with Active Directory modules
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Telemetry coverage
Rule body
title: Active Directory Forest PowerShell class called from a non administrative host
description: Detects scenarios where an attacker attempts to call the Active Directory Forest PowerShell class on a non administrative host in order to enumerate trusts, forests, domains, sites and subnet information.
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0007-Discovery/T1087-Account%20discovery
- https://podalirius.net/en/articles/active-directory-sites-and-subnets-enumeration/
- https://adsecurity.org/?p=192
- https://github.com/PyroTek3/PowerShell-AD-Recon/blob/master/Get-PSADForestInfo
- https://hochwald.net/powershell-retrieve-information-an-active-directory-forest/
tags:
- attack.discovery
- attack.t1482
author: mdecrevoisier
status: experimental
logsource:
product: windows
category:
- ps_module
- ps_classic_script
- ps_script
detection:
selection_powershell_native:
EventID: 800
EventData|contains: System.DirectoryServices.ActiveDirectory
selection_powershell_modern:
EventID: 4103
Payload|contains: System.DirectoryServices.ActiveDirectory
selection_powershell_block:
EventID: 4104
ScriptBlockText|contains: System.DirectoryServices.ActiveDirectory
filter:
- Computer: '%admin_workstation%'
- Computer: '%domain_controllers%'
condition: 1 of selection* and not filter
falsepositives:
- Adminitrative host, jump host, domain controllers, Exchange servers, application interacting with Active Directory modules
level: medium
Stages and Predicates
Stage 0: condition
1 of selection* and not filterStage 1: selection_powershell_native
selection_powershell_native:
EventID: 800
EventData|contains: System.DirectoryServices.ActiveDirectory
Stage 2: selection_powershell_modern
selection_powershell_modern:
EventID: 4103
Payload|contains: System.DirectoryServices.ActiveDirectory
Stage 3: selection_powershell_block
selection_powershell_block:
EventID: 4104
ScriptBlockText|contains: System.DirectoryServices.ActiveDirectory
Stage 4: not filter
filter:
- Computer: '%admin_workstation%'
- Computer: '%domain_controllers%'
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
Computer | eq | %admin_workstation% | excludes:Computer field:"Computer" value:"%admin_workstation%" |
Computer | eq | %domain_controllers% | excludes:Computer field:"Computer" value:"%domain_controllers%" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventData | match |
| field:"EventData" kind:match value:"System.DirectoryServices.ActiveDirectory" |
Payload | match |
| field:"Payload" kind:match value:"System.DirectoryServices.ActiveDirectory" |
ScriptBlockText | match |
| field:"ScriptBlockText" kind:match value:"System.DirectoryServices.ActiveDirectory" |