Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_WEBSHELL_Compiled_Webshell_Mar2021_1

Triggers on temporary pe files containing strings commonly used in webshells.

WebshellSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Bundesamt fuer Sicherheit in der Informationstechnik
Date
2021-03-05
Modified
2021-03-12
Score / Quality
75 / 81

What this rule detects

Triggers on temporary pe files containing strings commonly used in webshells.

Targets: Windows PE.

It defines 9 patterns (8 text, 0 hex, 1 regex).

Summary generated from the rule's metadata and condition.

Rule source

webshell-compiled-webshell-mar2021-1.yarDetection Rule License 1.1
rule SIGNATURE_BASE_WEBSHELL_Compiled_Webshell_Mar2021_1 : FILE
{
	meta:
		description = "Triggers on temporary pe files containing strings commonly used in webshells."
		author = "Bundesamt fuer Sicherheit in der Informationstechnik"
		id = "9336bd2c-791c-5c3e-9733-724a6a23864a"
		date = "2021-03-05"
		modified = "2021-03-12"
		reference = "https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Cyber-Sicherheit/Vorfaelle/Exchange-Schwachstellen-2021/MSExchange_Schwachstelle_Detektion_Reaktion.pdf"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_hafnium.yar#L275-L295"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		logic_hash = "d2e5f91f7bb50984c491eb9632d3863febc986760e4d03c8255872887ce4dc4a"
		score = 75
		quality = 81
		tags = "FILE"

	strings:
		$x1 = /App_Web_[a-zA-Z0-9]{7,8}.dll/ ascii wide fullword
		$a1 = "~/aspnet_client/" ascii wide nocase
		$a2 = "~/auth/" ascii wide nocase
		$b1 = "JScriptEvaluate" ascii wide fullword
		$c1 = "get_Request" ascii wide fullword
		$c2 = "get_Files" ascii wide fullword
		$c3 = "get_Count" ascii wide fullword
		$c4 = "get_Item" ascii wide fullword
		$c5 = "get_Server" ascii wide fullword

	condition:
		uint16( 0 ) == 0x5a4d and filesize > 5KB and filesize < 40KB and all of ( $x* ) and 1 of ( $a* ) and ( all of ( $b* ) or all of ( $c* ) )
}

Strings (9 patterns)

IdentifierTypeValueModifiers
$x1regex/App_Web_[a-zA-Z0-9]{7,8}.dll/ascii wide fullword
$a1text"~/aspnet_client/"ascii wide nocase
$a2text"~/auth/"ascii wide nocase
$b1text"JScriptEvaluate"ascii wide fullword
$c1text"get_Request"ascii wide fullword
$c2text"get_Files"ascii wide fullword
$c3text"get_Count"ascii wide fullword
$c4text"get_Item"ascii wide fullword
$c5text"get_Server"ascii wide fullword

Condition

uint16( 0 ) == 0x5a4d and filesize > 5KB and filesize < 40KB and all of ( $x* ) and 1 of ( $a* ) and ( all of ( $b* ) or all of ( $c* ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 40KB (a cheap guard that skips large files).
  • The file must be larger than 5KB.
  • All patterns in ( $x* ) must match.
  • All patterns in ( $b* ) must match.
  • All patterns in ( $c* ) must match.
  • At least 1 patterns in ( $a* ) must match.

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: Bundesamt fuer Sicherheit in der Informationstechnik

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: 9336bd2c-791c-5c3e-9733-724a6a23864a

Tags:FILE