Join our Newsletter — 33% off our NHI Course
Home› Guides› XWorm RAT Guide: Delivery Chains, Persistence and Detection…
Guide Attack Techniques & Malware

XWorm RAT Guide: Delivery Chains, Persistence and Detection for Defenders

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 14 November 2026 14 min read
On this page

XWorm is a cheap, modular remote access trojan that has become one of the most frequently seen commodity RATs, and its operators reach endpoints through script-heavy delivery chains that many email and endpoint controls still let through. First observed in 2022 and sold as malware-as-a-service, it gives an operator remote control, credential theft, keylogging, clipboard hijacking and optional ransomware and denial of service modules. This guide explains how XWorm versions and leaked builders evolved, the delivery chains researchers have documented, its persistence and stealth behaviour, and the detections and controls that stop it. It is written for SOC analysts, detection engineers, incident responders and email and endpoint engineers. It is strictly defensive: no builder, configuration or payload detail. For the older families XWorm is often compared with, see the AsyncRAT, Remcos and njRAT Commodity RATs Guide; this page does not repeat that material.

Key takeaways

  • Leaks multiplied the threat. Trellix reports the original developer disappeared after version 5.6 in late 2024, then a V6.0 appeared in June 2025, was cracked within weeks, and a modified V6.4 builder and source code leaked in August 2025, so many unrelated operators now run variants.
  • Scripts carry the infection. Researchers document JavaScript, VBScript, WSF, batch, LNK and HTA files, password-protected archives and ClickFix paste-and-run pages leading to in-memory PowerShell loaders.
  • Trusted .NET binaries host the payload. Several analyses show XWorm injected into signed utilities such as RegSvcs.exe or a .NET compiler, so a legitimate process making an outbound connection is a key signal.
  • It rarely arrives alone. Cofense found 78% of XWorm campaigns delivered other malware families as well, so finding XWorm should open a hunt for a second RAT or stealer.
  • Every infection is a credential and session incident. Browser credentials, session cookies, chat tokens and crypto wallets are targeted, and Trellix documents a reset-survival persistence method, so response must cover identities and recovery partitions, not only the host image.

What XWorm is (names, versions and supply model)

XWorm is a .NET remote access trojan sold through underground markets. MITRE ATT&CK v20 has no software entry for it, so map detections to technique IDs rather than a family ID, and treat vendor names such as "XWorm V6" as labels for configuration and builder versions, not for a single actor. Trellix cites an average price of about $500 for a lifetime subscription and reports that ANY.RUN ranked XWorm third in its 2025 report, ahead of Remcos and Agent Tesla; that ranking is ANY.RUN's sandbox data, not a census of infections.

PeriodDevelopmentSource
2022XWorm first observed and offered for saleTrellix, Netskope, Logpoint
September 2024V5.6 analysed with WSF and PowerShell delivery and Telegram notification of new victimsNetskope Threat Labs
Late 2024Original developer deletes their account after V5.6; cracked and trojanised builders spreadTrellix
4 June 2025A new account posts V6.0 on a hacking forum; authenticity questionedTrellix
27 June 2025Cracked V6.0 builder releasedTrellix
24 August 2025Modified V6.4 builder and VB.NET source leak, adding rootkit and reset-survival pluginsTrellix
March 2026V6.4 and V7.x campaigns using invoice and packing list lures, and Discord-distributed archivesSANS ISC, Trellix

Two consequences follow. First, the builder leak means the same family appears in campaigns of very different skill, from basic batch-file droppers to steganography and in-memory loaders. Second, Trellix notes that some builders circulating on malware repositories are themselves infected with XWorm, which matters for any researcher or red team tempted to obtain one: do not.

Delivery chains

XWorm's delivery varies more than its core behaviour, which is why detection should anchor on the stages that repeat. Cofense counted 22 distinct delivery mechanisms in the campaigns it tracked.

ChainHow it works (defender view)Reported byBest control point
Email attachment with scriptZIP containing JavaScript or WSF, often an invoice, quotation or packing list lure; wscript.exe downloads or decodes a PowerShell stage; a decoy PDF may openTrellix, Netskope, SANS ISCGateway blocking of script files in archives; default-open script files in Notepad
Batch and password-protected archivesBatch scripts were the most common mechanism (18%); password-protected archives and legitimate files bundled with the payload each about 17%CofenseDetonation of archives with passwords in the email body; block batch files from mail and downloads
LNK to WebDAVShortcut files that open a WebDAV share through File Explorer; 94% of German-language campaigns Cofense sawCofenseBlock LNK from mail; monitor WebDAV client traffic
ClickFix paste-and-runA fake verification page copies a PowerShell command and tells the user to paste it into the Run dialog; about 4% of Cofense's campaigns; Microsoft lists XWorm among ClickFix payloadsMicrosoft, Cofense, LogpointRestrict the Run dialog and PowerShell for standard users
SteganographyImages carrying an embedded DLL extracted by a script, about 11% of campaignsCofenseBehaviour detection on the script stage, not file scanning
Weaponised archives on chat platformsArchives posing as game mods on Discord abusing WinRAR path traversal CVE-2025-8088, which is in the CISA KEV catalogueTrellixUpdate WinRAR to 7.13 or later; inventory archive tools

For the paste-and-run pattern in depth, see the ClickFix and Fake CAPTCHA Paste-and-Run Attacks Guide. For shortcut abuse, see the Malicious LNK Files Guide.

Capabilities and plugin architecture

Trellix describes a core client that loads plugins as in-memory DLLs, caching them compressed in the registry under a key derived from host attributes. Capabilities reported across the analyses include:

  • Remote control: remote desktop, a hidden command shell, file manager and hidden VNC (HVNC) sessions that operate without a visible desktop.
  • Surveillance: keylogging to a hidden file in %TEMP%, screenshots, webcam capture and clipboard monitoring, including "clipper" behaviour that swaps cryptocurrency addresses.
  • Credential theft: passwords and cookies from browsers (including plugins aimed at Chromium app-bound encryption), mail and FTP clients, Wi-Fi profiles, Discord and Telegram tokens and crypto wallets.
  • System manipulation: hosts file rewriting (which redirects DNS lookups on the host), service and startup management, UAC bypass and power control.
  • Disruption: denial of service floods and a ransomware plugin that encrypts files with an .ENC extension, drops a "How To Decrypt" note and changes the wallpaper.
  • Stealth: AMSI bypass before the payload runs, protected plugins, WMI checks for security products and virtual machines, and in the leaked V6.4 a rootkit plugin that hides processes.

Netskope also observed a V5.6 loader sending a Telegram message with the victim's public IP address to the operator. Because XWorm steals Telegram and Discord tokens and can use Telegram for notifications, review bot and token hygiene too. See the Discord and Telegram Bot Tokens Security Guide.

Techniques mapped to MITRE ATT&CK

ATT&CK v20 has no XWorm entry, so the mapping below is based on the behaviours vendors document, matched to verified v20 technique IDs. Use it for detection coverage, not for attribution.

StageTechnique (ATT&CK v20)Observed behaviourTelemetry
Initial accessT1566.001 Spearphishing Attachment; T1566.002 Spearphishing LinkArchives with scripts; links to archives and fake verification pagesEmail gateway, proxy
ExecutionT1204.002 Malicious File; T1204.004 Malicious Copy and Paste; T1059.007 JavaScript; T1059.005 Visual Basic; T1059.001 PowerShellwscript.exe or the Run dialog launching PowerShell with bypass flags and encoded contentProcess creation, PowerShell 4104, RunMRU registry
PersistenceT1547.001 Registry Run Keys / Startup Folder; T1053.005 Scheduled Task; T1037.001 Logon Script (Windows)HKCU Run entries, Startup copies, tasks repeating every 15 minutes, UserInitMprLogonScriptRegistry events, Event 4698
StealthT1620 Reflective Code Loading; T1055.012 Process Hollowing; T1218.009 Regsvcs/Regasm; T1027.003 Steganography; T1497.001 System ChecksIn-memory .NET loading, hollowing into RegSvcs.exe or a .NET compiler, sandbox checksEDR memory and injection alerts
Defence impairmentT1685 Disable or Modify Tools; T1686 Disable or Modify System FirewallDefender preference changes, firewall disabled, AMSI patchingDefender operational log, firewall events
Credential accessT1555.003 Credentials from Web Browsers; T1539 Steal Web Session Cookie; T1056.001 KeyloggingBrowser stores, cookies, chat tokens, keystrokesFile access by non-browser processes
CollectionT1113 Screen Capture; T1125 Video Capture; T1115 Clipboard DataScreenshots, webcam, clipboard and wallet address swappingEDR API and device access
Command and controlT1571 Non-Standard Port; T1568 Dynamic Resolution; T1102 Web ServicePersistent TCP sessions to dynamic DNS names on varying high ports; paste sites and Telegram for staging and notificationsFirewall, DNS, proxy
ImpactT1486 Data Encrypted for Impact; T1498.001 Direct Network FloodOptional ransomware plugin; DoS floods from the hostFile rename bursts, outbound volume

Detection engineering

Network indicators change with every operator, and Cofense notes traffic varies between infections, so build detections on behaviour. These are the signals with the best yield, roughly in chain order.

  1. Script host to PowerShell: wscript.exe, cscript.exe or mshta.exe spawning powershell.exe, especially with execution policy bypass or encoded commands. Enable PowerShell Script Block Logging (Event 4104) and Module Logging, and remove PowerShell v2, as Logpoint recommends.
  2. Run dialog abuse: new RunMRU values containing powershell, mshta or download cmdlets written by explorer.exe, which Microsoft uses to find ClickFix execution.
  3. Trusted .NET utilities misbehaving: RegSvcs.exe, RegAsm.exe, InstallUtil.exe or Aspnet_compiler.exe running from user folders, as a child of a script or PowerShell, or making outbound connections.
  4. Persistence in user-writable paths: Run keys, Startup items, logon scripts and scheduled tasks pointing to AppData, ProgramData or Temp; tasks repeating every few minutes.
  5. Recovery partition changes: new files in C:\Recovery\OEM or a new ResetConfig.xml on an endpoint, which Trellix ties to reset-survival persistence.
  6. Beacon pattern: long-lived TCP sessions from an unsigned or .NET process to a dynamic DNS name or raw IP on a high port with keepalives every few seconds; Netskope saw 10 to 15 second intervals.
  7. Telegram and paste sites from non-browsers: api.telegram.org or paste site requests from PowerShell, wscript.exe or .NET utilities.
  8. Defence tampering: Defender exclusions added or real-time protection changed, and the Windows Firewall disabled across profiles.

Use a sandbox to extract configurations from samples rather than reverse engineering by hand; SANS ISC recommends this for the obfuscated JavaScript stage. See the EDR Telemetry Guide and the Sigma Rules Guide.

Metrics: percentage of endpoints with script block logging enabled; percentage of mail flow where script and LNK attachments are blocked; median time from first script-host alert to isolation; number of XWorm-family detections where a second family was also found; percentage of confirmed infections followed by credential and session revocation within 24 hours.

Prevention and hardening

ControlSpecific setting or actionChains it breaks
Email filteringBlock or detonate JS, VBS, WSF, BAT, HTA, LNK, ISO, IMG and VHD attachments and the same types inside archives, including password-protected onesAttachment, batch, LNK
Script defaultsAssociate .js, .vbs and .wsf with Notepad; restrict Windows Script Host for standard usersJavaScript and VBScript loaders
Attack surface reductionMicrosoft ASR rules: block execution of potentially obfuscated scripts; block JavaScript or VBScript from launching downloaded executable content; block executables that do not meet prevalence, age or trusted list criteriaScript loaders, droppers
Run dialog and paste controlsRemove Run from the Start menu and disable Win+R by Group Policy for users who do not need it; enable the Windows Terminal multi-line paste warningClickFix
PowerShell policyAllSigned or RemoteSigned execution policy, Constrained Language Mode through application control, PowerShell v2 removedPowerShell stages
Application controlBlock execution from AppData, Temp and Downloads; restrict signed .NET utilities that users do not needPayload launch, LOLBin hosting
Protective DNS and egressBlock newly registered and dynamic DNS domains, paste sites and Telegram API from servers and non-browser processes; restrict outbound high portsC2 and staging
Patching third-party toolsBring archive utilities into patch management; WinRAR 7.13 or laterArchive path traversal

Rollout:

  1. Turn on script block logging and process command line auditing everywhere first: it costs little and gives you visibility for every later step.
  2. Run ASR rules and script restrictions in audit mode on a pilot ring for two to four weeks, review which business scripts would break, and add narrow exclusions.
  3. Enforce on the pilot, then on broader rings; keep the audit data to justify each exclusion. Roll back an individual rule to audit mode if it breaks a critical process, rather than disabling the whole policy.
  4. Apply email attachment blocking and Run dialog restrictions with communication to users and a fast exception route.
  5. Add egress and protective DNS controls, starting with servers and kiosks where non-browser internet access is rarely legitimate.

Decision guidance: a small organisation without a SOC gets most value from attachment blocking, Notepad as the default script handler, ASR rules or an equivalent EDR policy, and a managed detection service. Larger organisations should add application control, Run dialog restrictions for standard users, and the behaviour detections above. Developers and IT staff who need PowerShell should be a separate policy ring with stronger logging rather than an exemption from controls. See the PowerShell Security Guide and the Application Allowlisting Guide.

Responding to an XWorm infection

  • Contain: isolate the host through EDR and block the C2 destination at the egress point. Capture memory before rebooting if you can, because the payload lives in memory.
  • Scope: search for the same parent script, task names and RegSvcs or .NET compiler network activity across the estate, and look for a second family, since most campaigns bundle one.
  • Revoke identities: reset passwords used on the host, revoke browser sessions and refresh tokens, rotate Discord, Telegram and other API or bot tokens, and move any crypto wallet funds to new keys. See the Infostealer Logs and Session Token Abuse Guide.
  • Eradicate fully: remove Run keys, tasks, logon scripts and Startup items; check C:\Recovery\OEM before trusting a factory reset; reimage from known-good media.
  • If the ransomware plugin ran: treat it as a ransomware incident with backup restoration and notification review. See the Ransomware Response and Recovery Guide.

Framework mapping

DefenceNIST SP 800-53 Rev. 5NIST CSF 2.0CIS Controls v8.1ISO/IEC 27001:2022 Annex A
Email and attachment filteringSI-8, SI-3PR.PS-05Control 9 Email and Web Browser ProtectionsA.8.7
Application and script controlCM-7, CM-11PR.PS-05Control 2 Inventory and Control of Software AssetsA.8.19
Endpoint detection and loggingSI-4, AU-12DE.CM-01Control 8 Audit Log Management, Control 10 Malware DefensesA.8.15, A.8.16
User awareness for paste-and-run luresAT-2PR.AT-01Control 14 Security Awareness and Skills TrainingA.6.3
Incident handling and credential revocationIR-4RS.MA-01Control 17 Incident Response ManagementA.5.26

Common failure patterns

  • Hash and IP blocking as the main defence: builder leaks mean every operator has new hashes and infrastructure; behaviour detections last longer.
  • Reimaging without revoking sessions: stolen cookies and tokens let the operator back into SaaS accounts after the laptop is clean.
  • Stopping at the first family: closing the case after removing XWorm when a bundled stealer or second RAT is still running.
  • Trusting a factory reset: reset-survival persistence in the recovery folder can reinstall the payload.
  • Exempting technical users: broad PowerShell and script exemptions for IT and developers leave the highest-value accounts with the weakest controls.
  • Unmanaged archive tools: utilities outside central patching stay vulnerable long after fixes ship.

Practitioner checklist

  • Map detections to the technique table and record gaps; do not wait for an ATT&CK family entry.
  • Block script, LNK and disk image attachments, including inside archives.
  • Set Notepad as the default handler for .js, .vbs and .wsf files.
  • Enable PowerShell Script Block Logging and remove PowerShell v2.
  • Enforce ASR or equivalent EDR rules for obfuscated scripts and script-launched executables.
  • Restrict the Run dialog for standard users and alert on suspicious RunMRU entries.
  • Alert on RegSvcs, RegAsm, InstallUtil and .NET compiler processes making network connections.
  • Block Telegram API and paste sites from non-browser processes and servers.
  • Include session, token and wallet revocation and a recovery folder check in the RAT response runbook.

Standards and references

Related NHI Mgmt Group resources: AsyncRAT, Remcos and njRAT Commodity RATs Guide · ClickFix and Fake CAPTCHA Paste-and-Run Attacks Guide · Malware Statistics · Remote Access Trojans (RATs) Guide · Malware Loaders and Droppers Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.