Try in Splunk Security Cloud


This analytic utilizes PowerShell Script Block Logging (EventCode 4104) to identify the use of Enable-PSRemoting cmdlet. This cmdlet allows users to enable PowerShell remoting on a local or remote computer, which allows other computers to run commands on the target computer. The ability to remotely execute commands can be abused by attackers to take control of compromised systems and pivot to other systems on the network. By detecting the use of Enable-PSRemoting cmdlet via script block logging, this analytic can help organizations identify potential malicious activity related to attackers attempting to gain remote control of compromised systems.

  • Type: Anomaly
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2023-03-22
  • Author: Michael Haag, Splunk
  • ID: 40e3b299-19a5-4460-96e9-e1467f714f8e




ID Technique Tactic
T1059.001 PowerShell Execution
T1059 Command and Scripting Interpreter Execution
Kill Chain Phase
  • Installation
  • DE.AE
  • CIS 10
`powershell` EventCode=4104 ScriptBlockText="*Enable-PSRemoting*" 
| stats count min(_time) as firstTime max(_time) as lastTime by Computer EventCode ScriptBlockText 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)`
| `powershell_enable_powershell_remoting_filter`


The SPL above uses the following Macros:

:information_source: powershell_enable_powershell_remoting_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
  • Computer

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

Known False Positives

Note that false positives may occur due to the use of the Enable-PSRemoting cmdlet by legitimate users, such as system administrators. It is recommended to apply appropriate filters as needed to minimize the number of false positives.

Associated Analytic Story


Risk Score Impact Confidence Message
25.0 50 50 PowerShell was identified running a Invoke-PSremoting on $Computer$.

: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.


Test Dataset

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

source | version: 1