This detection identifies potential web shell deployments where adversaries establish a persistent backdoor via a server.php file to execute commands and maintain access on compromised web servers. Proactively hunting for this behavior in Azure Sentinel is critical to uncover stealthy post-exploitation activities that may evade standard signature-based alerts, ensuring early identification of unauthorized persistence mechanisms before lateral movement occurs.
rule webshell_php_sh_server {
meta:
description = "Web Shell - file server.php"
license = "Detection Rule License 1.1 https://github.com/Neo23x0/signature-base/blob/master/LICENSE"
author = "Florian Roth (Nextron Systems)"
date = "2014/01/28"
score = 50
hash = "d87b019e74064aa90e2bb143e5e16cfa"
id = "393e738a-b4c2-5630-a55f-c3caee4ff75e"
strings:
$s0 = "eval(getenv('HTTP_CODE'));" fullword
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 1 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the “Web Shell - file server.php” detection rule, including suggested filters or exclusions:
Scenario: Automated CMS Plugin Updates
server.php files during scheduled maintenance windows to handle API routing or session management. These legitimate updates often trigger the rule because they involve new PHP file creation in web root directories./var/www/html/wp-content/plugins/*/server.php) and correlate alerts with the execution of known update tools like wp-cli or Jenkins build pipelines running during maintenance windows (02:00–04:00 UTC).Scenario: Load Balancer Health Checks
server.php to verify backend application availability. In some configurations, the load balancer may write a temporary server.php log or status file upon successful connection establishment, mimicking web shell creation behavior.HealthCheck-Agent or kube-probe). Additionally, filter out files with a size under 2KB that are modified but not executed by a web server process.Scenario: DevOps CI/CD Deployment Pipelines