Detection: Windows Renamed Command Interpreter was Executed

Description

The following analytic identifies a Windows command interpreter process being executed where it's process name does not match it's original file name attribute. Processes that have been renamed and executed may be an indicator that an adversary is attempting to evade defenses or execute malicious code.

 1
 2| tstats `security_content_summariesonly`
 3  count min(_time) AS firstTime
 4        max(_time) AS lastTime
 5
 6FROM datamodel=Endpoint.Processes WHERE
 7
 8[
 9    
10| inputlookup renamed_windows_command_interpreter_binaries
11    
12| rename original_file_name as Processes.original_file_name
13    
14| table Processes.original_file_name
15]
16
17by Processes.action Processes.dest Processes.original_file_name Processes.parent_process
18   Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id
19   Processes.parent_process_name Processes.parent_process_path
20   Processes.process Processes.process_exec Processes.process_guid
21   Processes.process_hash Processes.process_id Processes.process_integrity_level
22   Processes.process_name Processes.process_path
23   Processes.user Processes.user_id Processes.vendor_product
24
25
26| `drop_dm_object_name(Processes)`
27
28
29| eval process_name_norm=replace(lower(process_name), "\.exe$", ""),
30       original_file_name_norm=replace(lower(original_file_name), "\.exe$", "")
31
32| where process_name_norm != original_file_name_norm
33
34
35| lookup local=t renamed_windows_command_interpreter_binaries original_file_name OUTPUT description
36
37
38| `security_content_ctime(firstTime)`
39
40| `security_content_ctime(lastTime)`
41
42| `windows_renamed_command_interpreter_was_executed_filter`

Data Source

Name Platform Sourcetype Source
Sysmon EventID 1 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'
CrowdStrike ProcessRollup2 Other 'crowdstrike:events:sensor' 'crowdstrike'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
windows_renamed_command_interpreter_was_executed_filter search *
windows_renamed_command_interpreter_was_executed_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
T1036.003 Rename Legitimate Utilities Stealth
T1059 Command and Scripting Interpreter Execution
Installation
Exploitation
DE.AE
CIS 10

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 Finding (Notable) No
Creates Intermediate Finding (Risk Event) Yes
Anomaly detections generate Intermediate Findings (Risk Events). They do not generate a Finding (Notable) directly.

Implementation

The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process GUID, process name, and parent process. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the Processes node of the Endpoint data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process.

Known False Positives

3rd party software binaries sharing the same name as Windows command interpreter binaries may trigger false positives.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
Command Interpreter [$original_file_name$] was renamed as [$process_path$] and later executed on [$dest$] dest system 20

Threat Objects

Field Type
process_path file_path

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation ✅ Passing N/A N/A N/A
Unit ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog

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