heroui logo

Php Inline Command Execution

Sigma Rules

View Source
Summary
This rule aims to detect potentially malicious activity involving PHP execution on Windows systems by monitoring for command-line invocations utilizing the "-r" flag with the `php.exe` executable. The use of the "-r" option in PHP permits the execution of PHP code passed as a string directly in the command line. This capability, while legitimate for administrative or development purposes, poses a security risk as it can be exploited by malicious actors to execute arbitrary PHP code or establish reverse shells without leaving typical script-based indicators. The detection logic captures instances where process creation events include the `php.exe` image and the command line contains the mention of the '-r' flag, thereby identifying potentially harmful inline script execution. This rule is particularly relevant for environments where PHP is deployed, and given its medium severity level, security teams are advised to investigate the events triggered by this rule for any signs of exploitation or unauthorized access.
Categories
  • Endpoint
  • Windows
Data Sources
  • Process
Created: 2023-01-02