Detection: First Time Seen Running Windows Service

EXPERIMENTAL DETECTION

This detection status is set to experimental. The Splunk Threat Research team has not yet fully tested, simulated, or built comprehensive datasets for this detection. As such, this analytic is not officially supported. If you have any questions or concerns, please reach out to us at research@splunk.com.

Description

The following analytic detects the first occurrence of a Windows service running in your environment. It leverages Windows system event logs, specifically EventCode 7036, to identify services entering the "running" state. This activity is significant because the appearance of a new or previously unseen service could indicate the installation of unauthorized or malicious software. If confirmed malicious, this activity could allow an attacker to execute arbitrary code, maintain persistence, or escalate privileges within the environment. Monitoring for new services helps in early detection of potential threats.

1`wineventlog_system` EventCode=7036 
2| rex field=Message "The (?<service>[-\(\)\s\w]+) service entered the (?<state>\w+) state" 
3| where state="running" 
4| lookup previously_seen_running_windows_services service as service OUTPUT firstTimeSeen 
5| where isnull(firstTimeSeen) OR firstTimeSeen > relative_time(now(), `previously_seen_windows_services_window`) 
6| table _time dest service 
7| `first_time_seen_running_windows_service_filter`

Data Source

Name Platform Sourcetype Source Supported App
Windows Event Log System 7036 Windows icon Windows 'xmlwineventlog' 'XmlWinEventLog:System' N/A

Macros Used

Name Value
previously_seen_windows_services_window "-70m@m"
first_time_seen_running_windows_service_filter search *
first_time_seen_running_windows_service_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1569 System Services Execution
T1569.002 Service Execution Execution
KillChainPhase.INSTALLATION
NistCategory.DE_AE
Cis18Value.CIS_10
TeamTNT
APT32
APT38
APT39
APT41
Blue Mockingbird
Chimera
FIN6
Ke3chang
Silence
Wizard Spider

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event True
This configuration file applies to all detections of type anomaly. These detections will use Risk Based Alerting.

Implementation

While this search does not require you to adhere to Splunk CIM, you must be ingesting your Windows system event logs in order for this search to execute successfully. You should run the baseline search Previously Seen Running Windows Services - Initial to build the initial table of child processes and hostnames for this search to work. You should also schedule at the same interval as this search the second baseline search Previously Seen Running Windows Services - Update to keep this table up to date and to age out old Windows Services. Please update the previously_seen_windows_services_window macro to adjust the time window. Please ensure that the Splunk Add-on for Microsoft Windows is version 8.0.0 or above.

Known False Positives

A previously unseen service is not necessarily malicious. Verify that the service is legitimate and that was installed by a legitimate process.

Associated Analytic Story

Risk Based Analytics (RBA)

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

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Not Applicable N/A N/A N/A
Unit ❌ Failing N/A N/A N/A
Integration ❌ Failing N/A N/A N/A

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: GitHub | Version: 5