Windows Service Created Within Public Path
Description
The following analytc uses Windows Event Id 7045, New Service Was Installed
, to identify the creation of a Windows Service where the service binary path is located in public paths. This behavior could represent the installation of a malicious service. Red Teams and adversaries alike may create malicious Services for lateral movement or remote code execution
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2021-11-22
- Author: Mauricio Velazco, Splunk
- ID: 3abb2eda-4bb8-11ec-9ae4-3e22fbd008af
Annotations
ATT&CK
Kill Chain Phase
- Installation
- Exploitation
NIST
- DE.CM
CIS20
- CIS 10
CVE
Search
1
2
3
4
5
`wineventlog_system` EventCode=7045 Service_File_Name = "*\.exe" NOT (Service_File_Name IN ("C:\\Windows\\*", "C:\\Program File*", "C:\\Programdata\\*", "%systemroot%\\*"))
| stats count min(_time) as firstTime max(_time) as lastTime by ComputerName EventCode Service_File_Name Service_Name Service_Start_Type Service_Type
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `windows_service_created_within_public_path_filter`
Macros
The SPL above uses the following Macros:
windows_service_created_within_public_path_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.
- EventCode
- Service_File_Name
- Service_Type
- _time
- Service_Name
- Service_Start_Type
How To Implement
To successfully implement this search, you need to be ingesting logs with the Service name, Service File Name Service Start type, and Service Type from your endpoints.
Known False Positives
Legitimate applications may install services with uncommon services paths.
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
54.0 | 90 | 60 | A Windows Service $Service_File_Name$ with a public path was created on $ComputerName |
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
- https://docs.microsoft.com/en-us/windows/win32/services/service-control-manager
- https://pentestlab.blog/2020/07/21/lateral-movement-services/
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