Cross-source coverage
T1036.006 / ATT&CK
Masquerading: Space after Filename
3 rules across 2 sources.
From MITRE ATT&CK 19.2
Adversaries can hide a program's true filetype by changing the extension of a file. With certain file types (specifically this does not work with.app extensions), appending a space to the end of a filename will change how the file is processed by the operating system.
For example, if there is a Mach-O executable file called evil.bin, when it is double clicked by a user, it will launch Terminal.app and execute. If this file is renamed to evil.txt, then when double clicked by a user, it will launch with the default text editing application (not executing the binary). However, if the file is renamed to evil.txt (note the space at the end), then when double clicked by a user, the true file type is determined by the OS and handled appropriately and the binary will be executed.
Adversaries can use this feature to trick users into double clicking benign-looking files of any format and ultimately executing something malicious.
- Tactics
- Stealth
- Platforms
- Linux · macOS
- Telemetry
-
auditd:SYSCALLlinux:syslogmacos:unifiedlogfs:fsusage
How MITRE says to detect it DET0292
Masquerading via Space After Filename - Behavioral Detection Strategy
Linux Analytic 0812
Detection of file execution where the file name contains a trailing space to masquerade as a known executable. Adversaries may exploit the way command line interpreters handle file names with trailing whitespace.
auditd:SYSCALLexecvelinux:syslogapplication or system execution logs
macOS Analytic 0813
Execution of renamed or dropped files with a trailing space to deceive users or analysts, especially in LaunchAgents or LaunchDaemons.
macos:unifiedlogprocess eventsfs:fsusagefilesystem activity
elastic/detection-rules
2 rules| Detection | Severity | Format |
|---|---|---|
| Masquerading Space After Filename | Medium | Elastic TOML |
| Processes with Trailing Spaces | Low | Elastic TOML |
SigmaHQ/sigma
1 rule| Detection | Severity | Format |
|---|---|---|
| Space After Filename - macOS | Low | Sigma |