Detection: Windows Alternate DataStream - Process Execution

Description

The following analytic detects when a process attempts to execute a file from within an NTFS file system alternate data stream. This detection leverages process execution data from sources like Windows process monitoring or Sysmon Event ID 1, focusing on specific processes known for such behavior. This activity is significant because alternate data streams can be used by threat actors to hide malicious code, making it difficult to detect. If confirmed malicious, this could allow an attacker to execute hidden code, potentially leading to unauthorized actions and further compromise of the system.

 1
 2| tstats count min(_time) as firstTime max(_time) as lastTime values(Processes.process_current_directory) as directory
 3from datamodel=Endpoint.Processes where
 4Processes.parent_process_name != "unknown"
 5Processes.process_name IN (
 6    "appvlp.exe",
 7    "bitsadmin.exe",
 8    "control.exe",
 9    "cscript.exe",
10    "forfiles.exe",
11    "ftp.exe",
12    "mavinject.exe",
13    "mshta.exe",
14    "powershell_ise.exe",
15    "powershell.exe",
16    "pwsh.exe",
17    "regini.exe",
18    "regscr32.exe",
19    "rundll32.exe",
20    "sc.exe",
21    "wmic.exe",
22    "wscript.exe"
23)
24
25by Processes.action Processes.dest Processes.original_file_name Processes.parent_process
26   Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id
27   Processes.parent_process_name Processes.parent_process_path Processes.process
28   Processes.process_exec Processes.process_guid Processes.process_hash
29   Processes.process_id Processes.process_integrity_level Processes.process_name
30   Processes.process_path Processes.user Processes.user_id Processes.vendor_product
31
32
33| `drop_dm_object_name(Processes)`
34
35| regex process="(\b)\w+(\.\w+)?:\w+(\.\w{2,4})(?!\.)(\b
36|\s
37|&)"
38
39| `security_content_ctime(firstTime)`
40
41| `security_content_ctime(lastTime)`
42
43| `windows_alternate_datastream___process_execution_filter`

Data Source

Name Platform Sourcetype Source
Sysmon EventID 1 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'
Windows Event Log Security 4688 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Security'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
windows_alternate_datastream___process_execution_filter search *
windows_alternate_datastream___process_execution_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
T1564.004 NTFS File Attributes Stealth
Exploitation
DE.CM
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) Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Intermediate Finding (Risk Event) Yes
TTP detections generate a Finding (Notable) and may generate Intermediate Findings (Risk Events) for associated entities.

Implementation

Target environment must ingest process execution data sources such as Windows process monitoring and/or Sysmon EventID 1.

Known False Positives

False positives may be generated by process executions within the commandline, regex has been provided to minimize the possibilty.

Associated Analytic Story

Finding

Title Entity Field Entity Type Risk Score
The $process_name$ process was executed by $user$ using data from an NTFS alternate data stream. user user 50

Intermediate Findings

Message Entity Field Entity Type Risk Score
The $process_name$ process was executed by $user$ using data from an NTFS alternate data stream. dest system 50

Threat Objects

Field Type
process_name process_name

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