Try in Splunk Security Cloud

Description

The following analytic detects the enabling of PowerShell Web Access via PowerShell commands. It leverages PowerShell script block logging (EventCode 4104) to identify the execution of the Install-WindowsFeature cmdlet with the WindowsPowerShellWebAccess parameter. This activity is significant because enabling PowerShell Web Access can facilitate remote execution of PowerShell commands, potentially allowing an attacker to gain unauthorized access to systems and networks.

  • Type: TTP
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
  • Datamodel: Web
  • Last Updated: 2024-09-03
  • Author: Michael Haag, Splunk
  • ID: 175bb2de-6227-416b-9678-9b61999cd21f

Annotations

ATT&CK

ATT&CK

ID Technique Tactic
T1059.001 PowerShell Execution
Kill Chain Phase
  • Installation
NIST
  • DE.CM
CIS20
  • CIS 10
CVE
1
2
3
4
5
6
`powershell` EventCode=4104 ScriptBlockText IN ("*Install-WindowsFeature*WindowsPowerShellWebAccess*","*Install-PswaWebApplication*","*Add-PswaAuthorizationRule*UserName *ComputerName *") 
| rename Computer as dest 
| stats count min(_time) as firstTime max(_time) as lastTime by EventCode ScriptBlockText dest UserID 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_enable_powershell_web_access_filter`

Macros

The SPL above uses the following Macros:

:information_source: windows_enable_powershell_web_access_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • _time
  • EventCode
  • ScriptBlockText
  • dest
  • UserID

How To Implement

To successfully implement this analytic, you will need to enable PowerShell Script Block Logging on some or all endpoints. Additional setup here https://docs.splunk.com/Documentation/UBA/5.0.4.1/GetDataIn/AddPowerShell#Configure_module_logging_for_PowerShell.

Known False Positives

It is possible that legitimate scripts or network administrators may enable PowerShell Web Access. Monitor and escalate as needed.

Associated Analytic Story

RBA

Risk Score Impact Confidence Message
72.0 90 80 PowerShell Web Access has been enabled on $dest$.

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

Reference

Test Dataset

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range

source | version: 1