/* Static file triage, NOT a vulnerability scanner or CVE-specific signature.
   A lexical direct request-to-command-function pattern; no data-flow analysis.
   Comments, documentation, and authorized tools can match. Never auto-delete.
   Variable functions, wrappers, encodings, short tags, and memory-only code can miss. */
rule DC_PHP_Direct_Request_Command_Triage : triage php
{
    meta:
        author = "Deception Check"
        date = "2026-10-21"
        purpose = "Conservative static PHP file review; not CVE-specific"
        reference = "https://yara.readthedocs.io/en/stable/writingrules.html"
    strings:
        $php = "<?php" ascii nocase
        $direct = /\b(system|exec|shell_exec|passthru|popen)\s*\(\s*\$_(GET|POST|REQUEST|COOKIE)\s*\[/ ascii nocase
    condition:
        filesize < 1MB and $php and $direct
}
