Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_APT_WEBSHELL_HAFNIUM_Chopper_Webshell

Detects Chopper WebShell Injection Variant (not only Hafnium related)

APT / threat actorSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Markus Neis,Swisscom
Date
2021-03-05
Modified
2023-12-05
Score / Quality
75 / 85

What this rule detects

Detects Chopper WebShell Injection Variant (not only Hafnium related)

It defines 4 patterns (4 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

apt-webshell-hafnium-chopper-webshell.yarDetection Rule License 1.1
rule SIGNATURE_BASE_APT_WEBSHELL_HAFNIUM_Chopper_Webshell : APT HAFNIUM WEBSHELL FILE
{
	meta:
		description = "Detects Chopper WebShell Injection Variant (not only Hafnium related)"
		author = "Markus Neis,Swisscom"
		id = "25dcf166-4aea-5680-b161-c5fc8d74b987"
		date = "2021-03-05"
		modified = "2023-12-05"
		reference = "https://www.volexity.com/blog/2021/03/02/active-exploitation-of-microsoft-exchange-zero-day-vulnerabilities/"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_hafnium.yar#L50-L65"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		logic_hash = "c185a8da2a18fa59a8eeb36dbd95ba12c9c61717efc5f2d19d2d5b27ee243f2b"
		score = 75
		quality = 85
		tags = "APT, HAFNIUM, WEBSHELL, FILE"

	strings:
		$x1 = "runat=\"server\">" nocase
		$s1 = "<script language=\"JScript\" runat=\"server\">function Page_Load(){eval(Request" nocase
		$s2 = "protected void Page_Load(object sender, EventArgs e){System.IO.StreamWriter sw = new System.IO.StreamWriter(Request.Form[\"p\"] , false, Encoding.Default);sw.Write(Request.Form[\"f\"]);"
		$s3 = "<script language=\"JScript\" runat=\"server\"> function Page_Load(){eval (Request[\"" nocase

	condition:
		filesize < 10KB and $x1 and 1 of ( $s* )
}

Strings (4 patterns)

IdentifierTypeValueModifiers
$x1text"runat=\"server\">"nocase
$s1text"<script language=\"JScript\" runat=\"server\">function Page_Load(){eval(Request"nocase
$s2text"protected void Page_Load(object sender, EventArgs e){System.IO.StreamWriter sw = new System.IO.StreamWriter(Request.Form[\"p\"] , false, Encoding.Default);sw.W …
$s3text"<script language=\"JScript\" runat=\"server\"> function Page_Load(){eval (Request[\""nocase

Condition

filesize < 10KB and $x1 and 1 of ( $s* )

In plain words (Heuristic)

  • The file must be smaller than 10KB (a cheap guard that skips large files).
  • At least 1 patterns in ( $s* ) must match.
  • Pattern $x1 must be present.

Test this rule in your browser

Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.

Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.

Open in editor

References

Licence & attribution

Author: Markus Neis,Swisscom

Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: 25dcf166-4aea-5680-b161-c5fc8d74b987

Tags:APTHAFNIUMWEBSHELLFILE