YARA · Signature Base (Florian Roth / Nextron)
SIGNATURE_BASE_WEBSHELL_Compiled_Webshell_Mar2021_1
Triggers on temporary pe files containing strings commonly used in webshells.
- 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
rule SIGNATURE_BASE_WEBSHELL_Compiled_Webshell_Mar2021_1 : FILE
{
meta:
= "Triggers on temporary pe files containing strings commonly used in webshells."
= "Bundesamt fuer Sicherheit in der Informationstechnik"
= "9336bd2c-791c-5c3e-9733-724a6a23864a"
= "2021-03-05"
= "2021-03-12"
= "https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Cyber-Sicherheit/Vorfaelle/Exchange-Schwachstellen-2021/MSExchange_Schwachstelle_Detektion_Reaktion.pdf"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/apt_hafnium.yar#L275-L295"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
= "d2e5f91f7bb50984c491eb9632d3863febc986760e4d03c8255872887ce4dc4a"
= 75
= 81
= "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)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $x1 | regex | /App_Web_[a-zA-Z0-9]{7,8}.dll/ | ascii wide fullword |
| $a1 | text | "~/aspnet_client/" | ascii wide nocase |
| $a2 | text | "~/auth/" | ascii wide nocase |
| $b1 | text | "JScriptEvaluate" | ascii wide fullword |
| $c1 | text | "get_Request" | ascii wide fullword |
| $c2 | text | "get_Files" | ascii wide fullword |
| $c3 | text | "get_Count" | ascii wide fullword |
| $c4 | text | "get_Item" | ascii wide fullword |
| $c5 | text | "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.
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)
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