Back to Intelligence

UNC5221 (Armory Castle) Exploits Unpatched BeyondTrust Flaw — Zero-Day Detection and Containment Guide for Edge Appliance Defenders

SA
Security Arsenal Team
October 18, 2026
13 min read

Roughly seven weeks ago, researchers observed the first known intrusion by the prolific Chinese state-sponsored espionage group Armory Castle — tracked by Mandiant/Google as UNC5221 — leveraging a vulnerability in BeyondTrust remote access software that, at the time of reporting, remains unpatched. This is not a group to underestimate: UNC5221 is the same threat actor behind the mass exploitation campaigns that hit Ivanti Connect Secure and Citrix NetScaler customers, and it has a well-documented specialty in weaponizing edge and remote-access appliances for stealthy, long-dwell espionage operations.

If you operate BeyondTrust Remote Support or Privileged Remote Access — particularly internet-facing, self-hosted appliances — you should treat this as an active intrusion risk today, not a future patching exercise. When no patch exists, your defensive strategy shifts entirely to detection engineering, egress control, credential hygiene, and architectural containment. That is what this post delivers.

Technical Analysis

Affected Products

Based on current reporting, the campaign targets BeyondTrust's remote access product line. Organizations should assume exposure if they run:

  • BeyondTrust Remote Support (RS) — including self-hosted appliances exposed to the internet for vendor/technician access
  • BeyondTrust Privileged Remote Access (PRA)
  • Both physical/virtual appliances and cloud-connected deployments warrant review; internet-facing self-hosted instances are the highest-risk tier, consistent with UNC5221's historical target selection.

Threat Actor Context: Why UNC5221 Changes the Risk Calculus

UNC5221 is not opportunistic commodity noise. Its established playbook, demonstrated across the Ivanti and Citrix campaigns, includes:

  • Zero-day and N-day exploitation of internet-facing edge appliances — devices that sit on the network perimeter with broad internal reach
  • Web shell and custom malware deployment directly on the appliance filesystem, frequently in web server directories
  • Living-off-the-appliance techniques — abusing legitimate appliance binaries and management interfaces to avoid deploying obvious tooling
  • Credential and session theft, followed by pivoting into the internal network — and critically, BeyondTrust appliances hold or broker privileged credentials and session tokens, making them a force multiplier for lateral movement
  • Log tampering and anti-forensics on the appliance itself, which is why external telemetry (Syslog forwarding, network monitoring) matters more than on-box logs

A BeyondTrust compromise is arguably worse than a VPN compromise in one respect: the appliance is a privileged access management platform. A successful intrusion can expose vaulted credentials, active privileged sessions, and recordings — effectively handing the actor authenticated paths into your crown-jewel systems.

Exploitation Status

  • Confirmed active exploitation in the wild by a named nation-state actor, with the earliest observed attack approximately seven weeks prior to public reporting.
  • No patch available at time of reporting — this is functionally a zero-day condition for defenders.
  • Defenders should monitor the BeyondTrust Trust Center security advisories page and the CISA Known Exploited Vulnerabilities (KEV) catalog closely; given the confirmed exploitation, a KEV listing (which would impose a binding remediation deadline on federal agencies and serve as a strong prioritization signal for everyone else) is a realistic near-term development.

The Attack Chain (Defender's View)

While full technical details remain limited pending vendor disclosure, UNC5221's established tradecraft against comparable appliances gives us a defensible model to hunt against:

  1. Initial exploitation of the internet-facing web interface of the appliance
  2. Webshell/dropper placement in web application directories or scheduled task/cron persistence on the appliance OS
  3. Abnormal child processes spawned by the web server or appliance service processes (shells, network utilities, credential access tooling)
  4. Egress to attacker-controlled infrastructure — often low-and-slow HTTPS to cloud-hosted C2 fronted by legitimate services
  5. Credential/session harvesting from the appliance, then inbound lateral movement using legitimate remote access sessions that blend with normal admin activity

Every stage of that chain is observable if you have the right telemetry. Let's build it.

Detection & Response

Sigma Rules

These rules target the behaviors UNC5221 is known for on edge appliances, translated to observable endpoint/network telemetry. Tune host scoping to your BeyondTrust appliance and jump-server inventory before enabling at high level.

YAML
---
title: Suspicious Child Process Spawned by BeyondTrust Appliance Services
id: 3f8a2c91-7b4d-4e5a-9c61-2d8f4a1b7e93
status: experimental
description: Detects shell, network, or credential-access tooling spawned as a child of BeyondTrust web server or service processes, consistent with UNC5221 webshell post-exploitation behavior observed in edge appliance intrusions.
references:
  - https://cyberscoop.com/china-espionage-attacks-beyondtrust-zero-day-armory-castle/
  - https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/02/09
tags:
  - attack.execution
  - attack.t1059
  - attack.t1505.003
logsource:
  category: process_creation
  product: windows
detection:
  selection_parent:
    ParentImage|contains:
      - '\beyondtrust\'
      - '\bomgar\'
      - '\nginx\'
      - '\apache'
      - '\tomcat'
  selection_child:
    Image|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
      - '\pwsh.exe'
      - '\wscript.exe'
      - '\cscript.exe'
      - '\net.exe'
      - '\net1.exe'
      - '\whoami.exe'
      - '\nltest.exe'
      - '\rundll32.exe'
      - '\certutil.exe'
      - '\bitsadmin.exe'
  condition: selection_parent and selection_child
falsepositives:
  - Legitimate BeyondTrust support technician sessions running diagnostics — validate against approved session recordings before dismissing
level: high
---
title: Webshell Dropped in Web Server Content Directory
id: 9c1e7b52-3a6f-4d48-b2e7-5f0c3d9a8e21
status: experimental
description: Detects creation of script files in web server content or temporary directories, matching UNC5221's known webshell deployment pattern on compromised edge appliances (Ivanti/Citrix campaigns).
references:
  - https://cyberscoop.com/china-espionage-attacks-beyondtrust-zero-day-armory-castle/
  - https://attack.mitre.org/techniques/T1505/003/
author: Security Arsenal
date: 2026/02/09
tags:
  - attack.persistence
  - attack.t1505.003
logsource:
  category: file_event
  product: windows
detection:
  selection_path:
    TargetFilename|contains:
      - '\inetpub\wwwroot\'
      - '\www\'
      - '\htdocs\'
      - '\webapps\'
      - '\nginx\html\'
      - '\temp\'
      - '\tmp\'
  selection_ext:
    TargetFilename|endswith:
      - '.aspx'
      - '.ashx'
      - '.jsp'
      - '.php'
      - '.cgi'
      - '.pl'
  filter_service_accounts:
    User|contains:
      - 'BeyondTrust'
      - 'bomgar'
  condition: selection_path and selection_ext and not filter_service_accounts
falsepositives:
  - Legitimate application updates or hotfix deployments — correlate with change windows and vendor update packages
level: high
---
title: BeyondTrust Appliance Initiating Outbound Connection to Rare External Host
id: 5d2a8f14-6c9b-4e37-a1d4-8b3f6c2e5094
status: experimental
description: Detects BeyondTrust/bomgar processes making outbound network connections to non-BeyondTrust infrastructure, consistent with C2 egress from a compromised appliance.
references:
  - https://cyberscoop.com/china-espionage-attacks-beyondtrust-zero-day-armory-castle/
  - https://attack.mitre.org/techniques/T1071/001/
author: Security Arsenal
date: 2026/02/09
tags:
  - attack.command_and_control
  - attack.t1071.001
logsource:
  category: network_connection
  product: windows
detection:
  selection_image:
    Image|contains:
      - '\beyondtrust\'
      - '\bomgar\'
  selection_port:
    DestinationPort:
      - 443
      - 80
  filter_vendor:
    DestinationHostname|contains:
      - '.beyondtrust.com'
      - '.bomgar.com'
      - '.microsoft.com'
      - '.windowsupdate.com'
  condition: selection_image and selection_port and not filter_vendor
falsepositives:
  - Third-party integrations (ticketing, IdP) — whitelist known integration endpoints by hostname
level: medium

KQL — Microsoft Sentinel / Defender Hunting

This query hunts for process execution anomalies on hosts associated with BeyondTrust infrastructure, plus rare outbound destinations — the two highest-fidelity signals for appliance post-exploitation. Run it across a minimum 60-day lookback to cover the known seven-week activity window.

KQL — Microsoft Sentinel / Defender
// Hunt: UNC5221 post-exploitation behavior on/near BeyondTrust infrastructure
// Lookback covers the reported ~7 week activity window
let Lookback = 60d;
let BTAssets = (DeviceNetworkEvents
    | where TimeGenerated > ago(Lookback)
    | where RemoteUrl has_any ("beyondtrust.com", "bomgar.com") or InitiatingProcessFileName has_any ("beyondtrust", "bomgar")
    | summarize by DeviceName);
// 1. Suspicious child processes from web service or BeyondTrust processes
DeviceProcessEvents
| where TimeGenerated > ago(Lookback)
| where DeviceName in (BTAssets)
| where InitiatingProcessFileName has_any ("beyondtrust", "bomgar", "nginx", "httpd", "tomcat", "w3wp")
   or FileName has_any ("beyondtrust", "bomgar")
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "net.exe", "whoami.exe",
     "nltest.exe", "certutil.exe", "bitsadmin.exe", "rundll32.exe", "wscript.exe", "cscript.exe")
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
     FileName, ProcessCommandLine, AccountName, SHA256
| sort by TimeGenerated desc;
// 2. Rare outbound destinations from BeyondTrust-associated devices
let CommonDest = todynamic(["beyondtrust.com", "bomgar.com", "microsoft.com", "windowsupdate.com", "digicert.com"]);
DeviceNetworkEvents
| where TimeGenerated > ago(Lookback)
| where DeviceName in (BTAssets)
| where RemoteIPType == "Public"
| where not(RemoteUrl has_any (CommonDest))
| summarize ConnectionCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
    by DeviceName, RemoteUrl, RemoteIP, RemotePort, InitiatingProcessFileName
| where ConnectionCount < 20   // low-and-slow C2 heuristic
| sort by FirstSeen asc;

If your BeyondTrust appliance forwards Syslog (it should — configure this immediately if it doesn't), ingest it into CommonSecurityLog or Syslog and hunt for authentication anomalies and unexpected admin actions:

KQL — Microsoft Sentinel / Defender
// Hunt: Anomalous administrative activity in BeyondTrust appliance Syslog
Syslog
| where TimeGenerated > ago(60d)
| where Computer has_any ("beyondtrust", "bomgar") or Facility == "local4"
| where SyslogMessage has_any ("login", "session", "config", "backup", "download", "export")
| extend SrcIP = extract(@"src=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})", 1, SyslogMessage)
| summarize EventCount = count(), Actions = make_set(SyslogMessage, 20) by Computer, SrcIP, bin(TimeGenerated, 1h)
| where EventCount > 50 or array_length(Actions) > 10
| sort by TimeGenerated desc;

Velociraptor VQL — Endpoint Forensics on Jump Servers and Integration Hosts

If you suspect compromise, use Velociraptor on Windows hosts that integrate with or administer the BeyondTrust platform to identify webshell-like artifacts, suspicious processes, and unexpected persistence established after the initial activity window.

VQL — Velociraptor
-- Hunt for webshell-style artifacts and suspicious processes on BeyondTrust-adjacent hosts
SELECT Pid, Name, CommandLine, Exe, Username, CreateTime
FROM pslist()
WHERE CommandLine =~ '(beyondtrust|bomgar)'
   OR Exe =~ '(nginx|httpd|tomcat|w3wp)'
   OR CommandLine =~ '(certutil|bitsadmin|rundll32).*(http|https)'
VQL — Velociraptor
-- Sweep web content and temp directories for recently created script files (potential webshells)
SELECT FullPath, Size, Mtime, Ctime
FROM glob(globs=[
  'C:/inetpub/wwwroot/**/*.aspx',
  'C:/inetpub/wwwroot/**/*.ashx',
  'C:/**/webapps/**/*.jsp',
  'C:/Windows/Temp/**/*.aspx',
  'C:/Windows/Temp/**/*.jsp',
  'C:/ProgramData/**/*.jsp'
])
WHERE Ctime > '2025-12-15'
ORDER BY Ctime DESC

Remediation and Hardening Script

No vendor patch exists at time of writing, so this script focuses on exposure verification and compensating hardening for self-hosted BeyondTrust RS/PRA appliances and their adjacent infrastructure. Run the Bash portion from a management host with API/SSH access to the appliance; run the PowerShell portion on Windows jump boxes and integration servers.

Bash / Shell
#!/bin/bash
# BeyondTrust RS/PRA exposure and integrity verification
# Run from a management host with access to the appliance

APPLIANCE="https://your-appliance-hostname"
OUT="bt_audit_$(date +%Y%m%d).log"

echo "=== BeyondTrust Appliance Exposure Audit $(date) ===" | tee "$OUT"

# 1. Confirm appliance version and check against latest vendor advisory
echo "[+] Querying appliance version..." | tee -a "$OUT"
curl -sk "${APPLIANCE}/api/version" | tee -a "$OUT"
echo "[!] Compare against https://www.beyondtrust.com/trust-center/security-advisories" | tee -a "$OUT"

# 2. Verify Syslog forwarding is enabled (external telemetry is critical —
#    UNC5221 is known to tamper with on-box logs)
echo "[+] Checking remote Syslog configuration (expect a configured remote host)..." | tee -a "$OUT"
ssh admin@your-appliance-hostname 'cat /etc/rsyslog.conf 2>/dev/null | grep -v "^#" | grep "@"' | tee -a "$OUT"

# 3. Enumerate unexpected files in web content directories modified in the last 90 days
echo "[+] Scanning web directories for recently modified files..." | tee -a "$OUT"
ssh admin@your-appliance-hostname 'find /var/www /usr/share/nginx /opt -name "*.jsp" -o -name "*.php" -o -name "*.cgi" 2>/dev/null | xargs ls -la 2>/dev/null | awk "{print \$6,\$7,\$8,\$9}"' | tee -a "$OUT"

# 4. Check for unexpected listening ports and outbound connections
echo "[+] Active listeners and established outbound connections..." | tee -a "$OUT"
ssh admin@your-appliance-hostname 'ss -tlnp; echo "---ESTABLISHED---"; ss -tnp state established' | tee -a "$OUT"

# 5. Review recent admin logins for impossible-travel or off-hours activity
echo "[+] Recent authentication events..." | tee -a "$OUT"
ssh admin@your-appliance-hostname 'grep -i "login\|auth" /var/log/messages 2>/dev/null | tail -100' | tee -a "$OUT"

echo "[+] Audit complete. Review $OUT for anomalies." | tee -a "$OUT"
PowerShell
# BeyondTrust-adjacent Windows host hardening and evidence collection
# Run elevated on jump boxes / integration servers that connect to the appliance

$Report = "C:\BT_Containment_Audit_$(Get-Date -Format yyyyMMdd).txt"
"=== BeyondTrust Adjacent Host Audit $(Get-Date) ===" | Out-File $Report

# 1. Identify all processes with BeyondTrust/Bomgar lineage and their network connections
"[+] BeyondTrust-related processes and connections:" | Out-File $Report -Append
Get-Process | Where-Object { $_.Path -match 'beyondtrust|bomgar' } | ForEach-Object {
    $proc = $_
    Get-NetTCPConnection -OwningProcess $proc.Id -ErrorAction SilentlyContinue |
        Where-Object { $_.State -eq 'Established' } |
        Select-Object @{N='Process';E={$proc.ProcessName}}, RemoteAddress, RemotePort |
        Out-File $Report -Append
}

# 2. Verify outbound firewall policy: appliance and jump hosts should only reach
#    BeyondTrust cloud endpoints — deny-by-default everything else
"[+] Current outbound rules for BeyondTrust paths:" | Out-File $Report -Append
Get-NetFirewallRule -Direction Outbound -Action Allow |
    Get-NetFirewallApplicationFilter |
    Where-Object { $_.Program -match 'beyondtrust|bomgar' } |
    Out-File $Report -Append
"[!] ACTION: Create explicit ALLOW rules for *.beyondtrust.com only, then DENY all other egress from appliance/jump hosts." | Out-File $Report -Append

# 3. Rotate credentials potentially exposed through the PAM platform
"[!] MANUAL ACTION REQUIRED: Rotate all credentials vaulted in or brokered by BeyondTrust:" | Out-File $Report -Append
"    - Service accounts used by Remote Support/PRA" | Out-File $Report -Append
"    - API keys and OAuth client secrets registered in the appliance" | Out-File $Report -Append
"    - Any domain admin credentials ever injected through a BeyondTrust session" | Out-File $Report -Append

# 4. Enable Sysmon process-creation and network-connection auditing if not present
if (-not (Get-Service Sysmon64 -ErrorAction SilentlyContinue)) {
    "[!] Sysmon not detected — deploy with a process/network logging config for appliance-adjacent hosts." | Out-File $Report -Append
}

Write-Host "Audit written to $Report — review flagged actions immediately."

Remediation

Given that this vulnerability is unpatched at time of reporting, your remediation strategy is compensating control depth until BeyondTrust ships a fix. Prioritize in this order:

  1. Check your exposure immediately. Inventory every BeyondTrust Remote Support / Privileged Remote Access instance. Any self-hosted appliance reachable from the internet is in the highest-risk tier. If business operations permit, restrict appliance access to known source IP ranges (VPN gateway, management subnets) until a patch lands.

  2. Monitor the vendor advisory channel daily. Watch the BeyondTrust Trust Center Security Advisories page and subscribe to BeyondTrust security notifications. When a patch or hotfix is released, treat it as an emergency change — UNC5221 has demonstrated mass-exploitation capability within days of disclosure in prior campaigns. Also monitor the CISA KEV catalog; a listing there would trigger a binding federal remediation deadline and is your strongest prioritization signal.

  3. Force external log forwarding now. UNC5221 tampers with on-appliance logs. If your appliance Syslog is not streaming to your SIEM in near-real-time, fix that today — it is the single highest-value detection investment for this threat. Retain at least 90 days to cover the known activity window.

  4. Egress filtering on the appliance. BeyondTrust appliances need to talk to BeyondTrust cloud services and your IdP — nothing else. Deny-by-default egress breaks C2 and exfiltration even if exploitation succeeds.

  5. Rotate everything the appliance touches. Assume vaulted credentials, API keys, session tokens, and any credentials injected through remote sessions since mid-December 2025 are exposed. Prioritize privileged/service accounts and domain admin credentials.

  6. Hunt retroactively. Run the KQL and VQL content above across at least a 60-day window. Look specifically for authentication from unusual geographies, off-hours administrative sessions, session recording gaps, and configuration/backup exports you cannot attribute to change tickets.

  7. If you find evidence of compromise: isolate the appliance from the network but do not reboot or wipe it — preserve forensic state. Engage your IR retainer and report to BeyondTrust support; appliance-level artifacts (memory, filesystem) are time-sensitive and the vendor will want telemetry for their ongoing investigation.

  8. Architectural lesson for the long term: PAM and remote-access appliances are now Tier-0 espionage targets. They belong inside segmented management zones with brokered access, not on the perimeter as a convenience portal. UNC5221's campaign history — Ivanti, Citrix, now BeyondTrust — is a clear signal that this target class will be hit again.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.