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.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery | T1482 Domain Trust Discovery |
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4103 | Payload Context: ContextInfo User Data: UserData. |
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
| PowerShell | Event ID 800 | Event ID 800 |
Rule body yaml
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
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
Computer | eq | %admin_workstation% |
Computer | eq | %domain_controllers% |
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
EventData | match |
|
Payload | match |
|
ScriptBlockText | match |
|