Try in Splunk Security Cloud

Description

This detection is to identify the abuse the Windows SC.exe to execute malicious commands or payloads via PowerShell.

  • Type: TTP
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
  • Datamodel: Endpoint
  • Last Updated: 2021-04-07
  • Author: Ryan Becwar
  • ID: 8e204dfd-cae0-4ea8-a61d-e972a1ff2ff8

ATT&CK

ID Technique Tactic
T1569 System Services Execution
T1569.002 Service Execution Execution
 `wineventlog_system` EventCode=7045 
| eval l_Service_File_Name=lower(Service_File_Name) 
| regex l_Service_File_Name="powershell[.\s]
|powershell_ise[.\s]
|pwsh[.\s]
|psexec[.\s]" 
| regex l_Service_File_Name="-nop[rofile\s]+
|-w[indowstyle]*\s+hid[den]*
|-noe[xit\s]+
|-enc[odedcommand\s]+" 
| stats count min(_time) as firstTime max(_time) as lastTime by EventCode Service_File_Name Service_Name Service_Start_Type Service_Type Service_Account user 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `malicious_powershell_executed_as_a_service_filter`

Associated Analytic Story

How To Implement

To successfully implement this search, you need to be ingesting Windows System logs with the Service name, Service File Name Service Start type, and Service Type from your endpoints.

Required field

  • EventCode
  • Service_File_Name
  • Service_Type
  • _time
  • Service_Name
  • Service_Start_Type
  • Service_Account
  • user

Kill Chain Phase

  • Privilege Escalation

Known False Positives

Creating a hidden powershell service is rare and could key off of those instances.

RBA

Risk Score Impact Confidence Message
72.0 90 80 Identifies the abuse the Windows SC.exe to execute malicious powerShell as a service $Service_File_Name$ by $user$ on $dest$

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