title: PHP2Shell - Outbound Connection to a Public Address from a PHP or Web Server Process
id: 7d2c4a85-1e9b-4f36-a0c7-5b8e3d1f6a61
status: experimental
description: |
  Detects outbound connections to non-private addresses initiated by PHP workers or web server processes.
  After code execution the attacker typically downloads tools or opens a reverse shell from the worker.
  Many applications legitimately call external APIs, so baseline first; the KQL pack includes a
  first-seen-destination variant.
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.command-and-control
  - attack.t1071
  - attack.t1105
  - cve.2026-109618
  - cve.2026-109619
logsource:
  product: linux
  category: network_connection
detection:
  worker:
    Image|contains:
      - '/php-fpm'
      - '/php-cgi'
      - '/lsphp'
      - '/frankenphp'
      - '/httpd'
      - '/apache2'
  initiated:
    Initiated: 'true'
  private:
    DestinationIp|cidr:
      - '127.0.0.0/8'
      - '10.0.0.0/8'
      - '172.16.0.0/12'
      - '192.168.0.0/16'
      - '169.254.0.0/16'
      - '::1/128'
      - 'fc00::/7'
      - 'fe80::/10'
  condition: worker and initiated and not private
falsepositives:
  - Applications calling payment, mail, CDN, update or other external APIs
level: low
