Cybersecurity experts have uncovered a wave of malicious software packages specifically targeting MacOS users. These harmful packages, discovered on widely-used platforms like PyPI and NPM, have been meticulously analyzed to understand their sophisticated attack methods. A crucial tool in this effort is GuardDog, a CLI-based tool released in late 2022, which utilizes Semgrep and package metadata heuristics to identify malicious packages based on common patterns.
By early 2023, GuardDog had been scaled up to continuously scan PyPI, leading to the identification and manual triage of nearly 1,500 malicious packages. This extensive effort has resulted in one of the largest labeled datasets of malicious packages available to the public, according to reports from SecurityLabs. The initial lead in this investigation stemmed from a suspicious package named “reallydonothing,” published on May 9, 2024, exhibiting several telltale characteristics such as an empty description, single Python file, and command overwrite.
Detailed analysis of these malicious packages, including “reallydonothing,” “jupyter-calendar-extension,” “calendar-extender,” “ReportGenPub,” and “Auto-Scrubber,” revealed a common structure. They typically consist of a single Python file, setup.py, which is modified to execute malicious code upon installation. This code, embedded within the setup process, searches for specific file patterns on the local system and initiates further malicious actions if certain conditions are met, such as downloading and executing a second-stage binary. This discovery underscores the importance of vigilance and robust security measures in combating evolving cyber threats targeting MacOS users.