Article Details
Scrape Timestamp (UTC): 2024-11-09 15:18:06.242
Original Article Text
Click to Toggle View
Malicious PyPI package with 37,000 downloads steals AWS keys. A malicious Python package named 'fabrice' has been present in the Python Package Index (PyPI) since 2021, stealing Amazon Web Services credentials from unsuspecting developers. According to application security company Socket, the package has been downloaded more than 37,000 times and executes platform-specific scripts for Windows and Linux. The large number of downloads is accounted by fabrice typosquatting the legitimate SSH remote server management package “fabric,” a very popular library with more than 200 million downloads. An expert explained to BleepingComputer that that fabrice remained undetected for so long because advanced scanning tools were deployed after its initial submission on PyPI, and very few solutions conducted retroactive scans. OS-specific behavior The fabrice package is designed to carry out actions according to the operating system it runs on. On Linux, it sets up a hidden directory at ‘~/.local/bin/vscode’ to store encoded shell scripts split into multiple files, which are retrieved from an external server (89.44.9[.]227). The shell scripts are decoded and granted execution permissions, letting the attacker to execute commands with user's privileges, the researchers explain. On Windows, fabrice downloads an encoded payload (base64) that is a VBScript (p.vbs) created to launch a hidden Python script (d.py). The Python script is responsible for getting a malicious executable (‘chrome.exe’) that is dropped in the victim’s Downloads folder. Its purpose is to schedule a Windows task to execute every 15 minutes, to ensure persistence across reboots. AWS credentials theft Regardless of the operating system, the primary goal of fabrice is to steal AWS credentials using ‘boto3,’ the official Python SDK for Amazon Web Services, allowing interaction and session management with the platform. Once a Boto3 session is initialized, it automatically pulls AWS credentials from the environment, instance metadata, or other configured sources. The attackers then exfiltrate the stolen keys to a VPN server (operated by M247 in Paris), which makes tracing the destination more difficult. Mitigating the risk of typosquatting is possible when users check the packages downloaded from PyPI. Another option are tools specifically created to detect and block such threats. In terms of protecting AWS repositories from unauthorized access, admins should consider AWS Identity and Access Management (IAM) to manage permissions to the resources.
Daily Brief Summary
A malicious Python package named 'fabrice' has been detected on the Python Package Index (PyPI), impersonating the popular 'fabric' package.
'fabrice' has accumulated over 37,000 downloads since its release in 2021, aiming to steal Amazon Web Services (AWS) credentials.
The malware exhibits OS-specific behaviors; on Linux, it stores encoded shell scripts in a hidden folder, and on Windows, it downloads a malicious VBScript.
The primary function of 'fabrice' is to exploit the Python SDK for AWS ('boto3') to extract AWS credentials and send them to a server using a VPN.
The stolen credentials are harder to trace because they are exfiltrated to a VPN server in Paris.
Experts suggest the package went undetected due to lack of retroactive scans by security tools post its initial submission to PyPI.
Mitigation strategies include diligent verification of package sources on PyPI and employing tools that can identify and neutralize such threats, alongside using AWS IAM for securing AWS resources.