{
  "model_id": "SOC.095",
  "name": "Shell Spawned By Web Server",
  "description": "bash/sh spawned by a web server process (nginx, apache, php-fpm) — classic webshell execution indicator.",
  "threshold": 0.9,
  "evaluations": [
    {
      "name": "Proc",
      "type": "comparison",
      "left": "event.type",
      "operator": "==",
      "right": "process.longlived",
      "weight": 2
    },
    {
      "name": "Shell",
      "type": "comparison",
      "left": "event.raw.comm",
      "operator": "IN",
      "right": [
        "bash",
        "sh",
        "dash",
        "zsh"
      ],
      "weight": 4
    },
    {
      "name": "WebParent",
      "type": "comparison",
      "left": "event.raw.parent_comm",
      "operator": "IN",
      "right": [
        "nginx",
        "apache2",
        "httpd",
        "php-fpm",
        "gunicorn",
        "node"
      ],
      "weight": 5
    },
    {
      "name": "Logic",
      "type": "logical",
      "operator": "AND",
      "operands": [
        "Proc",
        "Shell",
        "WebParent"
      ],
      "weight": 5
    }
  ],
  "actions": [
    {
      "type": "emit_alert",
      "reason": "Web server spawned a shell — webshell execution."
    },
    {
      "type": "request_kill",
      "reason": "Kill the shell process."
    },
    {
      "type": "enqueue_evidence",
      "reason": "Capture cmdline + parent process tree."
    }
  ],
  "mitre_tactics": [
    "Execution",
    "Persistence"
  ],
  "mitre_techniques": [
    "T1059.004",
    "T1505.003"
  ],
  "severity": "critical",
  "observables": [
    "event.actor.exe",
    "event.actor.pid"
  ]
}
