BambooToken Linux Malware Uses MQTT to Run Shell Commands and Steal Files

Researchers have analyzed a Linux malware sample identified as BambooToken, a backdoor that uses the MQTT messaging protocol for command-and-control (C2) communications.

The malware can collect system information, execute shell commands, browse files, upload data, and steal files from compromised Linux machines.

The analyzed sample is a stripped, statically linked 64-bit Linux ELF file with the SHA-256 hash bf0681e43f51e98fe7ec24bf73a43facc66b0feb325a3a835f8f01b2861b926e.

Its hash is listed in Black Lotus Labs’ published BambooToken Linux indicators, supporting the malware-family attribution. However, the available evidence does not independently identify the operator behind the activity.

BambooToken contains an encrypted 59-byte configuration blob that reveals its MQTT infrastructure after decoding.

The malware uses a single-byte XOR key to recover the broker hostname live-hk[.]c2iznja[.]com and a hard-coded group topic, {534E19D5-434B-4cad-A0C2-8D75E0B2FBFC}.

BambooToken Linux MQTT Backdoor

The malware connects to the MQTT broker over TCP port 2883. It creates a new UUID-like client identifier during execution, allowing the attacker to communicate with each infected system through a distinct MQTT topic.

If the connection fails, BambooToken waits 15 seconds before retrying. The malware can also run in the background using a double-fork daemonization routine.

This detaches it from the terminal, changes its working directory to /, and sets its file-creation mask to zero. Researchers did not identify a persistence mechanism that would automatically restart the malware after a reboot.

BambooToken divides its functions across separate MQTT channels. A message sent to the shared group topic with the ONLINE instruction triggers host profiling.

Commands sent to an individual client topic can launch either a shell worker or file-management worker.

The shell component listens on a topic ending in /Shell and returns results through /Shell/Resp. It accepts JSON messages containing an operation named command, then executes the supplied instruction through /bin/sh -c.

The backdoor reads command output in 1,024-byte buffers and returns it to the attacker through MQTT. While it displays a sh> prompt, it does not provide a persistent interactive terminal.

Instead, every command launches a separate shell process. Standard error is only captured if the attacker redirects it into standard output.

The file-management component uses /File and /File/Resp topics. It supports directory listing, downloading, uploading, deleting files, and stopping the worker.

Directory listings include file names, types, sizes, and timestamps. Notably, the response uses the misspelled JSON field flies, which could help defenders identify decoded BambooToken traffic.

For file theft, the malware sends victim data in 128 KB chunks. Each encrypted MQTT payload contains JSON metadata, a null byte separator, and raw file content.

Uploads work in reverse, allowing attackers to write data at a chosen path and offset. The analyzed sample did not automatically execute uploaded files, reverser said.

BambooToken uses a second XOR routine to obscure MQTT traffic with the repeating key:

+0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

Join 16,000+ SOC teams using ANY.RUN to streamline threat investigations and reduce manual effort. Explore for your team 

Varshini
Varshini
Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies..

Trending News

Related Stories