Home » Technology » GitHub Malware: Linux Wiper Found in Go Modules

GitHub Malware: Linux Wiper Found in Go Modules

Linux servers Under Attack: Disk-Wiping Malware in Go Modules

CAPITAL — May 9, 2024 — A sophisticated supply-chain attack is currently targeting Linux servers, unleashing disk-wiping malware through malicious Go modules on GitHub. Detected last month, the campaign utilizes three carefully crafted modules designed to execute destructive payloads. This attack can lead to irreversible data loss and system failure.As experts in cybersecurity, we explain further.

video-container">

Linux Servers Under Attack: Disk-Wiping Malware Hidden in Go Modules

A complex supply-chain attack is targeting Linux servers, deploying disk-wiping malware through malicious Golang modules published on GitHub. This campaign, detected last month, leverages three carefully crafted Go modules containing highly obfuscated code designed too retrieve and execute remote payloads.

The Destructive Payload: complete Disk Destruction

The attack is specifically engineered for linux-based servers and developer environments. The destructive payload, a Bash script named done.sh, employs the ‘dd’ command to overwrite the entire disk wiht zeroes. This process leads to irreversible data loss and system failure.

Before execution, the payload verifies it is indeed running within a linux environment (runtime.GOOS == “linux”). This check ensures the malware targets the intended systems.

According to an analysis by Socket, a supply-chain security company, the command overwrites every byte of data on the primary storage volume, /dev/sda. This volume typically houses critical system data, user files, databases, and configurations.

Did you know? The ‘dd’ command, short for “disk destroyer,” is a powerful Unix utility used for copying and converting data. In this attack, it’s misused to overwrite the entire disk with zeros, effectively wiping it clean.

By populating the entire disk with zeros, the script fully destroys the file system structure, operating system, and all user data, rendering the system unbootable and unrecoverable.

Socket

Compromised Go Modules

Researchers discovered the attack in April, identifying three malicious Go modules on GitHub. These modules have sence been removed from the platform:

  • github[.]com/truthfulpharm/prototransform
  • github[.]com/blankloggia/go-mcp
  • github[.]com/steelpoor/tlsproxy

Each module contained obfuscated code that, when decoded, revealed commands using ‘wget’ to download the malicious data-wiping script (either /bin/bash or /bin/sh).

Socket researchers noted that the payloads are executed immediately after download, leaving virtually no time for response or recovery.

pro Tip: Regularly audit your project dependencies and use tools that scan for known vulnerabilities in open-source packages. Early detection can prevent supply chain attacks.

The malicious Go modules appear to have impersonated legitimate projects:

  • Prototransform: A project for converting message data to various formats.
  • go-mcp: A Go implementation of the Model Context Protocol.
  • tlsproxy: A TLS proxy tool providing encryption for TCP and HTTP servers.

The Go Ecosystem: A Vulnerable Landscape

Socket researchers warn that even minimal exposure to these destructive modules can lead to complete data loss.

The decentralized nature of the Go ecosystem, lacking robust checks, allows packages from different developers to share similar names. Attackers exploit this by creating module namespaces that appear legitimate, waiting for developers to integrate the malicious code into their projects.

FAQ: Protecting Your Linux Servers

What is a supply chain attack?
A supply chain attack targets vulnerabilities in the software growth and distribution process to compromise systems.
How can I protect my Linux servers from this type of attack?
Regularly audit dependencies, use vulnerability scanning tools, and verify the authenticity of Go modules before integrating them into your projects.
What should I do if I suspect my server has been compromised?
Immediately disconnect the server from the network, perform a thorough forensic analysis, and restore from a known good backup.

Mitigation Strategies

  • Implement strict dependency management policies.
  • Regularly scan for vulnerabilities in your go modules.
  • Verify the authenticity and integrity of third-party packages.
  • Use a reputable supply chain security tool to monitor your dependencies.
  • Maintain regular backups of your critical data.

You may also like

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.