Introduction
Attack Details
Technical Analysis
setup.py
Oxzy.exe
and update.exe
SearchProtocolHost.exe
in PersistenceImpact and Implications
Detection and Prevention
Conclusion
Appendices
In early January 2023, a malicious actor using the pseudonym “Lolip0p” launched a covert attack on the Python Package Index (PyPi) by uploading three fake packages under the names ‘libhttps,’ ‘httpslib,’ and ‘colorslib’. These names closely mirrored legitimate packages on PyPi, one of the primary sources for Python developers to access and manage external libraries. Between January 7 and January 12, these fraudulent packages went live, drawing in unsuspecting developers seeking to use popular packages with authentic-sounding names.
To appear legitimate and avoid raising suspicions, “Lolip0p” crafted convincing project descriptions and kept the feature lists concise, mirroring the styles often seen in genuine PyPi listings. This strategic move made it challenging for developers to detect any red flags while browsing through the library. As a result, by the time PyPi detected and removed the packages on January 14, they had already been downloaded over five hundred times.
This incident is a crucial reminder for developers to remain vigilant, even on trusted repositories like PyPi, as cyber attackers continue to employ sophisticated techniques to infiltrate widely used systems. Although the malicious packages are no longer available, the “Lolip0p” incident underscores the importance of verifying package authenticity and staying informed on best practices for secure coding environments.
libhttps |
Version 4.6.12 |
|
httpslib |
Version 4.6.9 Version 4.6.11 |
|
colorslib |
Version 4.6.11 Version 4.6.12 |
The recent PyPi breach orchestrated by an attacker known as “Lolip0p” involved more than just cleverly named packages; it showcased a sophisticated approach to delivering malware to unsuspecting users. Each of the three fake packages—‘libhttps,’ ‘httpslib,’ and ‘colorslib’—contained modified scripts hidden in their setup.py installer files, which, upon inspection, revealed a deeply malicious intent.
The setup.py file is typically an innocuous script used for installing package dependencies. However, in this case, Lolip0p embedded a command that triggered a subprocess to open PowerShell and download a hidden malware file named Oxzy.exe. Once downloaded, the script promptly renamed it to WindowsCache.exe, adding another layer of stealth to avoid detection by antivirus software. Using the Invoke-Expression command in PowerShell, the malware then executed, launching a dangerous program designed to steal sensitive information from the user’s browser.
This cleverly hidden malware underscores the growing sophistication of supply chain attacks, where hackers target commonly used software repositories. By slipping malware into repositories like PyPi, attackers aim to reach a broad audience of developers. In this case, the malware had a specific focus on browser information theft, likely targeting stored credentials, cookies, and browsing history.
For developers and organizations, this incident emphasizes the need for rigorous code inspection, even within trusted libraries. Here are a few tips to stay safe when downloading Python packages:
The “Lolip0p” incident serves as a stark reminder of the ongoing cybersecurity risks within open-source ecosystems. By adopting a cautious approach, developers can better protect their projects and systems against similar malicious threats.
URL |
https://dl(.)dropbox(.)com/s/mkd3enun97s8zag/Oxzy(.)exe?dl=0 |
SHA256 |
8dc8a9f5b5181911b0f4a051444c22e12d319878ea2a9eaaecab9686e876690b |
File Size |
3.97 MB (4164303 bytes) |
https://www.figma.com/design/3W67uAtZyiv4PJQNjwfHue/Hubspot-Log-Management-landing-page?node-id=1-7&t=LFvPtM22C4WI5jfc-1https://www.figma.com/design/3W67uAtZyiv4PJQNjwfHue/Hubspot-Log-Management-landing-page?node-id=1-7&t=LFvPtM22C4WI5jfc-1https://www.figma.com/design/3W67uAtZyiv4PJQNjwfHue/Hubspot-Log-Management-landing-page?node-id=1-7&t=LFvPtM22C4WI5jfc-1https://www.figma.com/design/3W67uAtZyiv4PJQNjwfHue/Hubspot-Log-Management-landing-page?node-id=1-7&t=LFvPtM22C4WI5jfc-1
Trojan malware often acts as a hidden entry point for attackers, allowing them to access sensitive user data, execute remote commands, and even grant persistent backdoor access. This makes it a dangerous addition to any system, capable of compromising personal and organizational security. With update.exe installed, the attacker gains a foothold on the infected machine, potentially leading to data theft, remote monitoring, and further propagation of malicious software.
This incident underscores the layered complexity of modern malware attacks and highlights the importance of several proactive security measures:
The “Lolip0p” attack is a potent reminder of the ongoing threats in the software supply chain, particularly in widely used repositories like PyPi. Developers and users alike should take extra steps to verify the authenticity of packages and stay vigilant for signs of malware intrusion.
File Name |
update.exe |
SHA256 |
293a3a2c8992636a5dba58ce088feb276ba39cf1b496b336eb7b6f65b1ddb757 |
File Size |
18.60 MB (19507960 bytes) |
In a recent PyPi supply chain attack, a malicious package by the pseudonymous “Lolip0p” demonstrated advanced techniques for persistence and stealth. A key component of this malware operation is the update.exe executable, which follows a structured process for creating and storing additional files during execution. Here’s a deep dive into the technical workings of this second-stage payload.
Upon execution, update.exe initiates a series of actions that create new files within a dynamically named folder located in the Windows temporary directory:
Path of Folder Creation:
%USER%\AppData\Local\Temp\onefile_%PID_%TIME%
In this path:
The use of both the PID and EPOCH timestamp in the folder name helps the malware remain obscure and distinct from other processes. Let’s look at the components in more detail:
This naming convention serves multiple purposes:
For IT teams and cybersecurity professionals, understanding these behaviors can aid in detection and mitigation:
This targeted attack shows how malicious actors leverage dynamic file creation and naming schemes to achieve persistence, evasion, and stealth. By understanding these mechanisms, security teams can better defend against similar threats in the software supply chain.
Inside the “Lolip0p” Attack: The Malicious Role of `SearchProtocolHost.exe`
As part of the advanced tactics in the recent “Lolip0p” supply chain attack, one specific file, **`SearchProtocolHost.exe`**, plays a significant role. This executable is one of several files created by the secondary payload `update.exe`, and it has been flagged as malicious by multiple antivirus vendors due to its suspicious behavior and potential for harm. Here, we’ll explore the technical characteristics and implications of `SearchProtocolHost.exe` in this attack.
What is `SearchProtocolHost.exe`?
In legitimate Windows environments, `SearchProtocolHost.exe` is a known process responsible for indexing and managing local file searches. However, in this malware instance, the file is a **counterfeit** version, likely designed to mimic the legitimate Windows file to avoid suspicion.
Why `SearchProtocolHost.exe` Raises Red Flags
Several antivirus programs have flagged `SearchProtocolHost.exe` because of its unique and harmful properties:
Technical Behavior of `SearchProtocolHost.exe`
While each variant may behave differently, here’s an outline of potential actions attributed to the malicious `SearchProtocolHost.exe`:
- Data Exfiltration: The file can scan local files and directories, siphoning sensitive data back to the attacker’s server.
- Command and Control Communication: It may connect to external servers, receiving instructions for further malicious actions.
- Keylogging and Credential Harvesting: As with many Trojan executables, it may be programmed to capture keystrokes or access stored credentials.
Security Implications and Recommendations
The creation and deployment of `SearchProtocolHost.exe` exemplify how sophisticated threat actors exploit trusted file names to deceive users and avoid detection. To mitigate the risks posed by similar threats, consider the following best practices:
File Name |
SearchProtocolHost.exe |
SHA256 |
123fd1c46a166c54ad66e66a10d53623af64c4b52b1827dfd8a96fdbf7675638 |
File Size |
41.56 MB (43577344 bytes) |
The progression flow is illustrated in the below diagram.
Detection
DNIF is capable of detecting the execution trace of file hashes and reported filenames as Indicator of compromise (IOC) using the pivot field checking in real time.
With the integration of :
Conclusion
The findings again cautioned us that attackers and threat adversaries are using the stream of open-source package providers and taking the advantage of trusted relationships to amplify the distribution of their malware and make trusted providers a carrier.
At this stage calling it a “supply-chain” or an “exploit” is not fully correct as attack takes “Google SEO (Search Engine Optimization) squatting i.e. a kind of Typo-Squatting attack” to misguide a user on a malicious package link with an identical misspelled package name.
The users are strongly advised to exercise caution while downloading the packages from untrusted sources and authors to prevent themselves from such attacks.