Try in Splunk Security Cloud

Description

This analytic is designed to detect when data, possessing an IMPHASH value, is written to an Alternate Data Stream (ADS) in the NTFS file system. The presence of an IMPHASH value suggests that the written data has a Portable Executable (PE) structure, indicating its potential to be executed. Such behavior could be a sign of a threat actor staging malicious code within hard-to-detect areas of the file system for future use or persistence. It's important to note that for this analytic to function correctly, import hashing/imphash must be enabled within Sysmon. This allows the capture of the IMPHASH value, a unique identifier for the imported functions of a PE, providing a robust mechanism for detecting hidden malicious activity leveraging ADS.

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

  • Last Updated: 2024-02-15
  • Author: Steven Dick, Teoderick Contreras, Splunk
  • ID: a258bf2a-34fd-4986-8086-78f506e00206

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
`sysmon` EventCode=15 IMPHASH!=00000000000000000000000000000000 
| regex TargetFilename="(?<!\/)\b\w+(\.\w+)?:\w+(\.\w+)?$" 
| eval file_name = replace(TargetFilename,"(.*\\\)",""), process = Image , file_path = TargetFilename, 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, IMPHASH 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_alternate_datastream___executable_content_filter`

Macros

The SPL above uses the following Macros:

:information_source: windows_alternate_datastream_-_executable_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
  • dest
  • TargetFilename
  • Image
  • Contents
  • file_hash
  • process_guid
  • IMPHASH

How To Implement

Target environment must ingest Sysmon data, specifically Event ID 15, and import hashing/imphash must be enabled within Sysmon.

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