JUST RELEASED: ATT&CK for Industrial Control Systems

NTFS File Attributes

Every New Technology File System (NTFS) formatted partition contains a Master File Table (MFT) that maintains a record for every file/directory on the partition. [1] Within MFT entries are file attributes, [2] such as Extended Attributes (EA) and Data [known as Alternate Data Streams (ADSs) when more than one Data attribute is present], that can be used to store arbitrary data (and even complete files). [1] [3] [4] [5]

Adversaries may store malicious data or binaries in file attribute metadata instead of directly in files. This may be done to evade some defenses, such as static indicator scanning tools and anti-virus. [6] [4]

ID: T1096
Tactic: Defense Evasion
Platform: Windows
System Requirements: NTFS partitioned hard drive
Data Sources: File monitoring, Kernel drivers, API monitoring, Process command-line parameters
Defense Bypassed: Signature-based detection, Host forensic analysis, Anti-virus
Contributors: Red Canary; Oddvar Moe, @oddvarmoe
Version: 1.0
Created: 31 May 2017
Last Modified: 25 June 2019

Procedure Examples

Name Description
APT32

APT32 used NTFS alternate data stream to hide their payloads.[15]

esentutl

esentutl can be used to read and write alternate data streams.[8]

Expand

Expand can be used to download or copy a file into an alternate data stream.[7]

Gazer

Gazer stores configuration items in alternate data streams (ADSs) if the Registry is not accessible.[13]

LoJax

LoJax has loaded an embedded NTFS DXE driver to be able to access and write to NTFS partitions.[14]

PowerDuke

PowerDuke hides many of its backdoor payloads in an alternate data stream (ADS).[11]

POWERSOURCE

If the victim is using PowerShell 3.0 or later, POWERSOURCE writes its decoded payload to an alternate data stream (ADS) named kernel32.dll that is saved in %PROGRAMDATA%\Windows\.[10]

Regin

The Regin malware platform uses Extended Attributes to store encrypted executables.[12]

Zeroaccess

Some variants of the Zeroaccess Trojan have been known to store data in Extended Attributes.[9]

Mitigations

Mitigation Description
Restrict File and Directory Permissions

Consider adjusting read and write permissions for NTFS EA, though this should be tested to ensure routine OS operations are not impeded.

Detection

Forensic techniques exist to identify information stored in NTFS EA. [6] Monitor calls to the ZwSetEaFile and ZwQueryEaFile Windows API functions as well as binaries used to interact with EA, [16] [17] and consider regularly scanning for the presence of modified information. [1]

There are many ways to create and interact with ADSs using Windows utilities. Monitor for operations (execution, copies, etc.) with file names that contain colons. This syntax (ex: file.ext:ads[.ext]) is commonly associated with ADSs. [5] [16] [17] For a more exhaustive list of utilities that can be used to execute and create ADSs, see https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f.

The Streams tool of Sysinternals can be used to uncover files with ADSs. The dir /r command can also be used to display ADSs. [18] Many PowerShell commands (such as Get-Item, Set-Item, Remove-Item, and Get-ChildItem) can also accept a -stream parameter to interact with ADSs. [4] [5]

References