NTFS File Attributes
|NTFS File Attributes|
|System Requirements||NTFS partitioned hard drive|
|Data Sources||File monitoring, Kernel drivers, API monitoring|
|Defense Bypassed||Signature-based detection, Anti-virus, Host forensic analysis|
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 Alternative Data Streams (ADSs) when more than one Data attribute is present], that can be used to store arbitrary data (and even complete files).1345
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.64
- Gazer stores configuration items in alternate data streams (ADSs) if the Registry is not accessible.7
- 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
- PowerDuke hides many of its backdoor payloads in an alternate data stream (ADS).9
- The Regin malware platform uses Extended Attributes to store encrypted executables.10
- Some variants of the Zeroaccess Trojan have been known to store data in Extended Attributes.11
It may be difficult or inadvisable to block access to EA and ADSs.512 Efforts should be focused on preventing potentially malicious software from running. Identify and block potentially malicious software that may contain functionality to hide information in EA and ADSs by using whitelisting13 tools like AppLocker1415 or Software Restriction Policies16 where appropriate.17
Consider adjusting read and write permissions for NTFS EA, though this should be tested to ensure routine OS operations are not impeded.18
Forensic techniques exist to identify information stored in NTFS EA.6 Monitor calls to the ZwSetEaFile and ZwQueryEaFile Windows API functions, used to interact with EA, and consider regularly scanning for the presence of modified information.1
The Streams tool of Sysinternals can be used to uncover files with ADSs. The
dir /r command can also be used to display ADSs.12 Many PowerShell commands (such as Get-Item, Set-Item, Remove-Item, and Get-ChildItem) can also accept a
-stream parameter to interact with ADSs.45
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
- Atkinson, J. (2017, July 18). Host-based Threat Modeling & Indicator Design. Retrieved March 21, 2018.
- Hughes, J. (2010, August 25). NTFS File Attributes. Retrieved March 21, 2018.
- Microsoft. (n.d.). File Streams. Retrieved December 2, 2014.
- Arntz, P. (2015, July 22). Introduction to Alternate Data Streams. Retrieved March 21, 2018.
- Marlin, J. (2013, March 24). Alternate Data Streams in NTFS. Retrieved March 21, 2018.
- Harrell, C. (2012, December 11). Extracting ZeroAccess from NTFS Extended Attributes. Retrieved June 3, 2016.
- ESET. (2017, August). Gazing at Gazer: Turla’s new second stage backdoor. Retrieved September 14, 2017.
- Brumaghin, E. and Grady, C.. (2017, March 2). Covert Channels and Poor Decisions: The Tale of DNSMessenger. Retrieved March 8, 2017.
- Adair, S.. (2016, November 9). PowerDuke: Widespread Post-Election Spear Phishing Campaigns Targeting Think Tanks and NGOs. Retrieved January 11, 2017.
- Kaspersky Lab's Global Research and Analysis Team. (2014, November 24). THE REGIN PLATFORM NATION-STATE OWNAGE OF GSM NETWORKS. Retrieved December 1, 2014.
- Ciubotariu, M. (2014, January 23). Trojan.Zeroaccess.C Hidden in NTFS EA. Retrieved December 2, 2014.
- Pravs. (2009, May 25). What you need to know about alternate data streams in windows? Is your Data secure? Can you restore that?. Retrieved March 21, 2018.
- Beechey, J. (2010, December). Application Whitelisting: Panacea or Propaganda?. Retrieved November 18, 2014.
- Tomonaga, S. (2016, January 26). Windows Commands Abused by Attackers. Retrieved February 2, 2016.
- NSA Information Assurance Directorate. (2014, August). Application Whitelisting Using Microsoft AppLocker. Retrieved March 31, 2016.
- Corio, C., & Sayana, D. P. (2008, June). Application Lockdown with Software Restriction Policies. Retrieved November 18, 2014.
- Microsoft. (2012, June 27). Using Software Restriction Policies and AppLocker Policies. Retrieved April 7, 2016.
- Sander, J. (2017, October 12). Attack Step 3: Persistence with NTFS Extended Attributes – File System Attacks. Retrieved March 21, 2018.