Detection rules › Splunk

Windows Alternate DataStream - Process Execution

Status
production
Severity
medium
Group by
IntegrityLevel, command_line, computer_name, event_action, original_file_name, parent_command_line, parent_process_guid, parent_process_id, parent_process_name, process_guid, process_hash, process_id, process_name, user, user_id, vendor_product
Author
Steven Dick
Source
github.com/splunk/security_content

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.

Known false positives

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

MITRE ATT&CK coverage

Telemetry coverage

Rule body

name: Windows Alternate DataStream - Process Execution
id: 30c32c5c-41fe-45db-84fe-275e4320da3f
version: 13
creation_date: '2024-01-10'
modification_date: '2026-06-04'
author: Steven Dick
status: production
type: TTP
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.
data_source:
    - Windows Event Log Security 4688
    - Sysmon EventID 1
search: |-
    | tstats count min(_time) as firstTime max(_time) as lastTime values(Processes.process_current_directory) as directory
    from datamodel=Endpoint.Processes where
    Processes.parent_process_name != "unknown"
    Processes.process_name IN (
        "appvlp.exe",
        "bitsadmin.exe",
        "control.exe",
        "cscript.exe",
        "forfiles.exe",
        "ftp.exe",
        "mavinject.exe",
        "mshta.exe",
        "powershell_ise.exe",
        "powershell.exe",
        "pwsh.exe",
        "regini.exe",
        "regsvr32.exe",
        "rundll32.exe",
        "sc.exe",
        "wmic.exe",
        "wscript.exe"
    )
    
    by Processes.action Processes.dest Processes.original_file_name Processes.parent_process
       Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id
       Processes.parent_process_name Processes.parent_process_path Processes.process
       Processes.process_exec Processes.process_guid Processes.process_hash
       Processes.process_id Processes.process_integrity_level Processes.process_name
       Processes.process_path Processes.user Processes.user_id Processes.vendor_product
    
    | `drop_dm_object_name(Processes)`
    | regex process="(\b)\w+(\.\w+)?:\w+(\.\w{2,4})(?!\.)(\b|\s|&)"
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | `windows_alternate_datastream___process_execution_filter`
how_to_implement: 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.
references:
    - https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f
    - https://car.mitre.org/analytics/CAR-2020-08-001/
    - https://blogs.juniper.net/en-us/threat-research/bitpaymer-ransomware-hides-behind-windows-alternate-data-streams
    - https://blog.netwrix.com/2022/12/16/alternate_data_stream/
finding:
    title: The $process_name$ process was executed by $user$ using data from an NTFS alternate data stream.
    entity:
        field: user
        type: user
        score: 50
intermediate_findings:
    entities:
        - field: dest
          type: system
          score: 50
          message: The $process_name$ process was executed by $user$ using data from an NTFS alternate data stream.
threat_objects:
    - field: process_name
      type: process_name
analytic_story:
    - Compromised Windows Host
    - Windows Defense Evasion Tactics
asset_type: Endpoint
mitre_attack_id:
    - T1564.004
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint

Stages and Predicates

Stage 1: tstats

| tstats count min(_time) as firstTime max(_time) as lastTime values(Processes.process_current_directory) as directory
from datamodel=Endpoint.Processes where
Processes.parent_process_name != "unknown"
Processes.process_name IN (
    "appvlp.exe",
    "bitsadmin.exe",
    "control.exe",
    "cscript.exe",
    "forfiles.exe",
    "ftp.exe",
    "mavinject.exe",
    "mshta.exe",
    "powershell_ise.exe",
    "powershell.exe",
    "pwsh.exe",
    "regini.exe",
    "regsvr32.exe",
    "rundll32.exe",
    "sc.exe",
    "wmic.exe",
    "wscript.exe"
)

by Processes.action Processes.dest Processes.original_file_name Processes.parent_process
   Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id
   Processes.parent_process_name Processes.parent_process_path Processes.process
   Processes.process_exec Processes.process_guid Processes.process_hash
   Processes.process_id Processes.process_integrity_level Processes.process_name
   Processes.process_path Processes.user Processes.user_id Processes.vendor_product

Stage 2: search

| `drop_dm_object_name(Processes)`

Stage 3: regex

| regex process="(\b)\w+(\.\w+)?:\w+(\.\w{2,4})(?!\.)(\b|\s|&)"

Stage 4: search

| `security_content_ctime(firstTime)`

Stage 5: search

| `security_content_ctime(lastTime)`

Stage 6: search

| `windows_alternate_datastream___process_execution_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Processes.parent_process_namene
  • "unknown"
field:"parent_process_name" kind:ne
Processes.process_namein
  • "appvlp.exe"
  • "bitsadmin.exe" corpus 23 (elastic 21, splunk 2)
  • "control.exe" corpus 10 (elastic 8, splunk 2)
  • "cscript.exe" corpus 67 (elastic 65, splunk 2)
  • "forfiles.exe" corpus 7 (elastic 6, splunk 1)
  • "ftp.exe" corpus 5 (elastic 5)
  • "mavinject.exe" corpus 2 (elastic 1, splunk 1)
  • "mshta.exe" corpus 84 (elastic 79, splunk 5)
  • "powershell.exe" corpus 184 (elastic 140, splunk 44)
  • "powershell_ise.exe" corpus 52 (splunk 29, elastic 23)
  • "pwsh.exe" corpus 77 (elastic 48, splunk 29)
  • "regini.exe"
  • "regsvr32.exe" corpus 73 (elastic 68, splunk 5)
  • "rundll32.exe" corpus 126 (elastic 100, splunk 26)
  • "sc.exe" corpus 32 (elastic 17, splunk 15)
  • "wmic.exe" corpus 66 (elastic 39, splunk 27)
  • "wscript.exe" corpus 83 (elastic 82, splunk 1)
field:"process_name" kind:in
processregex_match
  • "(\b)\w+(.\w+)?:\w+(.\w{2,4})(?!.)(\b|\s|&)"
field:"CommandLine" kind:regex_match