title: PHP2Shell - Web Server Account Executes a Binary from a Temp Directory
id: 9a4d1c7e-2f58-4b3a-8e06-7c1b5d9f0a31
status: experimental
description: |
  Detects a process image under /tmp, /var/tmp or /dev/shm started by a typical web server account or a
  PHP / web server parent. Mirai-style droppers execute payloads from these directories after chmod +x.
  UNVERIFIED FIELD: the User field depends on the telemetry source (for example Sysmon for Linux or auditd
  mappings); adjust the account names to your distribution.
references:
  - https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w
  - https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp
  - https://www.cisa.gov/news-events/alerts/2026/10/21/critical-vulnerabilities-php-require-immediate-patching
author: Cybaverse
date: 2026-10-26
tags:
  - attack.execution
  - attack.t1059.004
  - cve.2026-109618
  - cve.2026-109619
logsource:
  product: linux
  category: process_creation
detection:
  tmp_image:
    Image|startswith:
      - '/tmp/'
      - '/var/tmp/'
      - '/dev/shm/'
  web_user:
    User:
      - 'www-data'
      - 'apache'
      - 'nginx'
      - 'http'
      - 'wwwrun'
      - 'nobody'
      - 'litespeed'
  web_parent:
    ParentImage|contains:
      - '/php-fpm'
      - '/php-cgi'
      - '/lsphp'
      - '/frankenphp'
      - '/httpd'
      - '/apache2'
  condition: tmp_image and (web_user or web_parent)
falsepositives:
  - Applications that unpack and run helpers from temp directories
level: high
