Check out the results from our first round of ATT&CK Evaluations at!

Hidden Files and Directories

To prevent normal users from accidentally changing special files on a system, most operating systems have the concept of a ‘hidden’ file. These files don’t show up when a user browses the file system with a GUI or when using normal commands on the command line. Users must explicitly ask to show the hidden files either via a series of Graphical User Interface (GUI) prompts or with command line switches (dir /a for Windows and ls –a for Linux and macOS).

Adversaries can use this to their advantage to hide files and folders anywhere on the system for persistence and evading a typical user or system analysis that does not incorporate investigation of hidden files.


Users can mark specific files as hidden by using the attrib.exe binary. Simply do attrib +h filename to mark a file or folder as hidden. Similarly, the "+s" marks a file as a system file and the "+r" flag marks the file as read only. Like most windows binaries, the attrib.exe binary provides the ability to apply these changes recursively "/S".


Users can mark specific files as hidden simply by putting a "." as the first character in the file or folder name [1] [2]. Files and folder that start with a period, ‘.’, are by default hidden from being viewed in the Finder application and standard command-line utilities like "ls". Users must specifically change settings to have these files viewable. For command line usages, there is typically a flag to see all files (including hidden ones). To view these files in the Finder Application, the following command must be executed: defaults write AppleShowAllFiles YES, and then relaunch the Finder Application.


Files on macOS can be marked with the UF_HIDDEN flag which prevents them from being seen in, but still allows them to be seen in [3].Many applications create these hidden files and folders to store information so that it doesn’t clutter up the user’s workspace. For example, SSH utilities create a .ssh folder that’s hidden and contains the user’s known hosts and keys.

ID: T1158

Tactic: Defense Evasion, Persistence

Platform:  Linux, macOS, Windows

Permissions Required:  User

Data Sources:  File monitoring, Process monitoring, Process command-line parameters

Defense Bypassed:  Host forensic analysis

Version: 1.0



An APT28 loader Trojan saves its payload with hidden file attributes.[4]


Calisto uses a hidden directory named .calisto to store data from the victim’s machine before exfiltration.[5][6]


FruitFly saves itself with a leading "." to make it a hidden file.[7]


iKitten saves itself with a leading "." so that it's hidden from users by default.[7]


The Komplex payload is stored in a hidden directory at /Users/Shared/.local/kextd.[1]

Lazarus Group

A Lazarus Group VBA Macro sets its file attributes to System and Hidden.[8]


MacSpy stores itself in ~/Library/.DS_Stores/ [9]


Mitigation of this technique may be difficult and unadvised due to the the legitimate use of hidden files and directories.


Monitor the file system and shell commands for files being created with a leading "." and the Windows command-line use of attrib.exe to add the hidden attribute.