PHP runtime hunts: choose a real source
Customer telemetry refresh / October 29, 2026
Choose your source
Choose a real source, then verify it STANDARD SIGMA linux_web_child.yml uses product linux / category process_creation and conventional ParentImage and Image executable paths. Author is Deception Check; the product is the actual telemetry family. Use a supported collection integration and Sigma field mapping, such as Sysmon for Linux Event 1. Do not rename fields to pretend a source exists. Confirm full paths and an immediate parent on a known benign event. MICROSOFT DEFENDER XDR DeviceProcessEvents plus fresh DeviceInfo inventory. Onboard supported Linux hosts to Defender for Endpoint; use an entitlement and role exposing endpoint Advanced Hunting. DeviceInfo's latest OSPlatform identifies Linux, with a one-day inventory window. Stale/missing inventory is excluded. Queries bound process events to 15 minutes. Optional descendant context needs InitiatingProcessParentFileName populated on real Linux events; no result is not evidence that a process never ran. CROWDSTRIKE FALCON Search the repository holding Linux sensor ProcessRollup2 events, with licensed event-search/CQL access. Select authorized hosts and a 15-minute time picker. event_platform=Lin is required. ParentBaseFileName is a bare basename; ImageFileName is a path. The hand-native query respects this distinction. The optional context query uses GrandParentBaseFileName only where that enrichment is populated; use the direct-child query without it. Generic Sigma parent-path conversion is not accepted as equivalent. Host/sensor support and retention must be confirmed locally. SPLUNK AND SUMO LOGIC Collect Sysmon for Linux Event 1 XML through normal syslog forwarding/collector ingestion, with process creation enabled, complete messages, licensed ingestion, and search access. Replace REPLACE_LINUX_SYSMON_INDEX (Splunk) or REPLACE_LINUX_SYSMON_SOURCE_CATEGORY (Sumo) with your actual source. Neither query requires a package-defined JSON schema or a populated CIM model. Sumo isolates the Event element before XPath extraction; Splunk extracts actual EventData fields and decodes command-text entities. Both require provider Linux-Sysmon and EventID 1. These supplied parsers expect the illustrated unnamespaced single-line XML with double-quoted field names. Namespaced, multiline, truncated, or reformatted events need a tested parser adjustment. Parent/Image absence fails the hunt; CommandLine and User may be absent and should be investigated, not converted to made-up values. Use a 15-minute search window; monitor collection/parse failure separately. SOPHOS LIVE DISCOVER Choose Live Endpoint on supported Linux hosts, with the product entitlement and role permitting custom endpoint queries. The SQL reads the core osquery processes snapshot and uses start-time ordering for a parent PID join. Only still-running parent and child processes can match; collection is not atomic, and PID reuse, exited parents, namespaces, and short-lived commands limit coverage. Inspect actual path, name, and cmdline values on the selected endpoints. A time picker does not turn this snapshot into process history. This is not a custom Data Lake table. SPECIALTY AND ENGINEERING ADVANCED preserves prior normalization/CIM/visibility recipes, not stock vendor coverage. Use only after confirming the explicitly required upstream fields and capture path. The original v1 archive is retained for provenance, not the default getting-started route. Its validation records describe that historical version. Official references Sigma specification: https://sigmahq.io/sigma-specification/specification/sigma-rules-specification.html Sysmon for Linux: https://github.com/microsoft/Sysmon-Linux Defender process fields: https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-deviceprocessevents-table Defender inventory: https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-deviceinfo-table Defender access: https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-overview Falcon CQL: https://library.humio.com/data-analysis/syntax.html Sumo XPath: https://www.sumologic.com/help/docs/search/search-query-language/parse-operators/parse-xml-formatted-logs/ Splunk rex: https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/9.4/search-commands/rex osquery processes: https://osquery.io/schema/5.12.1/#processes Sophos Live Discover: https://docs.sophos.com/central/customer/help/en-us/ManageYourProducts/ThreatAnalysisCenter/LiveDiscover/
Native queries and standard rules
Replace the named source selector with the source you actually collect. Review prerequisites before running a hunt.
linux_web_child.yml
title: Linux Web or PHP Service Spawning Review-Worthy Utilities
id: 047bf92b-5f89-4601-aeb7-f6afb04bb87c
status: experimental
description: Behavioral hunt, not a CVE-specific exploit detector. Review process creation directly
beneath web or PHP services. Requires complete executable paths and parent attribution. Legitimate
PHP execution and application jobs can match. Shell-free in-process execution and deeper descendants
are blind spots.
author: Deception Check
date: '2026-10-21'
references:
- https://sigmahq.io/sigma-specification/specification/sigma-rules-specification.html
logsource:
category: process_creation
product: linux
detection:
parent:
ParentImage|re: /(php(-fpm|-cgi)?([5-9][.][0-9]|[5-9][0-9])?|php([5-9][.][0-9]|[5-9][0-9])(-fpm|-cgi)|frankenphp|lsphp([5-9][.][0-9]|[5-9][0-9])?|apache2|httpd|nginx)$
child:
Image|re: /(sh|bash|dash|zsh|ksh|curl|wget|nc|ncat|socat|python|python3|perl|busybox|id|whoami|uname)$
condition: parent and child
fields:
- Image
- CommandLine
- ParentImage
- ParentCommandLine
- User
falsepositives:
- Configured local-mail/sendmail handoff through a shell
- Application image/video wrappers, exports, health checks, maintenance, and deployment hooks
- Authorized diagnostics and administration
level: medium
modified: '2026-10-29'
defender_web_child.kql
// Behavioral hunt, NOT CVE-specific. Microsoft Defender XDR advanced hunting.
// Select authorized Linux server devices first; table presence alone is not coverage.
// Parent names and regex are case-sensitive to mirror Linux executable names.
// Uses native DeviceProcessEvents schema, not a generic Sentinel table.
// Sources and required tuning: README.txt. Not tenant-executed.
let LinuxDevices = DeviceInfo
| where Timestamp > ago(1d)
| summarize arg_max(Timestamp, OSPlatform) by DeviceId
| where OSPlatform == "Linux"
| project DeviceId;
DeviceProcessEvents
| where Timestamp > ago(15m)
| where ActionType == "ProcessCreated"
| where DeviceId in (LinuxDevices)
| where InitiatingProcessFileName matches regex @"^(php(-fpm|-cgi)?([5-9][.][0-9]|[5-9][0-9])?|php([5-9][.][0-9]|[5-9][0-9])(-fpm|-cgi)|frankenphp|lsphp([5-9][.][0-9]|[5-9][0-9])?|apache2|httpd|nginx)$"
| where FileName in ("sh", "bash", "dash", "zsh", "ksh", "curl", "wget", "nc", "ncat", "socat", "python", "python3", "perl", "busybox", "id", "whoami", "uname")
| extend HuntTier = "direct_child"
| project Timestamp, DeviceId, DeviceName, ReportId, AccountName, HuntTier,
FileName, FolderPath, ProcessId, ProcessCommandLine,
InitiatingProcessId, InitiatingProcessFileName, InitiatingProcessCommandLine
| order by Timestamp desc
defender_web_descendant_context.kql
// Separate shell-descendant context tier, NOT CVE-specific or arbitrary-depth lineage.
// Requires populated InitiatingProcessParentFileName in known-good Linux events.
// Native schema documents the field; it does not establish your tenant's coverage.
// Preserve defender_web_child.kql: PHP -> sh is already a direct-child match.
let LinuxDevices = DeviceInfo
| where Timestamp > ago(1d)
| summarize arg_max(Timestamp, OSPlatform) by DeviceId
| where OSPlatform == "Linux"
| project DeviceId;
DeviceProcessEvents
| where Timestamp > ago(15m)
| where ActionType == "ProcessCreated"
| where DeviceId in (LinuxDevices)
| where InitiatingProcessParentFileName matches regex @"^(php(-fpm|-cgi)?([5-9][.][0-9]|[5-9][0-9])?|php([5-9][.][0-9]|[5-9][0-9])(-fpm|-cgi)|frankenphp|lsphp([5-9][.][0-9]|[5-9][0-9])?|apache2|httpd|nginx)$"
| where InitiatingProcessFileName in ("sh", "bash", "dash", "zsh", "ksh")
| where FileName in ("sh", "bash", "dash", "zsh", "ksh", "curl", "wget", "nc", "ncat", "socat", "python", "python3", "perl", "busybox", "id", "whoami", "uname")
| extend HuntTier = "shell_descendant_context"
| project Timestamp, DeviceId, DeviceName, ReportId, AccountName, HuntTier,
FileName, FolderPath, ProcessId, ProcessCommandLine,
InitiatingProcessId, InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentId, InitiatingProcessParentFileName
| order by Timestamp desc
falcon_web_child.cql
// Behavioral hunt, NOT CVE-specific. Falcon LogScale native telemetry.
// Scope the UI time picker and repository/host selection to authorized Linux servers.
// #event_simpleName is a tagged field in the official Falcon tutorial.
// ParentBaseFileName, ImageFileName, CommandLine, aid, TargetProcessId are documented.
// No tenant execution or CQL-engine parsing performed. README.txt covers blind spots.
#event_simpleName=ProcessRollup2 event_platform=Lin
| ParentBaseFileName=/^(php(-fpm|-cgi)?([5-9][.][0-9]|[5-9][0-9])?|php([5-9][.][0-9]|[5-9][0-9])(-fpm|-cgi)|frankenphp|lsphp([5-9][.][0-9]|[5-9][0-9])?|apache2|httpd|nginx)$/
| ImageFileName=/\/(sh|bash|dash|zsh|ksh|curl|wget|nc|ncat|socat|python|python3|perl|busybox|id|whoami|uname)$/
| HuntTier := "direct_child"
| select([@timestamp, aid, TargetProcessId, HuntTier, ParentBaseFileName, ImageFileName, CommandLine])
falcon_web_descendant_context.cql
// Separate shell-descendant context tier, NOT CVE-specific or arbitrary-depth lineage.
// CrowdStrike-owned query example uses GrandParentBaseFileName; validate Linux data.
// Preserve falcon_web_child.cql: PHP -> sh is already a direct-child match.
// Scope repository, host selection, and time picker before running; engine not tested.
#event_simpleName=ProcessRollup2 event_platform=Lin
| GrandParentBaseFileName=/^(php(-fpm|-cgi)?([5-9][.][0-9]|[5-9][0-9])?|php([5-9][.][0-9]|[5-9][0-9])(-fpm|-cgi)|frankenphp|lsphp([5-9][.][0-9]|[5-9][0-9])?|apache2|httpd|nginx)$/
| ParentBaseFileName=/^(sh|bash|dash|zsh|ksh)$/
| ImageFileName=/\/(sh|bash|dash|zsh|ksh|curl|wget|nc|ncat|socat|python|python3|perl|busybox|id|whoami|uname)$/
| HuntTier := "shell_descendant_context"
| select([@timestamp, aid, TargetProcessId, HuntTier, GrandParentBaseFileName, ParentBaseFileName, ImageFileName, CommandLine])
splunk_web_child.spl
index=REPLACE_LINUX_SYSMON_INDEX "Linux-Sysmon" "<EventID>1</EventID>"
| rex field=_raw "<Provider Name=\"(?<Provider>[^\"]+)\""
| rex field=_raw "<EventID>(?<EventID>[^<]*)</EventID>"
| where Provider="Linux-Sysmon" AND EventID="1"
| rex field=_raw "<Data Name=\"Image\">(?<Image>[^<]*)</Data>"
| rex field=_raw "<Data Name=\"ParentImage\">(?<ParentImage>[^<]*)</Data>"
| rex field=_raw "<Data Name=\"CommandLine\">(?<CommandLine>[^<]*)</Data>"
| rex field=_raw "<Data Name=\"User\">(?<User>[^<]*)</Data>"
| eval CommandLine=replace(replace(replace(replace(replace(CommandLine,""","\""),"'","'"),"<","<"),">",">"),"&","&")
| where isnotnull(ParentImage) AND isnotnull(Image)
| regex ParentImage="/(php(-fpm|-cgi)?([5-9][.][0-9]|[5-9][0-9])?|php([5-9][.][0-9]|[5-9][0-9])(-fpm|-cgi)|frankenphp|lsphp([5-9][.][0-9]|[5-9][0-9])?|apache2|httpd|nginx)$"
| regex Image="/(sh|bash|dash|zsh|ksh|curl|wget|nc|ncat|socat|python|python3|perl|busybox|id|whoami|uname)$"
| table _time host User ParentImage Image CommandLine
sumologic_web_child.query
_sourceCategory=REPLACE_LINUX_SYSMON_SOURCE_CATEGORY
| parse regex "(?<xml><Event(?: [^>]*)?>.*</Event>)"
| parse xml field=xml "/Event/System/Provider/@Name" as Provider
| parse xml field=xml "/Event/System/EventID/text()" as EventID
| where Provider="Linux-Sysmon" and EventID="1"
| parse xml field=xml "/Event/EventData/Data[@Name='ParentImage']/text()" as ParentImage
| parse xml field=xml "/Event/EventData/Data[@Name='Image']/text()" as Image
| parse xml field=xml "/Event/EventData/Data[@Name='CommandLine']/text()" as CommandLine nodrop
| parse xml field=xml "/Event/EventData/Data[@Name='User']/text()" as User nodrop
| where !isNull(ParentImage) and !isNull(Image)
| where ParentImage matches /\/(php(-fpm|-cgi)?([5-9][.][0-9]|[5-9][0-9])?|php([5-9][.][0-9]|[5-9][0-9])(-fpm|-cgi)|frankenphp|lsphp([5-9][.][0-9]|[5-9][0-9])?|apache2|httpd|nginx)$/ and Image matches /\/(sh|bash|dash|zsh|ksh|curl|wget|nc|ncat|socat|python|python3|perl|busybox|id|whoami|uname)$/
| fields _messagetime, _sourceHost, User, ParentImage, Image, CommandLine
sophos_live_process_snapshot.sql
-- Behavioral current-state hunt, NOT CVE-specific or historical detection.
-- Sophos Live Discover: choose Live Endpoint, Linux, authorized servers only.
-- Upstream osquery processes schema verified; confirm deployed Sophos schema.
-- Only still-running child AND parent processes can match. Exited commands miss.
-- Name can be shorthand argv[0] or a path; basename matching can therefore miss.
-- Parent PID attribution is a snapshot, not stable lifetime identity. Start-time
-- guard reduces obvious PID-reuse errors but does not prove correct lineage.
-- SQLite synthetic execution only; no Sophos/osquery tenant execution.
-- FP: legitimate application subprocesses, maintenance, authorized diagnostics.
-- Blind: no child process, renamed tools, containers not visible to this endpoint.
SELECT c.pid AS child_pid, c.name AS child_name, c.path AS child_path,
c.cmdline AS child_cmdline, c.uid AS child_uid,
c.start_time AS child_start_epoch,
p.pid AS parent_pid, p.name AS parent_name,
p.path AS parent_path, p.cmdline AS parent_cmdline,
p.start_time AS parent_start_epoch
FROM processes AS c
JOIN processes AS p ON c.parent = p.pid
WHERE c.start_time > 0 AND p.start_time > 0
AND p.start_time <= c.start_time
AND (
p.name IN ('php', 'php-fpm', 'php-cgi', 'frankenphp', 'lsphp', 'apache2', 'httpd', 'nginx')
-- GLOB uses single-character digits, not LIKE 'php%' or a regex extension.
OR p.name GLOB 'php[5-9].[0-9]' OR p.name GLOB 'php[5-9][0-9]'
OR p.name GLOB 'php-fpm[5-9].[0-9]' OR p.name GLOB 'php-fpm[5-9][0-9]'
OR p.name GLOB 'php-cgi[5-9].[0-9]' OR p.name GLOB 'php-cgi[5-9][0-9]'
OR p.name GLOB 'php[5-9].[0-9]-fpm' OR p.name GLOB 'php[5-9][0-9]-fpm'
OR p.name GLOB 'php[5-9].[0-9]-cgi' OR p.name GLOB 'php[5-9][0-9]-cgi'
OR p.name GLOB 'lsphp[5-9].[0-9]' OR p.name GLOB 'lsphp[5-9][0-9]'
)
AND c.name IN (
'sh', 'bash', 'dash', 'zsh', 'ksh', 'curl', 'wget', 'nc', 'ncat',
'socat', 'python', 'python3', 'perl', 'busybox', 'id', 'whoami', 'uname'
);
Advanced engineering and specialty rules
The earlier adapters, YARA and network-content rules remain in the advanced section of the bundle. Start with the native routes above.