This detection identifies adversaries deploying a cmd.asp web shell to establish a persistent command-and-control channel for executing remote commands on compromised web servers. Proactive hunting is essential in Azure Sentinel because web shells often evade standard signature-based defenses by blending with legitimate traffic, allowing attackers to maintain stealthy access and pivot deeper into the environment before detection.
rule webshell_ASP_cmd {
meta:
description = "Web Shell - file cmd.asp"
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 = "97af88b478422067f23b001dd06d56a9"
id = "393e738a-b4c2-5630-a55f-c3caee4ff75e"
strings:
$s0 = "<%= \"\\\\\" & oScriptNet.ComputerName & \"\\\" & oScriptNet.UserName %>" 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 cmd.asp detection rule, including suggested filters and exclusions tailored for an enterprise environment:
Scenario: Automated Backup or Migration Scripts
.asp scripts to the IIS root directory (C:\inetpub\wwwroot) to execute file synchronization commands via cmd.exe. These scripts are frequently named generically like cmd.asp during the initial deployment phase.C:\inetpub\wwwroot\backup\_temp\) AND the process creating the file belongs to a trusted service account (e.g., NT SERVICE\VeeamTransport).Scenario: Scheduled Health Check Jobs
.asp page named cmd.asp located in the Scripts subfolder of the web application, which executes diagnostic commands against the database or server resources.C:\inetpub\wwwroot\admin\_health\cmd.asp.Scenario: Deployment of Standard Library Components
cmd.asp as part of the core framework distribution