| ID | Technique | Tactic |
|---|---|---|
| T1036.003 | Rename Legitimate Utilities | Defense Evasion |
| T1218.004 | InstallUtil | Defense Evasion |
Detection: Windows DotNet Binary in Non Standard Path
Description
The following analytic detects the execution of native .NET binaries from non-standard directories within the Windows operating system. It leverages Endpoint Detection and Response (EDR) telemetry, comparing process names and original file names against a predefined lookup "is_net_windows_file". This activity is significant because adversaries may move .NET binaries to unconventional paths to evade detection and execute malicious code. If confirmed malicious, this behavior could allow attackers to execute arbitrary code, escalate privileges, or maintain persistence within the environment, posing a significant security risk. Also this analytic leverages a sub-search to enhance performance. sub-searches have limitations on the amount of data they can return. Keep this in mind if you have an extensive list of ransomware note file names.
Search
1
2| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time)
3as lastTime
4FROM datamodel=Endpoint.Processes where
5NOT Processes.process_path IN (
6 "*:\\Windows\\ADWS\\*",
7 "*:\\Windows\\Microsoft.NET\\*",
8 "*:\\Windows\\NetworkController\\*",
9 "*:\\Windows\\System32\\*",
10 "*:\\Windows\\SystemApps\\*",
11 "*:\\Windows\\SysWOW64\\*",
12 "*:\\Windows\\WinSxS\\*"
13 )
14(
15 [
16| inputlookup is_net_windows_file
17
18| search netFile=true
19
20| fields originalFileName
21
22| rename originalFileName as Processes.original_file_name
23
24| format
25 ]
26)
27by Processes.action Processes.dest Processes.original_file_name Processes.parent_process
28 Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id
29 Processes.parent_process_name Processes.parent_process_path Processes.process Processes.process_exec
30 Processes.process_guid Processes.process_hash Processes.process_id Processes.process_integrity_level
31 Processes.process_name Processes.process_path Processes.user Processes.user_id Processes.vendor_product
32
33| `drop_dm_object_name("Processes")`
34
35| `security_content_ctime(firstTime)`
36
37| `security_content_ctime(lastTime)`
38
39| lookup update=true is_net_windows_file filename as process_name OUTPUT netFile
40
41| lookup update=true is_net_windows_file originalFileName as original_file_name OUTPUT netFile
42
43| search netFile=true
44
45| `windows_dotnet_binary_in_non_standard_path_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| CrowdStrike ProcessRollup2 | Other | 'crowdstrike:events:sensor' |
'crowdstrike' |
| Sysmon EventID 1 | 'XmlWinEventLog' |
'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational' |
|
| Windows Event Log Security 4688 | 'XmlWinEventLog' |
'XmlWinEventLog:Security' |
Macros Used
| Name | Value |
|---|---|
| security_content_ctime | convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$) |
| windows_dotnet_binary_in_non_standard_path_filter | search * |
windows_dotnet_binary_in_non_standard_path_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
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 Notable | Yes |
| Rule Title | %name% |
| Rule Description | %description% |
| Notable Event Fields | user, dest |
| Creates Risk Event | True |
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
False positives may be present and filtering may be required. Certain utilities will run from non-standard paths based on the third-party application in use.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message:
An instance of $parent_process_name$ spawning $process_name$ from a non-standard path was identified on endpoint $dest$ by user $user$.
| Risk Object | Risk Object Type | Risk Score | Threat Objects |
|---|---|---|---|
| dest | system | 49 | process_name, parent_process_name |
| user | user | 49 | process_name, parent_process_name |
References
-
https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1036.003/T1036.003.yaml
-
https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1218.004/T1218.004.md
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: 11