PHP File Creation in WordPress Plugin Directory

Last updated a day ago on 2026-07-20
Created a day ago on 2026-07-20

About

Detects the creation of a PHP file in the WordPress plugin directory, which is a common technique used by attackers to establish persistence on a compromised web server. Attackers may upload a malicious PHP file and call it from a web browser to gain remote access to the server.
Tags
Domain: EndpointOS: LinuxUse Case: Threat DetectionTactic: PersistenceTactic: Initial AccessUse Case: VulnerabilityData Source: Elastic DefendLanguage: eql
Severity
low
Risk Score
21
MITRE ATT&CK™

Persistence (TA0003)(external, opens in a new tab or window)

Initial Access (TA0001)(external, opens in a new tab or window)

Execution (TA0002)(external, opens in a new tab or window)

False Positive Examples
Web servers or administrators may create PHP files in the WordPress plugin directory during maintenance.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.file*
Related Integrations

endpoint(external, opens in a new tab or window)

Query
text code block:
file where host.os.type == "linux" and event.type in ("creation", "change") and ( process.name in ( "nginx", "apache2", "httpd", "php-cgi", "php-fcgi", "php-cgi.cagefs", "sw-engine-fpm", "wget", "curl", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "mksh", "busybox" ) or process.name like ("php-fpm*", "lsphp*", "*.cgi", "*.fcgi") ) and file.path like~ "*/wp-content/plugins/*.php*"

Install detection rules in Elastic Security

Detect PHP File Creation in WordPress Plugin Directory in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).