Try in Splunk Security Cloud

Description

This analytic leverages Sysmon Event ID 15, a critical file creation event, to detect the creation of Alternate Data Streams (ADS) on Windows systems. ADS is a feature of the NTFS file system that allows the storage of data in hidden streams attached to files. These streams are not visible in standard file listings, making them a popular technique for concealing malicious activity. Event ID 15 captures both the hash of the primary file content (unnamed stream) and the content of any additional named streams, which can include executables, scripts, or configuration data. Malware often exploits ADS to hide payloads, leveraging browser downloads to attach a Zone.Identifier stream, marking the file as originating from the Internet (Mark Of The Web, MOTW). This analytic is designed to identify such misuse by analyzing the content and creation patterns of named streams, including those under 1KB which may contain MOTW information. It is essential for detecting sophisticated threats that utilize non-executable file types or conceal malicious scripts within ADS, beyond the traditional focus on PE executables. The detection process involves monitoring for the creation of named streams, which are part of the NTFS structure and can be examined using tools like PowerShell for the presence of additional data streams or MOTW information. This approach helps in uncovering hidden payloads and tracking the origin of suspicious files downloaded via browsers or email clients, providing a comprehensive defense against ADS abuse.

  • Type: TTP
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2024-02-15
  • Author: Steven Dick, Teoderick Contreras, Michael Haag, Splunk
  • ID: 683f48de-982f-4a7e-9aac-9cec550da498

Annotations

ATT&CK

ATT&CK

ID Technique Tactic
T1564 Hide Artifacts Defense Evasion
T1564.004 NTFS File Attributes Defense Evasion
Kill Chain Phase
  • Exploitation
NIST
  • DE.CM
CIS20
  • CIS 10
CVE
1
2
3
4
5
6
7
8
9
10
11
12
`sysmon` EventCode=15 NOT Contents IN ("-","[ZoneTransfer]*") 
| regex TargetFilename="(?<!\/)\b\w+(\.\w+)?:\w+(\.\w+)?$" 
| regex Contents="(?:[A-Za-z0-9+/]{128,})(?:[A-Za-z0-9+/]{2}==
|[A-Za-z0-9+/]{3}=)?$" 
| eval file_name = replace(TargetFilename,"(.*\\\)",""), process = Image , file_path = TargetFilename , base64 = Contents, file_hash = coalesce(SHA256,SHA1,MD5,Hash) 
| stats count min(_time) as firstTime max(_time) as lastTime values(user) as user by dest, process, process_guid, file_name, file_path, file_hash, base64 
| `base64decode(base64)` 
| fields - base64 
| rename base64_decode as command 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_alternate_datastream___base64_content_filter`

Macros

The SPL above uses the following Macros:

:information_source: windows_alternate_datastream_-_base64_content_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • _time
  • TargetFilename
  • Image
  • Contents
  • file_hash
  • process_guid

How To Implement

Target environment must ingest sysmon data, specifically Event ID 15.

Known False Positives

Unknown

Associated Analytic Story

RBA

Risk Score Impact Confidence Message
80.0 100 80 Base64 content written to an NTFS alternate data stream by $user$, see command field for details.

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

Reference

Test Dataset

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 | version: 2