Masquerading: Masquerade File Type
- ID
- T1036.008
- Tactics
- TA0005 Stealth
- Sub-technique of
- T1036 Masquerading
- Platforms
- Linux, macOS, Windows
- Data sources
- File Creation, Process Creation, File Metadata
- Source
- attack.mitre.org
- MITRE last modified
- 12 May 2026
Adversaries may masquerade malicious payloads as legitimate files through changes to the payload's formatting, including the file’s signature, extension, icon, and contents. Various file types have a typical standard format, including how they are encoded and organized. For example, a file’s signature (also known as header or magic bytes) is the beginning bytes of a file and is often used to identify the file’s type. For example, the header of a JPEG file, is 0xFF 0xD8 and the file extension is either .JPE, .JPEG or .JPG.
Adversaries may edit the header’s hex code and/or the file extension of a malicious payload in order to bypass file validation checks and/or input sanitization. This behavior is commonly used when payload files are transferred (e.g., Ingress Tool Transfer) and stored (e.g., Upload Malware) so that adversaries may move their malware without triggering detections.
Common non-executable file types and extensions, such as text files (.txt) and image files (.jpg, .gif, etc.) may be typically treated as benign. Based on this, adversaries may use a file extension to disguise malware, such as naming a PHP backdoor code with a file name of test.gif. A user may not know that a file is malicious due to the benign appearance and file extension.
Polyglot files, which are files that have multiple different file types and that function differently based on the application that will execute them, may also be used to disguise malicious malware and capabilities.[2]
Detection
- DET0226 Detection Strategy for Masquerading via File Type Modification
Data components: File Creation, Process Creation, File Metadata
Mitigations (3)
- M1038 Execution Prevention
Ensure that input sanitization is performed and that files are validated properly before execution; furthermore, implement a strict allow list to ensure that only authorized file types are processed.[1] Restrict and/or block execution of files where headers and extensions do not match.
- M1040 Behavior Prevention on Endpoint
Implement security controls on the endpoint, such as a Host Intrusion Prevention System (HIPS), to identify and prevent execution of files with mismatching file signatures.
- M1049 Antivirus/Antimalware
Anti-virus can be used to automatically quarantine suspicious files.
Groups (5)
Software (13)
- S0352 OSX_OCEANLOTUS.D
- S0650 QakBot
- S1053 AvosLocker
- S1063 Brute Ratel C4
- S1074 ANDROMEDA
- S1130 Raspberry Robin
- S1182 MagicRAT
- S1183 StrelaStealer
- S1190 Kapeka
- S1213 Lumma Stealer
- S1238 STATICPLUGIN
- S9018 HeartCrypt
- S9019 PureCrypter
References
- file_upload_attacks_pt2
- polygot_icedID
