Hackers Leveraging GitHub Platform for Hosting Malware

Researchers have discovered two novel techniques on GitHub: one exploits GitHub Gists, while the other involves sending commands through Git commit messages.

Malware authors will occasionally upload samples to services such as Dropbox, Google Drive, OneDrive, and Discord to host second-stage malware and avoid detection techniques.

Nevertheless, the threat research team at ReversingLabs has recently noticed a rise in the hosting of malware on the open-source development GitHub platform.

Abusing GitHub Gists

Gists is a GitHub feature that allows developers to share code snippets easily. They can be shared publicly or privately.

“Secret gists don’t show up in Discover and are not searchable unless you are logged in and are the author of the secret gist. Secret gists aren’t private. If you send the URL of a secret gist to a friend, they’ll be able to see it”, reads Gists documentation.

They never make an appearance on the author’s GitHub profile page. This enables them to be used as a form of anonymous Pastebin service, which doesn’t trigger warning signs for an attacker.

“In this incident, several PyPI packages presented themselves as libraries for handling network proxying, and contained a Base64 encoded string, allegedly related to telemetry data, but containing a URL, pointing to a secret Gist”, ReversingLabs shared in a report with Cyber Security News.

To hide this string’s true purpose and make it more difficult for security technologies to flag it as suspicious, malware developers employed Base64 encoding. Before being sent over a network, binary data is frequently encoded using Base64 encoding.

Fetching and executing commands from a Base64 encoded URLFetching and executing commands from a Base64 encoded URL
Fetching and executing commands from a Base64 encoded URL

The setup.py file contained hidden malicious code. The setup tools commands were extended to implement it.

Sending Commands Through git Commit Messages

Researchers discovered a sample in the easyhttprequest PyPI package that exploits characteristics of version control systems. Once more, the malicious code was built by extending the egg_info setuptools command and concealed it within the setup.py file.

“After installation on the victim’s machine, the malicious code from this package clones a specific git repository from GitHub and checks if the “head” commit of this repository contains a commit message that starts with a specific string”, researchers said.

Fetching and executing commands from a Base64 encoded commit message

Recommendation

Developers and application security teams must be able to distinguish between harmful and legitimate packages on these platforms, as attackers are getting more proficient in their malware deployment. 

For this reason, software developers should make use of cutting-edge tools that use intricate binary analysis to offer complete software supply chain security.

Gurubaran

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

BFDOOR Malware Targets Organizations to Establish Long-Term Persistence

The BPFDoor malware has emerged as a significant threat targeting domestic and international organizations, particularly…

3 hours ago

Uncovering the Security Risks of Data Exposure in AI-Powered Tools like Snowflake’s CORTEX

As artificial intelligence continues to reshape the technological landscape, tools like Snowflake’s CORTEX Search Service…

3 hours ago

UNC3944 Hackers Shift from SIM Swapping to Ransomware and Data Extortion

UNC3944, a financially-motivated threat actor also linked to the group known as Scattered Spider, has…

3 hours ago

Over 2,800 Hacked Websites Targeting MacOS Users with AMOS Stealer Malware

Cybersecurity researcher has uncovered a massive malware campaign targeting MacOS users through approximately 2,800 compromised…

3 hours ago

Hackers Bypass AI Filters from Microsoft, Nvidia, and Meta Using a Simple Emoji

Cybersecurity researchers have uncovered a critical flaw in the content moderation systems of AI models…

4 hours ago

Microsoft Alerts That Default Helm Charts May Expose Kubernetes Apps to Data Leaks

Microsoft’s cybersecurity research team has issued a stark warning about the risks of using default…

4 hours ago