Cyber Security News

Beware Of Weaponized AWS Packages That Deliver Malware Via JPEG Files

Attackers hide malicious payloads deep within seemingly legitimate Python packages, where two such packages were found. One, img-aws-s3-object-multipart-copy, is a copy of a real library on GitHub. 

They modified the code to execute a hidden script, loadformat.js, which is likely to download and run additional malware. This suggests a sophisticated attacker with malicious intent. 

Code addition to the otherwise legitimate index.js

An attacker hides malicious code within an image file, which iterates through each byte of the image, and if the byte value corresponds to a printable ASCII character (between 32 and 126), it’s converted and stored in a variable. 

Non-printable characters are discarded unless a certain number of printable characters have already been collected, triggering a potential exploit, which suggests that the hidden code can be embedded within the image without disrupting its functionality.

Protect Your Business Emails From Spoofing, Phishing & BEC with AI-Powered Security | Free Demo

The code analyzes an image file and potentially executes embedded code, and if the image file size is greater than 2000 bytes, a variable is set to trigger the execution of hidden code extracted from the image. 

convertertree will be set to true

This extracted code is then combined with the provided libraries (https, exec, and os) into a new function and executed; while the snippet doesn’t reveal the functionality of the hidden code, its execution suggests potential malicious intent. 

The code snippet analyzes three image files (logo1.jpg, logo2.jpg, and logo3.jpg), but only logo2.jpg (the Microsoft logo) triggers malicious behavior, which registers the infected machine with a remote server (85.208.108.29) using hostname and OS information. 

It appears as logo1.jpg in the package

Then, it establishes a loop to fetch commands from the server and execute them periodically.

The commands can include changing a directory (“cd”) or running arbitrary code with the “exec” function. The execution results are then posted back to the server.  

The code establishes a connection with a remote command-and-control server (C2) at the IP address 85.208.108.29, which transmits basic system information, including hostname and operating system details, during the initial registration.

Subsequently, it sets a recurring timer to fetch commands from the C2 every 5 seconds (0x1388 milliseconds).

sending client information to 85.208.108.29

Downloaded commands are executed locally on the compromised device, and the resulting output is sent back to the attacker through the “/post-results?clientId=<targetClientInfoName>” endpoint

According to Phylum, the code snippet facilitates a persistent communication channel for receiving and executing malicious commands from a remote attacker. 

Two reported malicious packages remained available on npm for an extended period, highlighting the limitations of current detection systems and the growing threat landscape within open-source ecosystems. 

The rise in sophisticated and prevalent malicious packages necessitates heightened developer and security awareness regarding the potential risks associated with open-source library consumption. 

Join our free webinar to learn about combating slow DDoS attacks, a major threat today.

Guru Baran

Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

Recent Posts

CISA Details That Hackers Gained Access to a U.S. Federal Agency Network Via GeoServer RCE Vulnerability

CISA has released a comprehensive cybersecurity advisory detailing how threat actors successfully compromised a U.S.…

43 minutes ago

Chrome High-severity Vulnerabilities Let Attackers Access Sensitive Data and Crash System

Google has issued an urgent security update for its Chrome web browser to address three…

5 hours ago

Threat Actors Breaking to Enterprise Infrastructure Within 18 Minutes From Initial Access

Cybersecurity professionals are facing an unprecedented acceleration in threat actor capabilities as the average breakout…

7 hours ago

New Malware in npm Package Steals Browser Passwords Using Steganographic QR Code

A sophisticated malware campaign has emerged in the npm ecosystem, utilizing an innovative steganographic technique…

7 hours ago

Zloader Malware Repurposed to Act as Entry Point Into Corporate Environments to Deploy Ransomware

Zloader, a sophisticated Zeus-based modular trojan that first emerged in 2015, has undergone a significant…

7 hours ago

Beware of Fake Online Speedtest Application With Obfuscated JS Codes

A sophisticated malware campaign has emerged that leverages fake online speed test applications to deploy…

12 hours ago