This detection identifies adversaries establishing a web shell disguised as an HTTP error page (404.php) to maintain persistence and execute commands on compromised web servers. Proactive hunting for this anomaly in Azure Sentinel is critical because attackers often leverage such innocuous filenames to evade standard monitoring, allowing them to establish covert command-and-control channels before broader compromise occurs.
rule webshell_PHP_404 {
meta:
description = "Web Shell - file 404.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 = 70
hash = "078c55ac475ab9e028f94f879f548bca"
id = "393e738a-b4c2-5630-a55f-c3caee4ff75e"
strings:
$s4 = "<span>Posix_getpwuid (\"Read\" /etc/passwd)"
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 1 string patterns in its detection logic.
Scenario: Automated Health Check Probing
404.php to verify web server availability. Since the file might be a placeholder or the request is part of a health check script that expects a specific response code, the creation or access of this file can trigger the rule if the logic interprets new file activity in the web root as suspicious.10.x.x.x) and external monitoring service IPs where the User-Agent string contains keywords like “HealthCheck,” “Datadog,” or “Pingdom.”Scenario: Scheduled Backup and Cleanup Jobs
404.php temporarily before compression. Additionally, automated cleanup jobs might generate a default error page file named 404.php if a specific directory structure is being reset.Veeam.Backup.Service.exe, powershell.exe) and exclude events occurring during defined maintenance windows (e.g., 02:00–04:00 UTC) where these jobs are active.Scenario: CMS Deployment and Theme Updates