← Back to SOC feed Coverage →

Detects webshell used by APT group UNC5221 (China Nexus)

yara HIGH signature-base
aptflorian-rothwebshell
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at signature-base →
Retrieved: 2026-08-02T23:00:00Z · Confidence: medium

Hunt Hypothesis

This hunt hypothesis targets the deployment of persistent webshells by the China Nexus APT group to identify early-stage command-and-control channels that may evade standard signature-based detections. Proactively hunting for this behavior in Azure Sentinel is critical because UNC5221 frequently leverages compromised web servers as a foothold for lateral movement, allowing the SOC team to intercept potential data exfiltration before it escalates into a broader breach.

YARA Rule

rule WEBSHELL_G_APT_BackdoorWebshell_SLAYSTYLE_1 {
   meta:
      description = "Detects webshell used by APT group UNC5221 (China Nexus)"
      author = "Google Threat Intelligence Group (GTIG) (modified by Florian Roth)"
      date = "2025-09-25"
      score = 75
      reference = "https://cloud.google.com/blog/topics/threat-intelligence/brickstorm-espionage-campaign"
      id = "6d3dfb91-a14b-5420-b17b-c6d65c94fc53"
   strings:
      //$str1 = /String \w{1,10}=request\.getParameter\(\"\w{1,15}\"\);/ ascii wide nocase
      $str1_alt = "=request.getParameter(\""
      $str2 = "=new String(java.util.Base64.getDecoder().decode(" ascii wide nocase
      //$str21 = /String\[\]\s\w{1,10}=\{\"\/bin\/sh\",\"-c\",\w{1,10}\+\"\s2>&1\"\};/ ascii wide nocase
      $str21_alt = "={\"/bin/sh\",\"-c\"," ascii
      $str3 = "= Runtime.getRuntime().exec(" ascii
      $str4 = "java.io.InputStream" ascii
      $str5 = "java.util.Base64.getEncoder().encodeToString(org.apache.commons.io.IOUtils.toByteArray(" ascii
   condition:
      filesize < 5MB and all of them
}

Deployment Notes

This YARA rule can be deployed in the following contexts:

This rule contains 8 string patterns in its detection logic.

References

False Positive Guidance

Here are 4 specific false positive scenarios for the Detects webshell used by APT group UNC5221 (China Nexus) rule, including targeted filters and exclusions:

Original source: https://github.com/Neo23x0/signature-base/blob/main/yara/apt_cn_brickstorm_sep25.yar