name: Malicious PowerShell Process - Execution Policy Bypass
id: 9be56c82-b1cc-4318-87eb-d138afaaca39
version: 4
date: '2020-07-21'
author: Rico Valdez, Splunk
type: batch
datamodel:
- Endpoint
description: This search looks for PowerShell processes started with parameters used
  to bypass the local execution policy for scripts. These parameters are often observed
  in attacks leveraging PowerShell scripts as they override the default PowerShell
  execution policy.
search: '| tstats `security_content_summariesonly` values(Processes.process_id) as
  process_id, values(Processes.parent_process_id) as parent_process_id values(Processes.process)
  as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes
  where Processes.process_name=powershell.exe (Processes.process="* -ex*" OR Processes.process="*
  bypass *") by Processes.process_id, Processes.user, Processes.dest | `drop_dm_object_name(Processes)`
  | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `malicious_powershell_process___execution_policy_bypass_filter`'
how_to_implement: You must be ingesting data that records process activity from your
  hosts to populate the Endpoint data model in the Processes node. You must also be
  ingesting logs with both the process name and command line from your endpoints.
  The command-line arguments are mapped to the "process" field in the Endpoint data
  model.
known_false_positives: There may be legitimate reasons to bypass the PowerShell execution
  policy. The PowerShell script being run with this parameter should be validated
  to ensure that it is legitimate.
references: []
tags:
  analytic_story:
  - DHS Report TA18-074A
  - HAFNIUM Group
  asset_type: Endpoint
  automated_detection_testing: passed
  cis20:
  - CIS 3
  - CIS 7
  - CIS 8
  dataset:
  - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1059.001/encoded_powershell/windows-sysmon.log
  kill_chain_phases:
  - Command and Control
  - Actions on Objectives
  mitre_attack_id:
  - T1059.001
  nist:
  - PR.PT
  - DE.CM
  - PR.IP
  product:
  - Splunk Enterprise
  - Splunk Enterprise Security
  - Splunk Cloud
  required_fields:
  - _time
  - Processes.process_id
  - Processes.parent_process_id
  - Processes.process
  - Processes.process_name
  - Processes.user
  - Processes.dest
  security_domain: endpoint
