Keep up to date with latest blog posts
This blog explains the T1036 Masquerading technique of the MITRE ATT&CK® framework, the eighth technique in the Top 10 MITRE ATT&CK techniques list.
We can classify masqueraded objects for defense evasion in four categories:
1. Masquerading File Extensions
This adversary behavior involves tricking a user or an application into opening a file that seems like a benign file type because of its apparent extension. Therefore, the extension perceived by users does not reflect the file’s actual extension. The following sub-techniques of the masquerading technique include masquerading extensions:
- T1036.002 Right-to-Left Override
- T1036.006 Space after Filename
- T1036.007 Double File Extension
2. Masquerading Names
Attackers may change:
names of malicious files with the names of legitimate and trusted applications, such as "flash_en.exe" (T1036.005 Match Legitimate Name or Location)
names of legitimate system utilities before using them since some security tools monitor these built-in system utilities to detect their suspicious use (T1036.003 Rename System Utilities Rename)
names of tasks or services with names of legitimate tasks or services to make it appear benign and avoid detection (T1036.004 Masquerade Task or Service).
3. Masquerading File Locations
Adversaries may masquerade file locations by:
placing malicious files in trusted directories such as "C:\Windows\System32" to evade defenses.
creating directories that are similar to the directories used by known software, such as "C:\Intel\"
changing the malware's whole path, including the directory and file name, such as "C:\NVIDIA\NvDaemon.exe"
These methods are categorized under the T1036.005 Match Legitimate Name or Location sub-technique.
4.Masquerading File Signatures
Adversaries copy valid and signed programs’ code signature and metadata information and use it in their malware to evade defenses (T1036.001 Invalid Code Signature).
T1036.001 Invalid Code Signature
Code signing is the method of digitally signing executables to verify the author of the executable and guarantee that the integrity of the executable is intact. In this sub-technique, cyber threat actors copy the metadata and code signature information of signed files to their malware.
Since a code signature can only be valid for a specific program, it would not be valid for any other program. Therefore, unlike the T1553 Subvert Trust Controls technique , the cloning of the code signature does not result in a valid signature. The code signature cloning may trick users and security controls; they cannot get through digital signature validation. Adversaries use the following tools for this technique:
MetaTwin: This tool can copy metadata and AuthentiCode signature from a file and inject it into another .
Resource Hacker: MetaTwin uses this tool to extract the resources of a legitimate binary .
SigThief : MetaTwin uses this tool to extract the digital signature information of the legitimate binary . Then, MetaTwin transfers the extracted metadata and digital signature information to a target binary.
T1036.002 Right-to-Left Override
Right-to-Left Override (RTLO or RLO) character can display the text that follows it in right-to-left order. It is a non-printing Unicode character (U+202E). The RTLO character is used to display the text in reverse order for languages written from right-to-left.
For example, the file name "bank_statementU+202Etxt.exe" will appear on the screen as "bank_statementexe.txt". Users may think that the file is a text file, but it is an executable file. Note that this operation only affects the visual appearance of the file name, and the actual file name still has the extension ".exe".
Adversaries use RTLO Override to trick users into opening malware files by showing the file extension as a benign extension instead of an executable. This technique is commonly used with the T1204 User Execution technique  and T1566.001 Spearphishing Attachment technique . Some examples of abuse of right-to-left override by malware and APT groups are:
Etumbot backdoor: This malware leverages the RTLO technique with convincing icons for PDF or Microsoft Office documents to trick users into clicking and executing the malware file delivered via spearphishing .
APT group: A threat group used the RTLO attack technique to disguise an SCR (Windows screensaver) malware as a document file .
Telegram abuse: Attackers used this attack technique attack to trick Telegram users by changing the displayed file extension .
Sirefef: Thai malware uses the RTLO technique and creates entries in the registry that appear legitimate Google update entries .
T1036.003 Rename System Utilities
Adversaries frequently abuse built-in Windows system utilities to bypass defensive security controls. cmd.exe, certutil.exe, and rundll32.exe are some of the commonly misused utilities. Since adversaries use these system utilities more frequently, security controls may track them to detect suspicious activity.
Operation Soft Cell: In this attack campaign, the threat actors changed the name of the cmd.exe to cdm.exe .
Korplug: This malware uses a renamed certutil.exe - msoia.exe to decode the CAB file .
T1036.004 Masquerade Task or Service
Attackers use operating systems' task and service functionalities to facilitate the initial or recurring execution of their malicious code  . Security controls can be set to detect custom-named tools and services quickly. Therefore, adversaries change the name of their malicious task/service with the name of a legitimate task/service to appear legitimate and evade detection.
Adversaries often use identical or similar names of legitimate tasks/services executed by Windows services, Linux systemd services, the Windows Task Scheduler, and at (Linux and Windows).
ComRAT: This installer malware creates a registry named WSqmCons to appear as associated with Windows SQM Consolidator .
Fin7:The APT group establishes persistence using scheduled tasks named AdobeFlashSync .
Disttrack: The Disttrack wiper malware creates a service named ntssrv, with a display name of "Microsoft Network Realtime Inspection Service" and a description of "Helps guard against time change attempts targeting known and newly discovered vulnerabilities in network time protocols" .
T1036.005 Match Legitimate Name or Location
Attackers may match the names or locations of their artifacts to those of legitimate files to evade defensive security controls.
Tropic Trooper: This cyberespionage group places its USBferry malware in the "%USERPROFILE%\Documents\Flash\" folder and changes its name to "flash_en.exe" .
Operation In(ter)ception: In this cyberespionage campaign, threat actors disguised their files and folders by naming them similar to known software and companies, such as "C:\Intel\IntelV.cgi" .
Pony Trojan: This malware used a well-known Adobe Reader icon and security as the filename to look trustworthy .
T1036.006 Space after Filename
Adding a space to the end of a filename in macOS modifies how the operating system handles the file. If an executable Mach-O file is called "trojan.txt", it will open with the text editing program when double-clicked by a user. So, the executable will not run properly. However, if the file is renamed "trojan.txt " (note the space added at the end), macOS considers this file as executable and executes the binary when a user double-clicks it.
- OSX / Keydnap backdoor: This malware was distributed in a zip archive file that contains a binary named "screenshot.jpg " . Since the filename contains a space character at its end, it would be executed by the Terminal.app. When a user double-clicks it, the Keydnap backdoor malware is executed.
T1036.007 Double File Extension
A file name may contain a secondary file type extension, resulting in the display of only the first extension. Although "filename.txt.exe" may appear as "filename.txt" in some views, the second extension is the actual file type, which specifies how the file is opened and executed. Thus, adversaries leverage a double extension in the filename to masquerade the actual file type .
In Microsoft Windows operating systems, there is a default setting for "Hide file extensions for known file types." Malware authors abuse this feature to trick unsuspecting users into downloading files that appear to be legitimate but are dangerous executables.
Typically, common file types such as text and document files (e.g. .txt, .doc, .pdf) and image files (e.g., .jpg, .png, .gif) are used as the first extension to make the file appear benign. Dangerous executable extensions (e.g., .exe, .vbs, .com, .ps1, .dat, .hta, .htm, .js) frequently appear as the second extension and true file type. These files frequently masquerade as email attachments.
Some examples are:
Avaddon ransomware loader: This malware is sent as a double extension attachment (.jpg.js) in spearphishing emails, tricking the victim into thinking an image was leaked online and sent to them .
Adversaries also leverage the double-file extension technique where a web application extracts file extensions by looking for the "." (dot) character in the filename and extracting the string after the dot character. This technique can be used to bypass a file extension blocklist. For example, when ".jpg" is permitted in Apache, a PHP file may be executed using the double extension technique, such as "file.php.jpg" .
- Drupal had a double extension vulnerability (CVE-2020-13671). Adversaries add a second file extension to a malicious file, allowing them to upload it to a Drupal site and execute the payload . For example, a malicious file named malware.php could be renamed "malware.php.txt". When uploaded to a Drupal site, the file is classified as a text file rather than a PHP file, but it executes the malicious PHP code when Drupal attempts to read the text file.
 ASERT, “Illuminating the Etumbot APT Backdoor,” Jun-2014. https://paper.seebug.org/papers/APT/APT_CyberCriminal_Campagin/2014/ASERT-Threat-Intelligence-Brief-2014-07-Illuminating-Etumbot-APT.pdf.
 “Threat Actor Groups use COVID-19 pandemic theme – Red Alert.” https://redalert.nshc.net/2020/04/16/threat-actor-groups-use-covid-19-pandemic-theme/.
 A. Firsh, “Zero-day vulnerability in Telegram.” https://securelist.com/zero-day-vulnerability-in-telegram/83800/.
 “Sirefef Malware Found Using Unicode Right-to-Left Override Technique.” https://threatpost.com/sirefef-malware-found-using-unicode-right-to-left-override-technique/102033/.
 “Virus Bulletin :: VB2019 paper: Operation Soft Cell – a worldwide campaign against telecommunication providers.” https://www.virusbulletin.com/virusbulletin/2019/12/vb2019-paper-operation-soft-cell-worldwide-campaign-against-telecommunication-providers/.
 “COVID-19 Ongoing Cyber Updates.” https://blog.cyberint.com/covid-19-ongoing-cyber-updates.
 M. Faou, “From Agent.BTZ to ComRAT v4.” https://www.welivesecurity.com/wp-content/uploads/2020/05/ESET_Turla_ComRAT.pdf.
 M. Gorelik, “FIN7 Takes Another Bite at the Restaurant Industry.” https://blog.morphisec.com/fin7-attacks-restaurant-industry.
 R. Falcone, “Shamoon 2: Return of the Disttrack Wiper,” Unit42, 30-Nov-2016. https://unit42.paloaltonetworks.com/unit42-shamoon-2-return-disttrack-wiper/.
 J. Chen, “Tropic Trooper’s Back: USBferry Attack Targets Air-gapped Environments.” https://documents.trendmicro.com/assets/Tech-Brief-Tropic-Trooper-s-Back-USBferry-Attack-Targets-Air-gapped-Environments.pdf.
 D. Breitenbacher and K. Osis, “Operation In(ter)ception: Aerospace and military companies in the crosshairs of cyberspies | WeLiveSecurity,” WeLiveSecurity, 17-Jun-2020. https://www.welivesecurity.com/2020/06/17/operation-interception-aerospace-military-companies-cyberspies/.
 hasherezade, “No money, but Pony! From a mail to a trojan horse - Malwarebytes Labs,” Malwarebytes Labs, 19-Nov-2015. https://blog.malwarebytes.com/threat-analysis/2015/11/no-money-but-pony-from-a-mail-to-a-trojan-horse/.
 Cyber Intel Unit, “Cybercriminal Group FIN7 Suspected Of Recon Campaign,” 29-Sep-2021. https://blogs.infoblox.com/cyber-threat-intelligence/cyber-campaign-briefs/likely-fin7-recon-campaign/.
 C. Nocturnus, “Cybereason vs. Avaddon Ransomware.” https://www.cybereason.com/blog/cybereason-vs.-avaddon-ransomware.
 “CVE-2020-13671: Exploiting Drupal double extension vulnerability,” 20-Nov-2020. https://www.iicybersecurity.com/cve-2020-13671-exploiting-drupal-double-extension-vulnerability.html.