Detection rules › Splunk

Set Default PowerShell Execution Policy To Unrestricted or Bypass

Author
Steven Dick, Patrick Bareiss, Splunk
Source
upstream

The following analytic detects changes to the PowerShell ExecutionPolicy in the registry to "Unrestricted" or "Bypass." It leverages data from Endpoint Detection and Response (EDR) agents, focusing on registry modifications under the path Software\Microsoft\Powershell\1\ShellIds\Microsoft.PowerShell. This activity is significant because setting the ExecutionPolicy to these values can allow the execution of potentially malicious scripts without restriction. If confirmed malicious, this could enable an attacker to execute arbitrary code, leading to further compromise of the system and potential escalation of privileges.

MITRE ATT&CK coverage

TacticTechniques
ExecutionT1059.001 Command and Scripting Interpreter: PowerShell

Event coverage

ProviderEvent IDTitle
Sysmon13RegistryEvent (Value Set)

Stages and Predicates

Stage 1: tstats

tstats WHERE (Registry.registry_value_data="Bypass" OR Registry.registry_value_data="Unrestricted") Registry.registry_path="*Software\\\\Microsoft\\\\Powershell\\\\1\\\\ShellIds\\\\Microsoft.PowerShell*" Registry.registry_value_name="ExecutionPolicy" BY Registry.action, Registry.dest, Registry.process_guid, Registry.process_id, Registry.registry_hive, Registry.registry_path, Registry.registry_key_name, Registry.registry_value_data, Registry.registry_value_name, Registry.registry_value_type, Registry.status, Registry.user, Registry.vendor_product

Stage 2: search

search

Stage 3: search

search

Stage 4: search

search

Stage 5: search

search `macro`

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.

FieldKindValues
Registry.registry_patheq
  • *Software\\Microsoft\\Powershell\\1\\ShellIds\\Microsoft.PowerShell*
Registry.registry_value_dataeq
  • Bypass
  • Unrestricted
Registry.registry_value_nameeq
  • ExecutionPolicy