Skip to content

YARA · Volexity threat-intel

VOLEXITY_Susp_Php_Fileinput_Eval

Rule designed to detect PHP files which use file_get_contents() and then shortly afterwards use an eval statement.

Suspicious / huntingVolexity threat-intelBSD 2-Clause LicenseCompiles with YARA-X
Author
threatintel@volexity.com
Date
2021-06-16
Modified
2024-12-12
Score / Quality
65 / 80

What this rule detects

Rule designed to detect PHP files which use file_get_contents() and then shortly afterwards use an eval statement.

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

Summary generated from the rule's metadata and condition.

Rule source

susp-php-fileinput-eval.yarBSD 2-Clause License
rule VOLEXITY_Susp_Php_Fileinput_Eval : FILE
{
	meta:
		description = "Rule designed to detect PHP files which use file_get_contents() and then shortly afterwards use an eval statement."
		author = "threatintel@volexity.com"
		id = "3e311677-22ea-5e5f-bdc6-dd67033d25a6"
		date = "2021-06-16"
		modified = "2024-12-12"
		reference = "https://github.com/volexity/threat-intel"
		source_url = "https://github.com/volexity/threat-intel/blob/3a9d0b52459877ee866a9a0ba06e60059b778c77/2022/2022-06-15 DriftingCloud - Zero-Day Sophos Firewall Exploitation and an Insidious Breach/indicators/yara.yar#L159-L182"
		license_url = "https://github.com/volexity/threat-intel/blob/3a9d0b52459877ee866a9a0ba06e60059b778c77/LICENSE.txt"
		hash = "1a34c43611ee310c16acc383c10a7b8b41578c19ee85716b14ac5adbf0a13bd5"
		hash = "6e8874c756c009c63f715a44ca72d0cb31dc25d87d7df6ca2830fe8330580342"
		logic_hash = "de376bfdfa5b6244c414454cb5d43d29e3dd75e049389f0c430c160f9d198965"
		score = 65
		quality = 80
		tags = "FILE"
		os = "win,linux"
		os_arch = "all"
		scan_context = "file"
		severity = "high"
		license = "See license at https://github.com/volexity/threat-intel/blob/main/LICENSE.txt"
		rule_id = 5581
		version = 5

	strings:
		$s1 = "file_get_contents(\"php://input\")"
		$s2 = "eval("

	condition:
		$s2 in ( @s1 [ 1 ] .. ( @s1 [ 1 ] + 512 ) )
}

Strings (2 patterns)

IdentifierTypeValueModifiers
$s1text"file_get_contents(\"php://input\")"
$s2text"eval("

Condition

$s2 in ( @s1 [ 1 ] .. ( @s1 [ 1 ] + 512 ) )

In plain words (Heuristic)

  • Pattern $s2 must be found within the range @s1 [ 1 ] .. ( @s1 [ 1 ] + 512.

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

Sample hashes

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

  • 1a34c43611ee310c16acc383c10a7b8b41578c19ee85716b14ac5adbf0a13bd5
  • 6e8874c756c009c63f715a44ca72d0cb31dc25d87d7df6ca2830fe8330580342

Licence & attribution

Author: threatintel@volexity.com

Source repository: Volexity threat-intel @ 3a9d0b5245

Licence: BSD 2-Clause License (stated in the rule's own meta)

“See license at https://github.com/volexity/threat-intel/blob/main/LICENSE.txt”

Copyright notice: Copyright 2022 by Volexity, Inc.

Original rule

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

Rule id: 3e311677-22ea-5e5f-bdc6-dd67033d25a6

Metadata

oswin,linux
os_archall
scan_contextfile
severityhigh
rule_id5581
version5

Tags:FILE