MastaStealer Malware Uses Windows LNK Files to Evade Detection and Bypass Windows Defender

MastaStealer Malware Exploits Windows Shortcuts to Evade Detection

A recent cybersecurity investigation has uncovered a sophisticated malware campaign utilizing Windows LNK (shortcut) files to deploy MastaStealer, an information-stealing malware. This attack chain demonstrates advanced evasion techniques, allowing the malware to bypass traditional security measures and compromise targeted systems.

Attack Vector: Malicious LNK Files

The attack initiates with spear-phishing emails containing ZIP archives. Within these archives is a single LNK file, designed to appear innocuous. When the recipient clicks on this shortcut, it triggers a multi-stage infection process. Notably, the LNK file opens the Microsoft Edge browser, directing it to the AnyDesk website—a legitimate remote desktop application—to maintain the appearance of normalcy. Simultaneously, in the background, the LNK file downloads and executes an MSI installer from a compromised domain.

Infection Chain and Evasion Techniques

The MSI installer plays a pivotal role in the infection chain. It extracts its payload into a concealed directory path:

“`

%LOCALAPPDATA%\Temp\MW-\files.cab
“`

Within this directory, the installer decompresses its contents and places the primary command-and-control (C2) beacon at:

“`

%LOCALAPPDATA%\Microsoft\Windows\dwm.exe
“`

By naming the executable dwm.exe, the malware mimics the legitimate Windows Display Window Manager process, thereby reducing the likelihood of detection by security tools.

Bypassing Windows Defender

A critical aspect of this campaign is its method of disabling Windows Defender to facilitate uninterrupted operation. During installation, the malware executes a PowerShell command to create an exclusion path for its C2 beacon:

“`

Add-MpPreference -ExclusionPath C:\Users\admin\AppData\Local\Microsoft\Windows\dwm.exe
“`

This command effectively removes Windows Defender’s real-time scanning for the specified executable, allowing the malware to communicate freely with its C2 servers without interference.

Indicators of Compromise

The campaign’s sophistication is evident in its ability to bypass traditional detection methods through strategic file placement and process naming conventions. Security researchers identified this infection after observing Windows Installer event logs indicating Application Event ID 11708 failures. These alerts were triggered because the compromised user lacked local administrator privileges, causing the MSI deployment to fail unexpectedly. Ironically, this failure prevented full system compromise and brought the attack to the attention of defenders.

Recommendations for Mitigation

To protect against such advanced threats, organizations should implement the following measures:

1. User Education: Train employees to recognize and avoid spear-phishing attempts, especially those involving unexpected attachments or links.

2. PowerShell Monitoring: Implement monitoring for unusual PowerShell executions, particularly those involving `MpPreference` parameters, which may indicate attempts to modify Windows Defender settings.

3. Application Whitelisting: Deploy application whitelisting to prevent unauthorized modifications to security settings and to control the execution of unapproved applications.

4. Least Privilege Principle: Ensure users operate with the minimum necessary privileges to reduce the impact of potential compromises.

5. Regular Security Updates: Keep all systems and security tools updated to protect against known vulnerabilities and emerging threats.

By adopting these proactive measures, organizations can enhance their defenses against sophisticated malware campaigns like the one deploying MastaStealer.