Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_WEBSHELL_PHP_In_Htaccess

Use Apache .htaccess to execute php code inside .htaccess

WebshellSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Arnim Rupp (https://github.com/ruppde)
Date
2021-01-07
Modified
2023-07-05
Score / Quality
75 / 85

What this rule detects

Use Apache .htaccess to execute php code inside .htaccess

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

Summary generated from the rule's metadata and condition.

Rule source

webshell-php-in-htaccess.yarDetection Rule License 1.1
rule SIGNATURE_BASE_WEBSHELL_PHP_In_Htaccess : FILE
{
	meta:
		description = "Use Apache .htaccess to execute php code inside .htaccess"
		author = "Arnim Rupp (https://github.com/ruppde)"
		id = "0f5edff9-22b2-50c9-ae81-72698ea8e7db"
		date = "2021-01-07"
		modified = "2023-07-05"
		reference = "Internal Research"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/gen_webshells.yar#L2756-L2778"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		hash = "c026d4512a32d93899d486c6f11d1e13b058a713"
		hash = "d79e9b13a32a9e9f3fa36aa1a4baf444bfd2599a"
		hash = "e1d1091fee6026829e037b2c70c228344955c263"
		hash = "c026d4512a32d93899d486c6f11d1e13b058a713"
		hash = "8c9e65cd3ef093cd9c5b418dc5116845aa6602bc92b9b5991b27344d8b3f7ef2"
		logic_hash = "0652a4cb0cb6c61afece5c2e4cbf2f281714509f0d828047f2e3ccd411602115"
		score = 75
		quality = 85
		tags = "FILE"
		license = "Detection Rule License 1.1 https://github.com/Neo23x0/signature-base/blob/master/LICENSE"
		importance = 70

	strings:
		$hta = "AddType application/x-httpd-php .htaccess" wide ascii

	condition:
		filesize < 100KB and $hta
}

Strings (1 patterns)

IdentifierTypeValueModifiers
$htatext"AddType application/x-httpd-php .htaccess"wide ascii

Condition

filesize < 100KB and $hta

In plain words (Heuristic)

  • The file must be smaller than 100KB (a cheap guard that skips large files).
  • Pattern $hta 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

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • c026d4512a32d93899d486c6f11d1e13b058a713
  • d79e9b13a32a9e9f3fa36aa1a4baf444bfd2599a
  • e1d1091fee6026829e037b2c70c228344955c263
  • 8c9e65cd3ef093cd9c5b418dc5116845aa6602bc92b9b5991b27344d8b3f7ef2

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”

Original rule

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

Rule id: 0f5edff9-22b2-50c9-ae81-72698ea8e7db

Metadata

importance70

Tags:FILE