This detection identifies adversaries establishing a persistent web shell named “Crystal.php” to execute arbitrary commands and maintain access within web-facing applications. Proactive hunting for this artifact in Azure Sentinel is critical because web shells often serve as an initial foothold that enables attackers to pivot laterally, exfiltrate sensitive data, or escalate privileges before triggering broader alerting mechanisms.
rule webshell_Crystal_Crystal {
meta:
description = "Web Shell - file Crystal.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 = "fdbf54d5bf3264eb1c4bff1fac548879"
id = "393e738a-b4c2-5630-a55f-c3caee4ff75e"
strings:
$s1 = "show opened ports</option></select><input type=\"hidden\" name=\"cmd_txt\" value"
$s6 = "\" href=\"?act=tools\"><font color=#CC0000 size=\"3\">Tools</font></a></span></f"
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the Web Shell - file Crystal.php detection rule, including suggested filters and exclusions tailored for an enterprise environment:
Scenario: Legitimate CMS Plugin Updates via Deployment Pipelines
Crystal.php as part of a new analytics module installation.svc-deploy-jenkins) and restrict the rule trigger to exclude file creation events where the source IP belongs to the internal build server subnet (e.g., 10.20.45.x).Scenario: Scheduled Backup and Integrity Verification Jobs
Crystal.php to validate read/write permissions before archiving the directory.DOMAIN\BackupService) and the file action is “Write” followed immediately by “Delete” within a 5-minute window.Scenario: Automated Log Rotation and Analysis Scripts
Crystal.php as a temporary staging file to aggregate error metrics before sending