// Offline files only. Supply one decoded request/body per file where possible.
// Do not use these rules to classify the two filler artifacts as malware.
import "hash"

rule DC_PHP2Shell_Text_Label : research_label low_confidence
{
    meta:
        author = "Deception Check"
        date = "2026-10-23"
        purpose = "Weak text correlation; documentation and copied labels also match"
        scope = "Offline UTF-8/ASCII text, at most 2 MiB; not a CVE or malware signature"
    strings:
        $label = "php2shell" ascii nocase
    condition:
        filesize <= 2MB and $label
}

rule DC_Upload_Progress_PHP_Function_Tokens : input_triage stronger_context
{
    meta:
        author = "Deception Check"
        date = "2026-10-23"
        purpose = "Co-occurring upload-progress, PHP opening tag, and command-function tokens"
        scope = "Stronger than a label alone; no parsing, field binding, execution, or CVE claim"
    strings:
        $progress = "PHP_SESSION_UPLOAD_PROGRESS" ascii
        $php = "<?php" ascii nocase
        $call = /\b(system|shell_exec|passthru)\s*\(/ ascii nocase
    condition:
        filesize <= 2MB and all of them
}

rule DC_Known_Repetitive_Upload_Artifact : filler_correlation not_malware_classification
{
    meta:
        author = "Deception Check"
        date = "2026-10-23"
        purpose = "Exact byte correlation with the two verified repetitive filler uploads"
        scope = "A matching artifact is filler; surrounding request safety remains unresolved"
    condition:
        (filesize == 10370 and hash.sha256(0, filesize) ==
            "150ae88f0999032e2a6113501d6082f54a3ed98d02427b21a96e773a27d7bf16") or
        (filesize == 64 and hash.sha256(0, filesize) ==
            "27d926a6708d6769d97d065e7a5a860ab496eab272c03d1cebc55ec71b954fa2")
}
