YARA · Signature Base (Florian Roth / Nextron)
SIGNATURE_BASE_WEBSHELL_PHP_Function_Via_Get
Webshell which sends eval/assert via GET
- Author
- Arnim Rupp (https://github.com/ruppde)
- Date
- 2021-01-09
- Modified
- 2023-04-05
- Score / Quality
- 75 / 83
What this rule detects
Webshell which sends eval/assert via GET
It defines 18 patterns (12 text, 0 hex, 6 regex).
Summary generated from the rule's metadata and condition.
Rule source
rule SIGNATURE_BASE_WEBSHELL_PHP_Function_Via_Get : FILE
{
meta:
= "Webshell which sends eval/assert via GET"
= "Arnim Rupp (https://github.com/ruppde)"
= "5fef1063-2f9f-516e-86f6-cfd98bb05e6e"
= "2021-01-09"
= "2023-04-05"
= "Internal Research"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/gen_webshells.yar#L2780-L2824"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
= "ce739d65c31b3c7ea94357a38f7bd0dc264da052d4fd93a1eabb257f6e3a97a6"
= "d870e971511ea3e082662f8e6ec22e8a8443ca79"
= "73fa97372b3bb829835270a5e20259163ecc3fdbf73ef2a99cb80709ea4572be"
= "309203db8e7374531d359e3a723418d47bead45034c4a7bd726fb714622dc039"
= 75
= 83
= "FILE"
= "Detection Rule License 1.1 https://github.com/Neo23x0/signature-base/blob/master/LICENSE"
= 70
strings:
$sr0 = /\$_GET\s?\[.{1,30}\]\(\$_GET\s?\[/ wide ascii
$sr1 = /\$_POST\s?\[.{1,30}\]\(\$_GET\s?\[/ wide ascii
$sr2 = /\$_POST\s?\[.{1,30}\]\(\$_POST\s?\[/ wide ascii
$sr3 = /\$_GET\s?\[.{1,30}\]\(\$_POST\s?\[/ wide ascii
$sr4 = /\$_REQUEST\s?\[.{1,30}\]\(\$_REQUEST\s?\[/ wide ascii
$sr5 = /\$_SERVER\s?\[HTTP_.{1,30}\]\(\$_SERVER\s?\[HTTP_/ wide ascii
$gfp1 = "eval(\"return [$serialised_parameter"
$gfp2 = "$this->assert(strpos($styles, $"
$gfp3 = "$module = new $_GET['module']($_GET['scope']);"
$gfp4 = "$plugin->$_POST['action']($_POST['id']);"
$gfp5 = "$_POST[partition_by]($_POST["
$gfp6 = "$object = new $_REQUEST['type']($_REQUEST['id']);"
$gfp7 = "The above example code can be easily exploited by passing in a string such as"
$gfp8 = "Smarty_Internal_Debug::start_render($_template);"
$gfp9 = "?p4yl04d=UNION%20SELECT%20'<?%20system($_GET['command']);%20?>',2,3%20INTO%20OUTFILE%20'/var/www/w3bsh3ll.php"
$gfp10 = "[][}{;|]\\|\\\\[+=]\\|<?=>?"
$gfp11 = "(eval (getenv \"EPROLOG\")))"
$gfp12 = "ZmlsZV9nZXRfY29udGVudHMoJ2h0dHA6Ly9saWNlbnNlLm9wZW5jYXJ0LWFwaS5jb20vbGljZW5zZS5waHA/b3JkZXJ"
condition:
filesize < 500KB and not ( any of ( $gfp* ) ) and any of ( $sr* )
}
Strings (18 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $sr0 | regex | /\$_GET\s?\[.{1,30}\]\(\$_GET\s?\[/ | wide ascii |
| $sr1 | regex | /\$_POST\s?\[.{1,30}\]\(\$_GET\s?\[/ | wide ascii |
| $sr2 | regex | /\$_POST\s?\[.{1,30}\]\(\$_POST\s?\[/ | wide ascii |
| $sr3 | regex | /\$_GET\s?\[.{1,30}\]\(\$_POST\s?\[/ | wide ascii |
| $sr4 | regex | /\$_REQUEST\s?\[.{1,30}\]\(\$_REQUEST\s?\[/ | wide ascii |
| $sr5 | regex | /\$_SERVER\s?\[HTTP_.{1,30}\]\(\$_SERVER\s?\[HTTP_/ | wide ascii |
| $gfp1 | text | "eval(\"return [$serialised_parameter" | |
| $gfp2 | text | "$this->assert(strpos($styles, $" | |
| $gfp3 | text | "$module = new $_GET['module']($_GET['scope']);" | |
| $gfp4 | text | "$plugin->$_POST['action']($_POST['id']);" | |
| $gfp5 | text | "$_POST[partition_by]($_POST[" | |
| $gfp6 | text | "$object = new $_REQUEST['type']($_REQUEST['id']);" | |
| $gfp7 | text | "The above example code can be easily exploited by passing in a string such as" | |
| $gfp8 | text | "Smarty_Internal_Debug::start_render($_template);" | |
| $gfp9 | text | "?p4yl04d=UNION%20SELECT%20'<?%20system($_GET['command']);%20?>',2,3%20INTO%20OUTFILE%20'/var/www/w3bsh3ll.php" | |
| $gfp10 | text | "[][}{;|]\\|\\\\[+=]\\|<?=>?" | |
| $gfp11 | text | "(eval (getenv \"EPROLOG\")))" | |
| $gfp12 | text | "ZmlsZV9nZXRfY29udGVudHMoJ2h0dHA6Ly9saWNlbnNlLm9wZW5jYXJ0LWFwaS5jb20vbGljZW5zZS5waHA/b3JkZXJ" |
Condition
filesize < 500KB and not ( any of ( $gfp* ) ) and any of ( $sr* )In plain words (Heuristic)
- The file must be smaller than 500KB (a cheap guard that skips large files).
- At least one pattern in ( $gfp* ) must match.
- At least one pattern in ( $sr* ) 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.
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- ce739d65c31b3c7ea94357a38f7bd0dc264da052d4fd93a1eabb257f6e3a97a6
- d870e971511ea3e082662f8e6ec22e8a8443ca79
- 73fa97372b3bb829835270a5e20259163ecc3fdbf73ef2a99cb80709ea4572be
Licence & attribution
Author: Arnim Rupp (https://github.com/ruppde)
Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a
Licence: Detection Rule License 1.1 (stated in the rule's own meta)
“Detection Rule License 1.1 https://github.com/Neo23x0/signature-base/blob/master/LICENSE”
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 5fef1063-2f9f-516e-86f6-cfd98bb05e6e
Metadata
| importance | 70 |
|---|
Tags:FILE
Related rules
- WebshellSignature Base (Florian Roth / Nextron)· Arnim Rupp (https://github.com/ruppde)· 2023-01-28
- WebshellSignature Base (Florian Roth / Nextron)· Arnim Rupp (https://github.com/ruppde)· 2021-01-07
- WebshellSignature Base (Florian Roth / Nextron)· Arnim Rupp (https://github.com/ruppde)· 2021-01-07
- WebshellSignature Base (Florian Roth / Nextron)· Arnim Rupp (https://github.com/ruppde)· 2021-01-07
- WebshellSignature Base (Florian Roth / Nextron)· Arnim Rupp (https://github.com/ruppde)· 2021-01-07
- WebshellSignature Base (Florian Roth / Nextron)· Arnim Rupp (https://github.com/ruppde)· 2021-01-07
- MalwareSignature Base (Florian Roth / Nextron)· Arnim Rupp (https://github.com/ruppde)· 2023-04-04
- Hack toolSignature Base (Florian Roth / Nextron)· Arnim Rupp (https://github.com/ruppde)· 2020-12-13