Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Weevely_Webshell_Payload

Detects weevely webshell

WebshellSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2024-04-22
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects weevely webshell

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

Summary generated from the rule's metadata and condition.

Rule source

weevely-webshell-payload.yarDetection Rule License 1.1
rule SEKOIA_Weevely_Webshell_Payload : FILE
{
	meta:
		description = "Detects weevely webshell"
		author = "Sekoia.io"
		id = "f2879c6e-3d1b-41be-8b1d-4f0503fd4b29"
		date = "2024-04-22"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/weevely_webshell_payload.yar#L1-L17"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "bb02ec519d77526cc81ebd7743336b333b9498f79079f7008970cf1bb51c4948"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = "<?php include \""
		$s2 = ".basename(__FILE__).\""
		$s3 = ";__HALT_COMPILER(); ?>"

	condition:
		all of them and filesize < 1MB and @s1 == 0 and @s2 < @s3
}

Strings (3 patterns)

IdentifierTypeValueModifiers
$s1text"<?php include \""
$s2text".basename(__FILE__).\""
$s3text";__HALT_COMPILER(); ?>"

Condition

all of them and filesize < 1MB and @s1 == 0 and @s2 < @s3

In plain words (Heuristic)

  • The file must be smaller than 1MB (a cheap guard that skips large files).
  • All patterns in the rule 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: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

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: f2879c6e-3d1b-41be-8b1d-4f0503fd4b29

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE